Skip to content

Commit 89c001b

Browse files
authored
fix: don't patch solution project in ts plugin (#2617)
part of #2612
1 parent 02db54d commit 89c001b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/typescript-plugin/src/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ export function hasNodeModule(startPath: string, module: string) {
255255
}
256256

257257
export function isSvelteProject(project: ts.server.Project) {
258+
// internal api, the way to check requires checking the files config in tsconfig.json
259+
// so we can't reimplement it without reading the tsconfig.json again
260+
// The solution project is mostly just a container we don't need to patch it
261+
// and having any files in this project cause TSServer to send config error while it originally won't
262+
if ((project as any).isSolution?.()) {
263+
return false;
264+
}
265+
258266
const projectDirectory = getProjectDirectory(project);
259267
if (projectDirectory) {
260268
return hasNodeModule(projectDirectory, 'svelte');

0 commit comments

Comments
 (0)