Skip to content

Commit 030687a

Browse files
committed
Attempt to diagnose
1 parent f8f92e7 commit 030687a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

apps/lsp/src/index.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import {
2929
WorkspaceSymbol
3030
} from "vscode-languageserver";
3131

32-
import { CompletionItem, Hover, Location } from "vscode-languageserver-types"
32+
import { CompletionItem, Hover, Location } from "vscode-languageserver-types";
3333

34-
import { createConnection } from "vscode-languageserver/node"
34+
import { createConnection } from "vscode-languageserver/node";
3535

3636
import { URI } from "vscode-uri";
3737
import { TextDocument } from "vscode-languageserver-textdocument";
@@ -48,6 +48,8 @@ import { initializeQuarto } from "./quarto";
4848
import { registerDiagnostics } from "./diagnostics";
4949

5050

51+
console.log('LSP INDEX CODE PATH before createConnection');
52+
5153
// Create a connection for the server. The connection uses Node's IPC as a transport.
5254
// Also include all preview / proposed LSP features.
5355
const connection = createConnection(ProposedFeatures.all);
@@ -72,7 +74,10 @@ let initializationOptions: LspInitializationOptions | undefined;
7274
// Markdown language service
7375
let mdLs: IMdLanguageService | undefined;
7476

77+
console.log('LSP INDEX CODE PATH');
78+
7579
connection.onInitialize((params: InitializeParams) => {
80+
console.log('LSP INDEX CODE PATH onInitialize');
7681
// Set log level from initialization options if provided so that we use the
7782
// expected level as soon as possible
7883
const initLogLevel = Logger.parseLogLevel(
@@ -98,7 +103,7 @@ connection.onInitialize((params: InitializeParams) => {
98103
}
99104

100105
return mdLs?.getCompletionItems(document, params.position, params.context, config, token) || [];
101-
})
106+
});
102107

103108
connection.onHover(async (params, token): Promise<Hover | null | undefined> => {
104109
logger.logRequest('hover');
@@ -108,7 +113,7 @@ connection.onInitialize((params: InitializeParams) => {
108113
return null;
109114
}
110115
return mdLs?.getHover(document, params.position, config, token);
111-
})
116+
});
112117

113118

114119
connection.onDocumentLinks(async (params, token): Promise<DocumentLink[]> => {
@@ -214,6 +219,7 @@ connection.onInitialize((params: InitializeParams) => {
214219

215220
// further config dependent initialization
216221
connection.onInitialized(async () => {
222+
console.log('LSP INDEX CODE PATH onInitialized');
217223
logger.logNotification('initialized');
218224

219225
// sync config if possible
@@ -249,7 +255,7 @@ connection.onInitialized(async () => {
249255
capabilities!,
250256
config,
251257
logger
252-
)
258+
);
253259

254260
// initialize parser
255261
const parser = markdownitParser();
@@ -279,7 +285,7 @@ connection.onInitialized(async () => {
279285
onRequest(method: string, handler: (params: unknown[]) => Promise<unknown>) {
280286
return connection.onRequest(method, handler);
281287
}
282-
}
288+
};
283289

284290
// register custom methods
285291
registerCustomMethods(quarto, lspConnection, documents);

0 commit comments

Comments
 (0)