-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of a semantic tokens reconciler
Initial implementation of a semantic tokens reconciler which supports only SemanticTokensFull. The reconciler uses the theme defined for TM4E so that the same styles are used for the same token types. In addition to the tokens defined for TM4E, also the deprecated modifier is supported by marking striking out the regions.
- Loading branch information
1 parent
114422a
commit 4547839
Showing
5 changed files
with
423 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...se.lsp4e/src/org/eclipse/lsp4e/operations/semanticTokens/SemanticHighlightReconciler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Avaloq Evolution AG. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.lsp4e.operations.semanticTokens; | ||
|
||
import org.eclipse.jface.text.IDocument; | ||
import org.eclipse.jface.text.ITextViewer; | ||
import org.eclipse.jface.text.reconciler.MonoReconciler; | ||
|
||
|
||
public class SemanticHighlightReconciler extends MonoReconciler { | ||
|
||
public SemanticHighlightReconciler() { | ||
super(new SemanticHighlightReconcilerStrategy(), false); | ||
} | ||
|
||
@Override | ||
public void install(final ITextViewer textViewer) { | ||
super.install(textViewer); | ||
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is accepted | ||
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE)).install(textViewer); | ||
} | ||
|
||
@Override | ||
public void uninstall() { | ||
super.uninstall(); | ||
// no need to do that if https://bugs.eclipse.org/bugs/show_bug.cgi?id=521326 is accepted | ||
((SemanticHighlightReconcilerStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE)).uninstall(); | ||
} | ||
|
||
} |
Oops, something went wrong.