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

[lsp] a quick-fix available to convert it to the latest version on deno-warn #11719

Closed
kitsonk opened this issue Aug 15, 2021 · 5 comments
Closed
Labels
lsp related to the language server suggestion suggestions for new features (yet to be agreed)

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Aug 15, 2021

@kitsonk There should be a quick-fix available to convert it to the latest version, automatically. Also, I think there should be a way to ignore warnings (i.e. on next line using a comment), for the people who prefer to load the most recent version. Yes it's risky, but it's not your choice to decide if it's right or wrong. The warning makes it clear enough.

Please rethink your choice on this issue. Thank you in advance.

Originally posted by @martin-braun in #10822 (comment)

@kitsonk kitsonk added lsp related to the language server suggestion suggestions for new features (yet to be agreed) labels Aug 15, 2021
@kitsonk
Copy link
Contributor Author

kitsonk commented Aug 15, 2021

The challenge with this is that header is agnostic to the repository, for deno.land/x/ it means one thing, for another repository it could mean whatever it means there... we would have to enhance/add a header to try to describe the quick fix to perform.

@martin-braun
Copy link

@kitsonk So a HTTP header on the response of the repository page that contains the URL to the latest version, so the quick-fix can convert the reference? Sounds good to me.

This would also allow the extension to spot any outdated packages and provide a suggestion quick-fix for updating to the latest minor or major version of the package.

@kitsonk
Copy link
Contributor Author

kitsonk commented Aug 16, 2021

So a HTTP header on the response of the repository page that contains the URL to the latest version, so the quick-fix can convert the reference?

The contents of the header is up to those serving the files. So we would have to publish some quick fixes, which a package repository would have to communicate how the apply the fix. It could be a warning about using an insecure package, or a deprecated package, or whatever the person hosting the file wants to provide... the deno cli and the Deno language server don't "care", they display the message.

@martin-braun
Copy link

martin-braun commented Aug 16, 2021

The contents of the header is up to those serving the files. So we would have to publish some quick fixes, which a package repository would have to communicate how the apply the fix. It could be a warning about using an insecure package, or a deprecated package, or whatever the person hosting the file wants to provide... the deno cli and the Deno language server don't "care", they display the message.

Excellent idea. This would give a lot of control to the host of the package, so indeed it could even be possible to provide warnings about insecure or potentially harmful bugged versions with detailed information. We would still need header fields for the latest minor and major version package URLs to let the quick fix work, essentially.

Your ideas are really straight forward, this will bring a lot of value to the extension, since package version management is a lacking feature of Deno in its current stage.

@kitsonk
Copy link
Contributor Author

kitsonk commented Sep 29, 2022

This was landed some time ago.

@kitsonk kitsonk closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp related to the language server suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

2 participants