Class XMLExtensionsRegistry

java.lang.Object
org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry
All Implemented Interfaces:
IComponentProvider, IDiagnosticsRefresher
Direct Known Subclasses:
XMLLanguageService

public class XMLExtensionsRegistry extends Object implements IComponentProvider, IDiagnosticsRefresher
XML extensions registry.
  • Constructor Details

    • XMLExtensionsRegistry

      public XMLExtensionsRegistry()
  • Method Details

    • registerComponent

      public void registerComponent(Object component)
    • getComponent

      public <T> T getComponent(Class clazz)
      Description copied from interface: IComponentProvider
      Returns the component class instance from the given class and null otherwise.
      Specified by:
      getComponent in interface IComponentProvider
      Parameters:
      clazz - class of the component.
      Returns:
      the component class instance from the given class and null otherwise.
    • registerGrammarReferenceContributor

      public void registerGrammarReferenceContributor(IGrammarReferenceContributor contributor)
    • getGrammarReferenceContributors

      public List<IGrammarReferenceContributor> getGrammarReferenceContributors()
    • registerIndexFileScannerContributor

      public void registerIndexFileScannerContributor(IIndexFileScannerContributor contributor)
    • getIndexFileScannerContributors

      public List<IIndexFileScannerContributor> getIndexFileScannerContributors()
    • initializeParams

      public void initializeParams(org.eclipse.lsp4j.InitializeParams params)
    • doSave

      public void doSave(ISaveContext saveContext)
    • notifyInitialized

      public void notifyInitialized(org.eclipse.lsp4j.InitializedParams params)
    • getExtensions

      public Collection<IXMLExtension> getExtensions()
    • getCompletionParticipants

      public Collection<ICompletionParticipant> getCompletionParticipants()
    • getHoverParticipants

      public Collection<IHoverParticipant> getHoverParticipants()
    • getDiagnosticsParticipants

      public Collection<IDiagnosticsParticipant> getDiagnosticsParticipants()
    • getCodeActionsParticipants

      public List<ICodeActionParticipant> getCodeActionsParticipants()
    • getDocumentLinkParticipants

      public Collection<IDocumentLinkParticipant> getDocumentLinkParticipants()
    • getDocumentColorParticipants

      public Collection<IDocumentColorParticipant> getDocumentColorParticipants()
    • getDefinitionParticipants

      public Collection<IDefinitionParticipant> getDefinitionParticipants()
    • getTypeDefinitionParticipants

      public Collection<ITypeDefinitionParticipant> getTypeDefinitionParticipants()
    • getReferenceParticipants

      public Collection<IReferenceParticipant> getReferenceParticipants()
    • getCodeLensParticipants

      public Collection<ICodeLensParticipant> getCodeLensParticipants()
    • getHighlightingParticipants

      public Collection<IHighlightingParticipant> getHighlightingParticipants()
    • getRenameParticipants

      public Collection<IRenameParticipant> getRenameParticipants()
    • getLinkedEditingRangesParticipants

      public List<ILinkedEditingRangesParticipant> getLinkedEditingRangesParticipants()
    • getFormatterParticipants

      public Collection<IFormatterParticipant> getFormatterParticipants()
    • getSymbolsProviderParticipants

      public Collection<ISymbolsProviderParticipant> getSymbolsProviderParticipants()
    • getWorkspaceServiceParticipants

      public Collection<IWorkspaceServiceParticipant> getWorkspaceServiceParticipants()
      Return the registered workspace service participants.
      Returns:
      the registered workspace service participants.
      Since:
      0.14.2
    • getDocumentLifecycleParticipants

      public List<IDocumentLifecycleParticipant> getDocumentLifecycleParticipants()
      Return the registered document lifecycle participants.
      Returns:
      the registered document lifecycle participants.
      Since:
      0.18.0
    • getInlineCompletionParticipants

      public List<IInlineCompletionParticipant> getInlineCompletionParticipants()
      Return the registered inline completion participants.
      Returns:
      the registered inline completion participants.
    • initializeIfNeeded

      public void initializeIfNeeded()
    • dispose

      public void dispose()
      Unregisters all registered extensions.
    • registerCompletionParticipant

      public void registerCompletionParticipant(ICompletionParticipant completionParticipant)
    • unregisterCompletionParticipant

      public void unregisterCompletionParticipant(ICompletionParticipant completionParticipant)
    • registerHoverParticipant

      public void registerHoverParticipant(IHoverParticipant hoverParticipant)
    • unregisterHoverParticipant

      public void unregisterHoverParticipant(IHoverParticipant hoverParticipant)
    • registerDiagnosticsParticipant

      public void registerDiagnosticsParticipant(IDiagnosticsParticipant diagnosticsParticipant)
    • unregisterDiagnosticsParticipant

      public void unregisterDiagnosticsParticipant(IDiagnosticsParticipant diagnosticsParticipant)
    • registerCodeActionParticipant

      public void registerCodeActionParticipant(ICodeActionParticipant codeActionsParticipant)
    • unregisterCodeActionParticipant

      public void unregisterCodeActionParticipant(ICodeActionParticipant codeActionsParticipant)
    • registerDocumentLinkParticipant

      public void registerDocumentLinkParticipant(IDocumentLinkParticipant documentLinkParticipant)
    • unregisterDocumentLinkParticipant

      public void unregisterDocumentLinkParticipant(IDocumentLinkParticipant documentLinkParticipant)
    • registerDocumentColorParticipant

      public void registerDocumentColorParticipant(IDocumentColorParticipant documentColorParticipant)
    • unregisterDocumentColorParticipant

      public void unregisterDocumentColorParticipant(IDocumentColorParticipant documentColorParticipant)
    • registerDefinitionParticipant

      public void registerDefinitionParticipant(IDefinitionParticipant definitionParticipant)
    • unregisterDefinitionParticipant

      public void unregisterDefinitionParticipant(IDefinitionParticipant definitionParticipant)
    • registerTypeDefinitionParticipant

      public void registerTypeDefinitionParticipant(ITypeDefinitionParticipant typeDefinitionParticipant)
    • unregisterTypeDefinitionParticipant

      public void unregisterTypeDefinitionParticipant(ITypeDefinitionParticipant typeDefinitionParticipant)
    • registerReferenceParticipant

      public void registerReferenceParticipant(IReferenceParticipant referenceParticipant)
    • unregisterReferenceParticipant

      public void unregisterReferenceParticipant(IReferenceParticipant referenceParticipant)
    • registerCodeLensParticipant

      public void registerCodeLensParticipant(ICodeLensParticipant codeLensParticipant)
    • unregisterCodeLensParticipant

      public void unregisterCodeLensParticipant(ICodeLensParticipant codeLensParticipant)
    • registerHighlightingParticipant

      public void registerHighlightingParticipant(IHighlightingParticipant highlightingParticipant)
    • unregisterHighlightingParticipant

      public void unregisterHighlightingParticipant(IHighlightingParticipant highlightingParticipant)
    • registerRenameParticipant

      public void registerRenameParticipant(IRenameParticipant renameParticipant)
    • unregisterRenameParticipant

      public void unregisterRenameParticipant(IRenameParticipant renameParticipant)
    • registerLinkedEditingRangesParticipants

      public void registerLinkedEditingRangesParticipants(ILinkedEditingRangesParticipant linkedEditingRangesParticipant)
    • unregisterLinkedEditingRangesParticipants

      public void unregisterLinkedEditingRangesParticipants(ILinkedEditingRangesParticipant linkedEditingRangesParticipant)
    • registerFormatterParticipant

      public void registerFormatterParticipant(IFormatterParticipant formatterParticipant)
    • unregisterFormatterParticipant

      public void unregisterFormatterParticipant(IFormatterParticipant formatterParticipant)
    • registerSymbolsProviderParticipant

      public void registerSymbolsProviderParticipant(ISymbolsProviderParticipant symbolsProviderParticipant)
    • unregisterSymbolsProviderParticipant

      public void unregisterSymbolsProviderParticipant(ISymbolsProviderParticipant symbolsProviderParticipant)
    • registerWorkspaceServiceParticipant

      public void registerWorkspaceServiceParticipant(IWorkspaceServiceParticipant workspaceServiceParticipant)
      Register a new workspace service participant
      Parameters:
      workspaceServiceParticipant - the participant to register
      Since:
      0.14.2
    • unregisterWorkspaceServiceParticipant

      public void unregisterWorkspaceServiceParticipant(IWorkspaceServiceParticipant workspaceServiceParticipant)
      Unregister a new workspace service participant.
      Parameters:
      workspaceServiceParticipant - the participant to unregister
      Since:
      0.14.2
    • registerDocumentLifecycleParticipant

      public void registerDocumentLifecycleParticipant(IDocumentLifecycleParticipant documentLifecycleParticipant)
      Register a new document lifecycle participant
      Parameters:
      documentLifecycleParticipant - the participant to register
      Since:
      0.18.0
    • unregisterDocumentLifecycleParticipant

      public void unregisterDocumentLifecycleParticipant(IDocumentLifecycleParticipant documentLifecycleParticipant)
      Unregister a new document lifecycle participant.
      Parameters:
      documentLifecycleParticipant - the participant to unregister
      Since:
      0.18.0
    • registerInlineCompletionParticipant

      public void registerInlineCompletionParticipant(IInlineCompletionParticipant inlineCompletionParticipant)
      Register a new inline completion participant
      Parameters:
      inlineCompletionParticipant - the participant to register
    • unregisterInlineCompletionParticipant

      public void unregisterInlineCompletionParticipant(IInlineCompletionParticipant inlineCompletionParticipant)
      Unregister an inline completion participant.
      Parameters:
      inlineCompletionParticipant - the participant to unregister
    • getSemanticTokensParticipants

      public List<ISemanticTokensParticipant> getSemanticTokensParticipants()
      Return the registered semantic tokens participants.
      Returns:
      the registered semantic tokens participants.
    • registerSemanticTokensParticipant

      public void registerSemanticTokensParticipant(ISemanticTokensParticipant semanticTokensParticipant)
      Register a new semantic tokens participant.
      Parameters:
      semanticTokensParticipant - the participant to register.
    • unregisterSemanticTokensParticipant

      public void unregisterSemanticTokensParticipant(ISemanticTokensParticipant semanticTokensParticipant)
      Unregister a semantic tokens participant.
      Parameters:
      semanticTokensParticipant - the participant to unregister.
    • getInlayHintParticipants

      public List<IInlayHintParticipant> getInlayHintParticipants()
      Return the registered inlay hint participants.
      Returns:
      the registered inlay hint participants.
    • registerInlayHintParticipant

      public void registerInlayHintParticipant(IInlayHintParticipant inlayHintParticipant)
      Register a new inlay hint participant.
      Parameters:
      inlayHintParticipant - the participant to register.
    • unregisterInlayHintParticipant

      public void unregisterInlayHintParticipant(IInlayHintParticipant inlayHintParticipant)
      Unregister an inlay hint participant.
      Parameters:
      inlayHintParticipant - the participant to unregister.
    • getDocumentProvider

      public IXMLDocumentProvider getDocumentProvider()
      Returns the XML Document provider and null otherwise.
      Returns:
      the XML Document provider and null otherwise.
    • setDocumentProvider

      public void setDocumentProvider(IXMLDocumentProvider documentProvider)
      Set the XML Document provider
      Parameters:
      documentProvider - XML Document provider
    • getResolverExtensionManager

      public URIResolverExtensionManager getResolverExtensionManager()
    • getNotificationService

      public IXMLNotificationService getNotificationService()
      Returns the notification service
      Returns:
      the notification service
    • setNotificationService

      public void setNotificationService(IXMLNotificationService notificationService)
      Sets the notification service
      Parameters:
      notificationService - the new notification service
    • getValidationService

      public IXMLValidationService getValidationService()
      Returns the XML document validation service
      Returns:
      the validation service
    • setValidationService

      public void setValidationService(IXMLValidationService validationService)
      Sets the XML document validation service
      Parameters:
      validationService -
    • getCommandService

      public IXMLCommandService getCommandService()
      Returns the LS command service
      Returns:
      the command service
    • setCommandService

      public void setCommandService(IXMLCommandService commandService)
      Sets the LS command service
      Parameters:
      commandService -
    • getTelemetryManager

      public TelemetryManager getTelemetryManager()
    • setTelemetryManager

      public void setTelemetryManager(TelemetryManager telemetryManager)
    • setProgressSupport

      public void setProgressSupport(ProgressSupport progressSupport)
    • getProgressSupport

      public ProgressSupport getProgressSupport()
    • setCodeLensRefresher

      public void setCodeLensRefresher(Consumer<Predicate<String>> refresher)
    • setDiagnosticsRefresher

      public void setDiagnosticsRefresher(Consumer<Predicate<DOMDocument>> refresher)
    • refreshDiagnostics

      public void refreshDiagnostics(Predicate<DOMDocument> documentFilter)
      Triggers a diagnostics re-publish for all open documents accepted by documentFilter. Extensions that need to push updated diagnostics after an asynchronous event (e.g. workspace index scan completed) call this instead of hard-coding document iteration.

      This is the async counterpart of IDiagnosticsRefresher.refreshDiagnostics(java.util.function.Predicate<org.eclipse.lemminx.dom.DOMDocument>).

      Specified by:
      refreshDiagnostics in interface IDiagnosticsRefresher
      Parameters:
      documentFilter - predicate applied to each open DOMDocument.
    • refreshCodeLenses

      public void refreshCodeLenses()
      Requests a code-lens refresh for all open documents.
    • refreshCodeLenses

      public void refreshCodeLenses(Predicate<String> uriFilter)
      Requests a code-lens refresh, but only if at least one open document has a URI accepted by uriFilter. Callers that know which document types their lenses affect should pass a precise filter to avoid unnecessary client notifications when no relevant documents are open.