Skip to content

Commit 2665678

Browse files
ah-yuZhang
and
Zhang
authored
fix: don't show "start a build" if the file is in node_modules (#472)
* do show prompt if in node_modules * fix * reset ci Co-authored-by: Zhang <zheyzhang@HANM18365.local>
1 parent 6853bbf commit 2665678

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ let projectsFiles: Map<
4747
// automatically, if there's no build currently running for the project. We
4848
// only want to prompt the user about this once, or it becomes
4949
// annoying.
50-
hasPromptedToStartBuild: boolean;
50+
// The type `never` means that we won't show the prompt if the project is inside node_modules
51+
hasPromptedToStartBuild: boolean | "never";
5152
}
5253
> = new Map();
5354
// ^ caching AND states AND distributed system. Why does LSP has to be stupid like this
@@ -188,7 +189,7 @@ let openedFile = (fileUri: string, fileContent: string) => {
188189
openFiles: new Set(),
189190
filesWithDiagnostics: new Set(),
190191
bsbWatcherByEditor: null,
191-
hasPromptedToStartBuild: false,
192+
hasPromptedToStartBuild: /(\/|\\)node_modules(\/|\\)/.test(projectRootPath) ? "never" : false,
192193
};
193194
projectsFiles.set(projectRootPath, projectRootState);
194195
compilerLogsWatcher.add(

0 commit comments

Comments
 (0)