mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
🧹 lsp_ext.ts
This commit is contained in:
parent
544c581e5f
commit
64110714f0
3 changed files with 130 additions and 158 deletions
|
@ -172,12 +172,10 @@ export async function createClient(
|
|||
)
|
||||
.then(
|
||||
(result) => {
|
||||
if (!result) return null;
|
||||
const hover = client.protocol2CodeConverter.asHover(result);
|
||||
if (hover) {
|
||||
const actions = (<any>result).actions;
|
||||
if (actions) {
|
||||
hover.contents.push(renderHoverActions(actions));
|
||||
}
|
||||
if (!!result.actions) {
|
||||
hover.contents.push(renderHoverActions(result.actions));
|
||||
}
|
||||
return hover;
|
||||
},
|
||||
|
@ -310,26 +308,27 @@ class ExperimentalFeatures implements lc.StaticFeature {
|
|||
return { kind: "static" };
|
||||
}
|
||||
fillClientCapabilities(capabilities: lc.ClientCapabilities): void {
|
||||
const caps: any = capabilities.experimental ?? {};
|
||||
caps.snippetTextEdit = true;
|
||||
caps.codeActionGroup = true;
|
||||
caps.hoverActions = true;
|
||||
caps.serverStatusNotification = true;
|
||||
caps.colorDiagnosticOutput = true;
|
||||
caps.openServerLogs = true;
|
||||
caps.commands = {
|
||||
commands: [
|
||||
"rust-analyzer.runSingle",
|
||||
"rust-analyzer.debugSingle",
|
||||
"rust-analyzer.showReferences",
|
||||
"rust-analyzer.gotoLocation",
|
||||
"editor.action.triggerParameterHints",
|
||||
],
|
||||
capabilities.experimental = {
|
||||
snippetTextEdit: true,
|
||||
codeActionGroup: true,
|
||||
hoverActions: true,
|
||||
serverStatusNotification: true,
|
||||
colorDiagnosticOutput: true,
|
||||
openServerLogs: true,
|
||||
commands: {
|
||||
commands: [
|
||||
"rust-analyzer.runSingle",
|
||||
"rust-analyzer.debugSingle",
|
||||
"rust-analyzer.showReferences",
|
||||
"rust-analyzer.gotoLocation",
|
||||
"editor.action.triggerParameterHints",
|
||||
],
|
||||
},
|
||||
...capabilities.experimental,
|
||||
};
|
||||
capabilities.experimental = caps;
|
||||
}
|
||||
initialize(
|
||||
_capabilities: lc.ServerCapabilities<any>,
|
||||
_capabilities: lc.ServerCapabilities,
|
||||
_documentSelector: lc.DocumentSelector | undefined
|
||||
): void {}
|
||||
dispose(): void {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue