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

Codelens support for the LSP #105

Open
cameron-martin opened this issue Jan 4, 2024 · 4 comments · May be fixed by #107
Open

Codelens support for the LSP #105

cameron-martin opened this issue Jan 4, 2024 · 4 comments · May be fixed by #107
Labels

Comments

@cameron-martin
Copy link
Contributor

It would be nice to have support for codelens in the LSP, e.g. to build, test or run a particular target. This includes support for running the resulting command. The running of the commands would need to be implementation-specific, as would I imagine the gathering of the codelens items themselves.

@cameron-martin
Copy link
Contributor Author

After spending some time implementing this, I realised that running build/test commands cannot be done by the LSP since it needs to open in a terminal in the editor. Hence the IDE extension needs to handle this part. I think having the LSP supply the codelenses is useful still though.

@cameron-martin
Copy link
Contributor Author

On second thoughts, maybe this shouldn't be the responsibility of the language server, but instead the responsibility of the build server. Currently there is no way for the build server to tell the client the locations of build targets, but maybe there should be.

@ndmitchell
Copy link
Contributor

I'm really not sure. I don't think it's unreasonable for the LSP to have enough hooks that the starlark context object can do it, but build server would be "better".

@ndmitchell ndmitchell added the lsp label Jan 19, 2024
@cameron-martin cameron-martin linked a pull request Jan 22, 2024 that will close this issue
@cameron-martin
Copy link
Contributor Author

After playing around with the build server protocol implementation for bazel, it doesn't seem to be in its prime time yet. I agree that having this in the LSP doesn't seem unreasonable, and quite a few other language servers have this feature.

I've opened up a draft PR here if you're interested in contributions of this feature: #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants