Skip to content

Commit 83eff21

Browse files
0dinDfbricon
authored andcommitted
Move semantic tokens to LSP implementation
Signed-off-by: 0dinD <zerodind@gmail.com>
1 parent a407886 commit 83eff21

File tree

8 files changed

+19
-162
lines changed

8 files changed

+19
-162
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ The following settings are supported:
173173
Default launch mode is `Hybrid`. Legacy mode is `Standard`
174174
* `java.sources.organizeImports.starThreshold`: Specifies the number of imports added before a star-import declaration is used, default is 99.
175175
* `java.sources.organizeImports.staticStarThreshold`: Specifies the number of static imports added before a star-import declaration is used, default is 99.
176-
* `java.semanticHighlighting.enabled`: Enable/disable [Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) for Java files. Defaults to `true`.
177176
* `java.imports.gradle.wrapper.checksums`: Defines allowed/disallowed SHA-256 checksums of Gradle Wrappers.
178177
* `java.project.importOnFirstTimeStartup`: Specifies whether to import the Java projects, when opening the folder in Hybrid mode for the first time. Supported values are `disabled` (never imports), `interactive` (asks to import or not), `automatic` (always imports). Default to `automatic`.
179178
* `java.project.importHint`: Enable/disable the server-mode switch information, when Java projects import is skipped on startup. Defaults to `true`.
@@ -197,7 +196,7 @@ The following settings are supported:
197196

198197
Semantic Highlighting
199198
===============
200-
[Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) is controlled by the `java.semanticHighlighting.enabled` preference. When enabled, it fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience different small issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing.
199+
[Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience a few minor issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing. Semantic highlighting can be disabled for all languages using the `editor.semanticHighlighting.enabled` setting, or for Java only using [language-specific editor settings](https://code.visualstudio.com/docs/getstarted/settings#_languagespecific-editor-settings).
201200

202201
Troubleshooting
203202
===============

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,6 @@
710710
"scope": "window",
711711
"minimum": 1
712712
},
713-
"java.semanticHighlighting.enabled": {
714-
"type": "boolean",
715-
"default": true,
716-
"description": "Enable/disable the semantic highlighting.",
717-
"scope": "window"
718-
},
719713
"java.imports.gradle.wrapper.checksums": {
720714
"type": "array",
721715
"items": {
@@ -1115,7 +1109,7 @@
11151109
"fmtr": "^1.1.2",
11161110
"fs-extra": "^8.1.0",
11171111
"glob": "^7.1.3",
1118-
"vscode-languageclient": "7.0.0",
1112+
"vscode-languageclient": "7.1.0-next.5",
11191113
"winreg-utf8": "^0.1.1",
11201114
"winston": "^3.2.1",
11211115
"winston-daily-rotate-file": "^3.10.0"

src/commands.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,6 @@ export namespace Commands {
230230
* Get all java projects root path in URI format
231231
*/
232232
export const GET_ALL_JAVA_PROJECTS = 'java.project.getAll';
233-
/**
234-
* Temporary command for Semantic Highlighting. To remove when LSP v3.16 is ready.
235-
*/
236-
export const PROVIDE_SEMANTIC_TOKENS = 'java.project.provideSemanticTokens';
237-
/**
238-
* Temporary command to fetch Semantic Tokens Legend. To remove when LSP v3.16 is ready.
239-
*/
240-
export const GET_SEMANTIC_TOKENS_LEGEND = 'java.project.getSemanticTokensLegend';
241233
/**
242234
* Command to switch between standard mode and lightweight mode.
243235
*/

src/extension.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { StandardLanguageClient } from './standardLanguageClient';
2424
import { apiManager } from './apiManager';
2525
import { SnippetCompletionProvider } from './snippetCompletionProvider';
2626
import { runtimeStatusBarProvider } from './runtimeStatusBarProvider';
27-
import { registerSemanticTokensProvider } from './semanticTokenProvider';
2827
import { serverStatusBarProvider } from './serverStatusBarProvider';
2928
import { markdownPreviewProvider } from "./markdownPreviewProvider";
3029

@@ -325,8 +324,6 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
325324
syntaxClient.stop();
326325
fileEventHandler.setServerStatus(true);
327326
runtimeStatusBarProvider.initialize(context.storagePath);
328-
// temporary implementation Semantic Highlighting before it is part of LSP
329-
registerSemanticTokensProvider(context);
330327
}
331328
commands.executeCommand('setContext', 'java:serverMode', event);
332329
});

src/semanticTokenProvider.ts

Lines changed: 0 additions & 111 deletions
This file was deleted.

src/standardLanguageClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export class StandardLanguageClient {
9090

9191
// Create the language client and start the client.
9292
this.languageClient = new LanguageClient('java', extensionName, serverOptions, clientOptions);
93-
this.languageClient.registerProposedFeatures();
9493

9594
this.languageClient.onReady().then(() => {
9695
activationProgressNotification.showProgress();

src/utils.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,3 @@ function parseToStringGlob(patterns: string[]): string {
113113

114114
return `{${patterns.join(",")}}`;
115115
}
116-
117-
export async function waitForDocumentChangesToEnd(document: TextDocument): Promise<void> {
118-
let version = document.version;
119-
return new Promise((resolve) => {
120-
const iv = setInterval(() => {
121-
if (document.version === version) {
122-
clearInterval(iv);
123-
resolve();
124-
}
125-
version = document.version;
126-
}, 400);
127-
});
128-
}

0 commit comments

Comments
 (0)