Skip to content

Commit 9e9058e

Browse files
committed
Make server.definition async
1 parent a3b5d14 commit 9e9058e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ async function signatureHelp(msg: p.RequestMessage) {
517517
return response;
518518
}
519519

520-
function definition(msg: p.RequestMessage) {
520+
async function definition(msg: p.RequestMessage) {
521521
// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition
522522
let params = msg.params as p.DefinitionParams;
523523
let filePath = fileURLToPath(params.textDocument.uri);
524-
let response = utils.runAnalysisCommand(
524+
let response = await utils.runAnalysisCommand(
525525
filePath,
526526
["definition", filePath, params.position.line, params.position.character],
527527
msg
@@ -1226,7 +1226,7 @@ async function onMessage(msg: p.Message) {
12261226
} else if (msg.method === p.HoverRequest.method) {
12271227
send(await hover(msg));
12281228
} else if (msg.method === p.DefinitionRequest.method) {
1229-
send(definition(msg));
1229+
send(await definition(msg));
12301230
} else if (msg.method === p.TypeDefinitionRequest.method) {
12311231
send(typeDefinition(msg));
12321232
} else if (msg.method === p.ReferencesRequest.method) {

0 commit comments

Comments
 (0)