Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't patch solution project in ts plugin #2617

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/typescript-plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ export function hasNodeModule(startPath: string, module: string) {
}

export function isSvelteProject(project: ts.server.Project) {
// internal api, the way to check requires checking the files config in tsconfig.json
// so we can't reimplement it without reading the tsconfig.json again
// The solution project is mostly just a container we don't need to patch it
// and having any files in this project cause TSServer to send config error while it originally won't
if ((project as any).isSolution?.()) {
return false;
}

const projectDirectory = getProjectDirectory(project);
if (projectDirectory) {
return hasNodeModule(projectDirectory, 'svelte');
Expand Down
Loading