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
feat(lsp): npm specifier completions #20121
Conversation
What kind of test would we allow for this? |
Nice work. I think there are some existing completion tests in the LSP code that could be copied for this? |
This one depends on the npm registry site... I think I'll swap out the endpoint URLs in a |
That's a great idea. |
Okay we already have a |
I wanted to reuse the loading stuff in |
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.
Thanks! This will be a big improvement.
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.
Almost there. Given the changes made that expose the high level construction code to the unit tests, I think we should make a seam for the api provided to get_npm_completions
so we don't need to expose create_npm_api_and_cache
.
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.
Sorry for my delay on this one! I thought it was good and we were just waiting for the merge window to open, but then I just looked at it a bit more and I think it will only use the cached package information. Additionally, we could decouple get_npm_completions
from deno_npm
's NpmRegistryApi
trait.
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.
Looks great. Nice work and thanks @nayeemrmn!
Closes #15811.
Snipping tool screen recorder isn't working so here's some screenshots: