-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
warn svelte input only when program has no svelte files at all #2488
warn svelte input only when program has no svelte files at all #2488
Conversation
Honestly, if this makes for too much complicated logic, and if this doesn't uncover an unrelated inconsistencies bug (judging from the changed code it looks you found some other things), then I would just not show the error in VS Code, and only show it in svelte-check, by checking if there are any Svelte file in the program files we iterate over to get all diagnostics. |
The reason for the project-assign change is that: If we only error when the program doesn't have any svelte files there might be an inconsistency between the editor and the svelte-check. The svelte file would use our default config, but it would use the tsconfig in svelte-check. For example, if the tsconfig.json has |
When would that happen? I'm not sure I follow. Can you give an example? |
You can create a create-vite project with typescript and svelte. Then update svelte-check to v4 and remove Svelte files from the include config. In the editor, the current logic is to assign files to a shared service without a tsconfig. But svelte-check is the other way around it loads the tsconfig and loops through the files in the program. |
But isn't that correct? In the editor you can access files outside of the includes of your tsconfig definition, so they need to go somewhere. For |
The change is only for files that are already in the program. They would already be checked in svelte-check. The other files are still assigned to the implicit project, i.e. as if there isn't a tsconfig. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I realized that this fixes exactly what I was worrying about
While implementing the delayed check. I found out that tsserver actually assigns files that aren't project files into the service that loads the files through import. And this has all sorts of inconsistent states 😅. So still need to compare the behavior to tsserver.
Fixes #2486
Fixes #2485