-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce language server latency (#1003)
* avoid recomputing project roots and ReScript versions as much as possible * more precomputation * changelog
- Loading branch information
Showing
5 changed files
with
117 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as cp from "node:child_process"; | ||
import * as p from "vscode-languageserver-protocol"; | ||
|
||
export type filesDiagnostics = { | ||
[key: string]: p.Diagnostic[]; | ||
}; | ||
|
||
interface projectFiles { | ||
openFiles: Set<string>; | ||
filesWithDiagnostics: Set<string>; | ||
filesDiagnostics: filesDiagnostics; | ||
rescriptVersion: string | undefined; | ||
bscBinaryLocation: string | null; | ||
namespaceName: string | null; | ||
|
||
bsbWatcherByEditor: null | cp.ChildProcess; | ||
|
||
// This keeps track of whether we've prompted the user to start a build | ||
// automatically, if there's no build currently running for the project. We | ||
// only want to prompt the user about this once, or it becomes | ||
// annoying. | ||
// The type `never` means that we won't show the prompt if the project is inside node_modules | ||
hasPromptedToStartBuild: boolean | "never"; | ||
} | ||
|
||
export let projectsFiles: Map<string, projectFiles> = // project root path | ||
new Map(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters