org.eclipse.lsp4j.SemanticHighlightingParams Java Examples
The following examples show how to use
org.eclipse.lsp4j.SemanticHighlightingParams.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultLanguageClient.java From lsp4intellij with Apache License 2.0 | 4 votes |
@Override public void semanticHighlighting(SemanticHighlightingParams params) { // Todo }
Example #2
Source File: SemanticHighlightingService.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
protected void notifyClient(VersionedTextDocumentIdentifier textDocument, List<SemanticHighlightingInformation> infos) { if (infos.isEmpty()) { return; } this.connection.semanticHighlighting(new SemanticHighlightingParams(textDocument, infos)); }
Example #3
Source File: JavaClientConnection.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
/** * @see {@link LanguageClient#semanticHighlighting(SemanticHighlightingParams)} */ public void semanticHighlighting(SemanticHighlightingParams params) { client.semanticHighlighting(params); }
Example #4
Source File: SemanticHighlightingTest.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
@Override public void semanticHighlighting(SemanticHighlightingParams params) { this.params.add(params); super.semanticHighlighting(params); }
Example #5
Source File: CommandRegistryTest.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public void semanticHighlighting(SemanticHighlightingParams params) { noImpl3.semanticHighlighting(params); }
Example #6
Source File: SemanticHighlightingRegistry.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public void update(final ILanguageServerAccess.Context context) { this.checkInitialized(); Resource _resource = context.getResource(); boolean _not = (!(_resource instanceof XtextResource)); if (_not) { return; } boolean _isDocumentOpen = context.isDocumentOpen(); boolean _not_1 = (!_isDocumentOpen); if (_not_1) { return; } Resource _resource_1 = context.getResource(); final XtextResource resource = ((XtextResource) _resource_1); IResourceServiceProvider _resourceServiceProvider = resource.getResourceServiceProvider(); ISemanticHighlightingCalculator _get = null; if (_resourceServiceProvider!=null) { _get=_resourceServiceProvider.<ISemanticHighlightingCalculator>get(ISemanticHighlightingCalculator.class); } final ISemanticHighlightingCalculator calculator = _get; IResourceServiceProvider _resourceServiceProvider_1 = resource.getResourceServiceProvider(); ISemanticHighlightingStyleToTokenMapper _get_1 = null; if (_resourceServiceProvider_1!=null) { _get_1=_resourceServiceProvider_1.<ISemanticHighlightingStyleToTokenMapper>get(ISemanticHighlightingStyleToTokenMapper.class); } final ISemanticHighlightingStyleToTokenMapper mapper = _get_1; if (((calculator == null) || this.isIgnoredMapper(mapper))) { return; } final Document document = context.getDocument(); final MergingHighlightedPositionAcceptor acceptor = new MergingHighlightedPositionAcceptor(calculator); calculator.provideHighlightingFor(resource, acceptor, CancelIndicator.NullImpl); final Function1<LightweightPosition, List<SemanticHighlightingRegistry.HighlightedRange>> _function = (LightweightPosition position) -> { final Function1<String, SemanticHighlightingRegistry.HighlightedRange> _function_1 = (String id) -> { final Position start = document.getPosition(position.getOffset()); int _offset = position.getOffset(); int _length = position.getLength(); int _plus = (_offset + _length); final Position end = document.getPosition(_plus); final int scope = this.getIndex(mapper.toScopes(id)); return new SemanticHighlightingRegistry.HighlightedRange(start, end, scope); }; return ListExtensions.<String, SemanticHighlightingRegistry.HighlightedRange>map(((List<String>)Conversions.doWrapArray(position.getIds())), _function_1); }; final Iterable<SemanticHighlightingRegistry.HighlightedRange> ranges = Iterables.<SemanticHighlightingRegistry.HighlightedRange>concat(ListExtensions.<LightweightPosition, List<SemanticHighlightingRegistry.HighlightedRange>>map(acceptor.getPositions(), _function)); final List<SemanticHighlightingInformation> lines = this.toSemanticHighlightingInformation(ranges, document); final VersionedTextDocumentIdentifier textDocument = this.toVersionedTextDocumentIdentifier(context); SemanticHighlightingParams _semanticHighlightingParams = new SemanticHighlightingParams(textDocument, lines); this.notifyClient(_semanticHighlightingParams); }
Example #7
Source File: SemanticHighlightingRegistry.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
protected void notifyClient(final SemanticHighlightingParams params) { this.client.semanticHighlighting(params); }
Example #8
Source File: LanguageClient.java From lsp4j with Eclipse Public License 2.0 | 2 votes |
/** * The {@code textDocument/semanticHighlighting} notification is pushed from the server to the client * to inform the client about additional semantic highlighting information that has to be applied * on the text document. It is the server's responsibility to decide which lines are included in * the highlighting information. In other words, the server is capable of sending only a delta * information. For instance, after opening the text document ({@code DidOpenTextDocumentNotification}) * the server sends the semantic highlighting information for the entire document, but if the server * receives a {@code DidChangeTextDocumentNotification}, it pushes the information only about * the affected lines in the document. * * <p> * <b>Note:</b> the <a href= * "https://github.com/Microsoft/vscode-languageserver-node/pull/367">{@code textDocument/semanticHighlighting} * language feature</a> is not yet part of the official LSP specification. */ @Beta @JsonNotification("textDocument/semanticHighlighting") default void semanticHighlighting(SemanticHighlightingParams params) { throw new UnsupportedOperationException(); }