microsoft / microsoft/vscode-languageserver-node
Support refreshing single files in diagnostic pull
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 404
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 14
Description
In this code here, workspace diagnostics is repolling every 2 seconds:
https://github.com/microsoft/vscode-languageserver-node/blob/d90a87f9557a0df9142cfb33e251cfa6fe27d970/client/src/common/diagnostic.ts#L440
This makes Pylance continuously do analysis. At least for items that don't seem to save the fact that there are no errors. (Previous result ids don't exist for files that aren't open, but workspace mode asks for all files).
I'm not sure if the polling is as design (might be) but missing the previous result id seems like a bug?
For example, in the issue where we found this:
https://github.com/microsoft/pylance-release/issues/7499
The user has a single file open.
Our result contains all files though. The next poll request only has a previous result id for the file that's open. If all previous results were passed, we would mark the next request as unchanged, but we can't because of the missing result ids for the unopened files.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at client/src/common/diagnostic.ts around line 440 and trace the workspace diagnostic pull request and result-ID handling. Use the linked Pylance issue as context for the single-open-file case; done should include a defined way to refresh single files without repeatedly reanalyzing unchanged unopened files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100