Skip to content

Commit

Permalink
Fix semantic tokens (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanBoltonMN authored Sep 8, 2022
1 parent 28f7425 commit 81f6911
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-powerquery",
"version": "0.1.43",
"version": "0.1.44",
"displayName": "Power Query / M Language",
"description": "Language service for the Power Query / M formula language",
"author": "Microsoft Corporation",
Expand Down
11 changes: 7 additions & 4 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,13 @@ connection.onRequest("powerquery/semanticTokens", async (params: SemanticTokenPa
const traceManager: PQP.Trace.TraceManager = TraceManagerUtils.createTraceManager(document.uri, "semanticTokens");
const analysis: PQLS.Analysis = createAnalysis(document, traceManager);

try {
return await analysis.getPartialSemanticTokens(pqpCancellationToken);
} catch (error) {
ErrorUtils.handleError(connection, error, "semanticTokens");
const result: PQP.Result<PQLS.PartialSemanticToken[] | undefined, PQP.CommonError.CommonError> =
await analysis.getPartialSemanticTokens(pqpCancellationToken);

if (PQP.ResultUtils.isOk(result)) {
return result.value ?? [];
} else {
ErrorUtils.handleError(connection, result.error, "semanticTokens");

return [];
}
Expand Down

0 comments on commit 81f6911

Please sign in to comment.