Skip to content

Commit 9b55e1e

Browse files
committed
codeLen的引用可以点了
1 parent 995832a commit 9b55e1e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

client/src/languageserver.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ function registerCustomCommands(context: ExtensionContext) {
9595
context.subscriptions.push(Commands.registerCommand('lua.stopServer', async () => {
9696
deactivate();
9797
}));
98+
99+
context.subscriptions.push(Commands.registerCommand('lua.showReferences', (uri: string, position: Record<string, number>, locations: any[]) => {
100+
vscode.commands.executeCommand(
101+
'editor.action.showReferences',
102+
vscode.Uri.parse(uri),
103+
new vscode.Position(position.line, position.character),
104+
locations.map((value) => {
105+
return new vscode.Location(
106+
vscode.Uri.parse(value.uri as any as string),
107+
new vscode.Range(
108+
value.range.start.line,
109+
value.range.start.character,
110+
value.range.end.line,
111+
value.range.end.character,
112+
),
113+
);
114+
})
115+
);
116+
}));
98117
}
99118

100119
/** Creates a new {@link LuaClient} and starts it. */
@@ -134,6 +153,7 @@ class LuaClient extends Disposable {
134153
viewDocument: true,
135154
trustByClient: true,
136155
useSemanticByRange: true,
156+
codeLensViewReferences: true,
137157
},
138158
};
139159

0 commit comments

Comments
 (0)