Prevent requestWorkerFormat during LSP project init
MODIFY
packages/@romejs/core/server/lsp/LSPServer.ts
packages/@romejs/core/server/lsp/LSPServer.ts
@@ -525,6 +525,14 @@ export default class LSPServer {
return null;
}
+ if (!this.lintSessions.has(project.folder)) {
+ this.logMessage(
+ path,
+ "Formatting unavailable while initializing project.",
+ );
+ return null;
+ }
+
const {value, diagnostics} = await catchDiagnostics(async () => {
return this.request.requestWorkerFormat(path, {});
});

Prevent requestWorkerFormat during LSP project init (#682)