Skip to content

LanguageService: add getSupportedCodeFixes to make it proxyable - #29010

Closed
Klaus Meinhardt (ajafff) wants to merge 3 commits into
microsoft:masterfrom
ajafff:proxy-getsupportedcodefixes
Closed

Klaus Meinhardt (ajafff) wants to merge 3 commits into
microsoft:masterfrom
ajafff:proxy-getsupportedcodefixes

Conversation

@ajafff

Copy link
Copy Markdown
Contributor

Fixes: #28966

I'd highly appreciate some pointers on how to test this change. (Sheetal Nandi (@sheetalkamat)?)

Is the change to the protocol what Daniel Rosenwasser (@DanielRosenwasser) meant in #28966 (comment)?

Comment thread src/server/session.ts Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#28106 has example of how to add test that configures plugin and adds proxy

Comment thread src/server/session.ts Resolved
@ajafff

Klaus Meinhardt (ajafff) commented Dec 14, 2018 •

Copy link
Copy Markdown
Contributor Author

Sheetal Nandi (@sheetalkamat) I changed getSupportedCodeFixes to take the fileName as parameter, although that means the client would need to call getSupportedCodeFixes once for each file instead of once per project.
I'm wondering if this API still makes sense as a means for reducing communication to the service. In addition it would need to be refreshed once a plugin's configuration changed in any way. Wouldn't it be easier to just call getCodeFixes?

Deprecating this API would also resolve #28990, microsoft/vscode#64848 and microsoft/vscode#64872


Regarding tests: as far as I understand, fourslash only tests Project and LanguageService but not Session where the actual change of this PR is. If Session doesn't have tests, do we even need a test for the new method in LanguageService (given that every method in LanguageService can be intercepted by a plugin)?

@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Dec 14, 2018 •

Copy link
Copy Markdown
Member

Klaus Meinhardt (@ajafff) for test you can look at #28385 to see how to test this through session.
I am not very familiar with getSupportedCodeFixes api and reasoning behind it. Matt Bierner (@mjbvz) might know more about it.

Edit:
Forgot to mention that from what I saw it seems like instead of calling getCodeFixes for each error, I think vscode calls getCodeFixes only on these list from supported error codes. So could this be done to avoid too many interaction on eg parser errors etc?

@sheetalkamat

Copy link
Copy Markdown
Member

Closing this since #29051 makes more sense than this change

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

LanguageService Plugin cannot intercept 'getSupportedCodeFixes'

4 participants