eclipse-lsp4e / eclipse-lsp4e/lsp4e

Semantic Tokens support

Open
#965 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
85
Forks
69
Avg merge
8h 33m
Merged PRs (30d)
6

Description

These will be rather questions than issues @rubenporras

There is no support for workspace/semanticTokens/refresh message. At first I thought it is easy to add. I've tried the following the LangugeClientImpl:

	private void updateSemanticTokens() {
		for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
			for (IWorkbenchPage page : window.getPages()) {
				for (IEditorReference editorRef : page.getEditorReferences()) {
					IEditorPart editor = editorRef.getEditor(false);
					if (editor != null) {
						ITextViewer textViewer = UI.asTextViewer(editor);
						if (textViewer != null) {
							textViewer.invalidateTextPresentation();
						}
					}
				}
			}
		}
	}

	@Override
	public CompletableFuture<Void> refreshSemanticTokens() {
		return CompletableFuture.runAsync(() -> UI.getDisplay().asyncExec(this::updateSemanticTokens));
	}

Didn't work :-\ Any idea what I can do to make SemanticHighlightReconcilerStrategy call reconcile(final DirtyRegion dirtyRegion, final IRegion subRegion) ?

Another thing that I noticed is only keyword and variable token types had colours in the Generic editor (I'm trying to do some semantic highlighting in the properties file). All other token types listed in the LSP spec don't have any colour assigned. Is there a way for me to define colours for other token types?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the LanguageClientImpl and SemanticHighlightingReconcilerStrategy references in the issue, then compare the workspace/semanticTokens/refresh request with the current Generic editor semantic-token flow. Done would require a defined approach for triggering reconciliation after refresh and assigning colours to additional LSP token types, but the issue does not name implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.