-
Notifications
You must be signed in to change notification settings - Fork 80
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
Improve LSP support #3453
Comments
Corresponds with deephaven/web-client-ui#1178 This addresses the first 3 items in #3453 except deprecation tags. Adds signatureHelp and hover requests to the Python autocomplete server Requires you build and force reinstall the Python server locally unless you are using pip -e flag for your local Python server. Put the plumbing in place for autocomplete cancellation and diagnostic requests
Much of this was completed with #3607 |
We should also autocomplete the column name in |
https://github.com/astral-sh/ruff-lsp We should get the rest of the LSP features like formatting via this ^ |
Using ruff may depend on astral-sh/ruff#659, at least with regards to how we are using jedi today. |
Another option - looks like https://play.ruff.rs is WASM and accomplished completely client side; awesome! If we could move this logic completely to the client, that would be a big win IMO. |
I was looking at the source of this, since ruff can be WASM compiled... It actually looks like it would be relatively easy to get a python linter + a python formatter integrated client side. They integrated the formatter not how you actually would do it because they wanted it side by side. We should do it on the registerDocumentFormattingRequest or whatever monaco event. https://github.com/astral-sh/ruff/blob/main/playground/src/Editor/SourceEditor.tsx No official ruff wasm npm package yet, but there is a issue in the ruff repo to start publishing one. There is a community maintained package https://www.npmjs.com/package/@wasm-fmt/ruff_fmt and we could always build our own if necessary too. Maybe some complexity with the vite deploy of that, but that package has a vite example. Anyways, this looks cheaper to implement then I expected, so in terms of effort vs payoff, I think it's actually pretty high. Something to consider is how we handle the lint/formatting config. Is it a file in community? Is it a settings menu thing? What about in enterprise, is it server prop provided config? Can users override it? |
As a user, I want better LSP support so that the web IDE provides more niceties that I use in my desktop IDE.
We currently have support for
Completion Request
, but we could add support for several other items with Jedi. This list will be in the order that I find most useful/impactful, but all of them enhance the user experience.CompletionItemKind
- use LSP enum and then we will convert to monaco enum on client b/c monaco uses a different order for some reasondocumentation
in the response provides an arrow the user can click to see more docs. Or we can use this hack to show the documentation always. VSCode shows this documentation by default.detail
- this is often used to show the package or some potential item in the autocomplete item on the right side. VSCode for web stuff shows the package name if it is something that will be auto imported on autocomplete. Pycharm has some info about the package the item belongs to regardless of if it is imported alreadydeprecated
- Not sure if we're marking anything as deprecated in the Python code, but would be a nice-to-have in the future if we start deprecating APIs. Shows the autocomplete item with strikethrough to indicate deprecationI'm sure there are others that would improve the user experience. The first 2 are major improvements IMO while the others are nice-to-haves.
The text was updated successfully, but these errors were encountered: