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

Disable non syntax errors in files that don't have semantic capabilities #134175

Merged

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Sep 30, 2021

If we're on a host that supports semantic checking, but in a file that doesn't support semantic errors, we currently don't want to report semantic errors since these will likely complain about imports and other undefined symols

If we're on a host that supports semantic checking, but in a file that doesn't support semantic errors, we currently don't want to report semantic errors since these will likely complain about imports and other undefined symols
@mjbvz mjbvz added this to the October 2021 milestone Sep 30, 2021
@mjbvz mjbvz self-assigned this Sep 30, 2021
@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 30, 2021

@DanielRosenwasser Interested to see if there's a better way to fix this

The basic problem is:

  1. On Desktop, VS Code will try to spawn a syntax and semantic TS server
  2. We are working in an in-memory workspace that TS cannot read. All files are opened as in-memory resources
  3. When calling geterr for these files, we go to the semantic server
  4. However the semantic server then ends up treating these files like there were part of a real workspace. It tries resolving import paths

We could fix this by calling geterr on the syntax server, but for cases where you have a mix of on-disk and in-memory files, we'd have to make two geterr calls

The problem with my fix is that TS is still computing the diagnostics but we are just discarding them. It would be better if we never computed these in the first place

@DanielRosenwasser
Copy link
Member

I think I need to better understand the use-cases - we expanded the partial semantic server to support diagnostics for situations where we know that a full semantic server can't be used.

@mjbvz mjbvz merged commit 9990843 into microsoft:main Oct 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants