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

Exclude sapper src/node_module svelte files from being processing? #316

Closed
sharifzadesina opened this issue Jul 16, 2020 · 7 comments
Closed
Labels
Fixed Fixed in master branch. Pending production release.

Comments

@sharifzadesina
Copy link

sharifzadesina commented Jul 16, 2020

I am using Svelte+Sapper+TypeScript, the language server always checks svelte files inside src/node_module/internal, is there a way to exclude this directory completely?
I tried to add excludes to tsconfig.json file, but no chance.

@jasonlyu123
Copy link
Member

We didn't set up the parsing of tsconfig.json to recognize .svlete extension so the language-server won't pick up any svelte file until it's opened in the editor or the file depended on it got opened.
But it does still get pick up by svelte-check though, we can adjust this to ignore src/node_module.

@PatrickG
Copy link
Member

PatrickG commented Jul 17, 2020

If you do this, please only ignore src/node_modules/@sapper.
I'm using this folder like Rich (e.g. src/node_modules/@components).

Btw, I do not have any problems with errors in src/node_modules/@sapper.

@sharifzadesina
Copy link
Author

sharifzadesina commented Jul 17, 2020

I think we need to support this exclude feature, sometimes I need to open auto-generated files and check the source, but it generates errors and I need to restart the editor to get rid of the errors.

@jasonlyu123
Copy link
Member

jasonlyu123 commented Jul 17, 2020

Then we could just empty the diagnostic of closed file. The parsing of the exclude file config is hard for us. Typescript only has an API to parse the config file but not checking if a specific file should be excluded. So every opened file got processed. Even if we allow exclude and include of svelte files. It'll still not solved the problem for you.
So I think we could just empty the diagnostic on close. That's also the behavior of vscode's typescript language feature.

@sharifzadesina
Copy link
Author

@jasonlyu123 so if it is also the behavior of typescript language I think you should also do that.
But why you are saying exclude will not solve the problem? you will check if the file is in exclude/include array of tsconfig or not.

@jasonlyu123
Copy link
Member

Exclude and include is custom glob pattern. And it also involves relative path or absolute path, defaulting to include and exclude, the files config, etc. It's a lot of work needed to recreate it in our codebase. I did try it before and have no luck making it work. Besides, I don't think vscode typescript feature check the exclude and ignore processing it if it matches exclude. Otherwise, you won't have hover info.

@dummdidumm
Copy link
Member

Regarding svelte-check: there will be a --ignore option available tomorrow #373

dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Jul 31, 2020
When a document is closed by the user, make its diagnostics disappear from the Problems tab
sveltejs#316
dummdidumm added a commit that referenced this issue Jul 31, 2020
When a document is closed by the user, make its diagnostics disappear from the Problems tab
#316
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

4 participants