Skip to content

Commit ab50010

Browse files
committed
[WIP] Update language client to 10.1.0
- Update to TypeScript 6 (TODO: split off into a different PR) - Update to `vscode-langaugeclient@^10.1.0` - Adjust to changes to language server logging API - VS Code now provides client-side log filtering based on a configured log level. This interacts in a slightly annoying way with our own server side log filtering, but ultimately both are helpful to have, since disabling logging on the client still means the server is sending trace level messages, which may be annoying Required to get `workspace/textDocumentContent` working, see eclipse-jdtls/eclipse.jdt.ls#3855 Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 0017146 commit ab50010

5 files changed

Lines changed: 63 additions & 74 deletions

File tree

package-lock.json

Lines changed: 37 additions & 62 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@
21942194
"react": "^17.0.2",
21952195
"react-dom": "^17.0.2",
21962196
"semver": "^7.5.2",
2197-
"vscode-languageclient": "8.2.0-next.3",
2197+
"vscode-languageclient": "^10.1.0",
21982198
"vscode-variables": "^1.0.1",
21992199
"winreg-utf8": "^0.1.1",
22002200
"winston": "^3.2.1",

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
286286
},
287287
resolveCompletionItem: async (item, token, next): Promise<CompletionItem> => {
288288
const completionItem = await next(item, token);
289-
if (completionItem?.documentation instanceof MarkdownString) {
290-
completionItem.documentation = fixJdtLinksInDocumentation(completionItem.documentation);
291-
}
289+
// if (completionItem?.documentation instanceof MarkdownString) {
290+
// completionItem.documentation = fixJdtLinksInDocumentation(completionItem.documentation);
291+
// }
292292
return completionItem;
293293
},
294294
// https://github.com/redhat-developer/vscode-java/issues/2130

src/outputInfoCollector.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
import { OutputChannel, window, ViewColumn } from "vscode";
1+
import { Event, LogLevel, LogOutputChannel, ViewColumn, window } from "vscode";
22
import { logger } from "./log";
33

4-
export class OutputInfoCollector implements OutputChannel {
5-
private channel: OutputChannel = null;
4+
export class OutputInfoCollector implements LogOutputChannel {
5+
private channel: LogOutputChannel = null;
66

77
constructor(public name: string) {
8-
this.channel = window.createOutputChannel(this.name);
8+
this.channel = window.createOutputChannel(this.name, { log:true });
9+
}
10+
get logLevel(): LogLevel { return this.channel.logLevel; }
11+
get onDidChangeLogLevel(): Event<LogLevel> { return this.channel.onDidChangeLogLevel; };
12+
trace(message: string, ...args: any[]): void {
13+
this.channel.trace(message, args);
14+
}
15+
debug(message: string, ...args: any[]): void {
16+
this.channel.debug(message, args);
17+
}
18+
info(message: string, ...args: any[]): void {
19+
this.channel.info(message, args);
20+
}
21+
warn(message: string, ...args: any[]): void {
22+
this.channel.warn(message, args);
23+
}
24+
error(error: string | Error, ...args: any[]): void {
25+
this.channel.error(error, args);
926
}
1027

1128
append(value: string): void {

src/providerDispatcher.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ export function registerClientProviders(context: ExtensionContext, options: Prov
2525
const symbolProvider = createDocumentSymbolProvider();
2626
context.subscriptions.push(languages.registerDocumentSymbolProvider('java', symbolProvider));
2727

28-
const jdtProvider = createJDTContentProvider(options);
29-
context.subscriptions.push(workspace.registerTextDocumentContentProvider('jdt', jdtProvider));
30-
3128
const classProvider = createClassContentProvider(options);
3229
context.subscriptions.push(workspace.registerTextDocumentContentProvider('class', classProvider));
3330

3431
overwriteWorkspaceSymbolProvider(context);
3532

3633
return {
37-
handles: [hoverProvider, symbolProvider, jdtProvider, classProvider]
34+
handles: [hoverProvider, symbolProvider, classProvider]
3835
};
3936
}
4037

0 commit comments

Comments
 (0)