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

Announcements: Client Changes #4604

Open
matklad opened this issue May 25, 2020 · 66 comments
Open

Announcements: Client Changes #4604

matklad opened this issue May 25, 2020 · 66 comments
Labels
C-tracking-issue Category: tracking issue S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@matklad
Copy link
Member

matklad commented May 25, 2020

This issue exists to announce changes which might affect rust-analyzer plugins for different editors.
If you maintain such a plugin, consider subscribing to this issue.

All our protocol extensions are documented at lsp-extensions.md. I'll try to remember to leave a comment on this issue if I modify that file.

@matklad
Copy link
Member Author

matklad commented May 27, 2020

After #4632, all our current extensions are documented. There were a bunch of minor changes here and there. Most notably some requests were moved from rust-analyzer/foo to experimental/foo, in hope that this might be useful for other servers, and to mark the extensions we intend to upstream to the protocol itself.

Notably, inlay hints and runnables are are still unchanged: i want to upstream these two as well, but I am not too happy with their current state, and I don't have time to polish them right now. So i opted for documenting them as is, and cleaning up later.

@matklad matklad pinned this issue Jun 1, 2020
@matklad
Copy link
Member Author

matklad commented Jun 1, 2020

#4688 documents our initilizationOptions.

@matklad
Copy link
Member Author

matklad commented Jun 3, 2020

#4710 changes API for runnables. The idea is that it's the client who is reponsible for running stuff, to make it possible to, eg, inject debugger support or other custom tools. So, rust-analzyer provides a more abstract representation of a cargo command, to make it easier for the client to make sense of it.

@matklad
Copy link
Member Author

matklad commented Jun 5, 2020

#4717 adds API for lazily computing code action edits.

@matklad matklad changed the title Client Changes Anouncements: Client Changes Jun 15, 2020
@matklad
Copy link
Member Author

matklad commented Jul 2, 2020

#5188 adds status notification.

@matklad
Copy link
Member Author

matklad commented Jul 7, 2020

adds "memory usage" command: #5244

@matklad
Copy link
Member Author

matklad commented Jul 7, 2020

#4972 will switch to gzipping release artifacts.

@matklad
Copy link
Member Author

matklad commented Jul 8, 2020

rust-analyzer is available via rustup.

15:04:42|~/projects/rust-analyzer/editors/code|master✓
λ rustup component add --toolchain nightly rust-analyzer-preview
info: component 'rust-analyzer-preview' for target 'x86_64-unknown-linux-gnu' is up to date

15:04:46|~/projects/rust-analyzer/editors/code|master✓
λ rustup run nightly rust-analyzer --version
rust-analyzer f5a4a4b

The "officially recommended" binary at the moment is still the one from releases in this repo, but rustup one should be fine as well.

@matklad
Copy link
Member Author

matklad commented Aug 17, 2020

#5782

@matklad
Copy link
Member Author

matklad commented Sep 2, 2020

#5930 adapts the latest changes of the semantic tokens

@matklad
Copy link
Member Author

matklad commented Oct 17, 2020

@p3achyjr
Copy link

I am adding a rust-analyzer action for #6462, and will be changing the hash.

@matklad
Copy link
Member Author

matklad commented Nov 10, 2020

#6521 removes our custom support for code action resolving in favor of one provided by LSP 1.16.

@matklad
Copy link
Member Author

matklad commented Dec 8, 2020

#6761 adds a rust-analyzer --print-config-schema command which prints JSON-schema for the configuration for rust-analyzer, in the style of package.json. This should allow non-VS Code clients to show better auto-complete & docs for user config, and should also help to ensure that the defaults are the same between vscode and other editors.

@lnicola
Copy link
Member

lnicola commented Dec 24, 2020

In #6996 we want to stop releasing uncompressed binaries. Clients that can automatically install the LSP server binary should download the .gz file instead.

We've also changed the naming convention to include the platform tuple:

  • instead of rust-analyzer-windows.exe, use rust-analyzer-x86_64-pc-windows-msvc.gz
  • instead of rust-analyzer-linux, use rust-analyzer-x86_64-unknown-linux-gnu.gz
  • instead of rust-analyzer-mac, use rust-analyzer-x86_64-apple-darwin.gz

This allows us to support new platforms more easily, speeds up downloads and avoids wasting disk space.

@lnicola
Copy link
Member

lnicola commented Jan 5, 2021

#7068 adds a command to show our HIR representation of a function.

@lnicola lnicola added the S-unactionable Issue requires feedback, design decisions or is blocked on other work label Jan 17, 2021
@edwin0cheng
Copy link
Member

edwin0cheng commented Jan 28, 2021

#7412 adds a new readyPartial in status notification :

export type Status = "loading" | "ready" | "readyPartial" | "invalid" | "needsReload";

@lnicola
Copy link
Member

lnicola commented Feb 10, 2021

#7625 adds a "copy runnable command line" command.

@matklad
Copy link
Member Author

matklad commented Feb 17, 2021

It is now possible to use ut8 coordinate space for positions and ranges: #7657

@matklad
Copy link
Member Author

matklad commented Mar 22, 2021

#8054 adds a new request to move functions, statements, etc up and down.

@jplatte

This comment has been minimized.

@matklad matklad changed the title Anouncements: Client Changes Announcements: Client Changes Mar 29, 2021
@matklad
Copy link
Member Author

matklad commented Apr 6, 2021

#8355 replaces rust-analyzer specific rust-analyzer/status with a more general experimental/serverStatus. close upstream issue: microsoft/language-server-protocol#511

@bstaletic
Copy link
Contributor

For the record, here the new status is documented as requiring serverStatus capability, when in rust-analyzer only reacted to serverStatusNotification.

Is that a typo in the docs or a bug in #8355?

@matklad
Copy link
Member Author

matklad commented Feb 14, 2023

#14141 adds support for positionEncoding = "utf-32", in addition to utf-8 and utf-16 which we support since forever.

@bruno-ortiz
Copy link
Contributor

#11557 adds a viewTree which allows to navigate through project dependencies

@Ddystopia
Copy link
Contributor

Ddystopia commented Apr 26, 2023

#14662 adds support for locally built documentation

@adenine-dev
Copy link
Contributor

#15081 adds support for a memory layout viewer.

@DropDemBits
Copy link
Contributor

#15876 allows a single TextDocumentEdit to have multiple SnippetTextEdits.

@adstep
Copy link

adstep commented Nov 28, 2023

#15979 adds commands for running selected tests

@nemethf
Copy link
Contributor

nemethf commented Feb 9, 2024

There's a recent change introducing the "Unindexed Project" notification. I think @davidbarsky forgot to mention it here. However, it is not clear to me what are the linkedProjects and how should the client determine the owner. Can you, David, explain this feature in more details? Thank you.

@HKalbasi
Copy link
Member

HKalbasi commented Mar 5, 2024

#16662 adds a set of lsp extension for supporting the vscode test explorer. If your client has a similar feature for exploring tests, you may find it useful. There are probably some problems around the lsp extension, or it may be too overfitted to the vscode, please raise an issue in those cases.

@Veykril
Copy link
Member

Veykril commented Mar 6, 2024

#16773 puts the test explorer behind a testExplorer capability, note that the lsp extension is likely to still change

@nemethf
Copy link
Contributor

nemethf commented Mar 27, 2024

#16840 by @Wilfred is a pending PR that allows rust-project.json to include arbitrary shell commands for runnables

@nemethf
Copy link
Contributor

nemethf commented Apr 27, 2024

Although lsp-extensions.md hasn't been updated, commit 18ca22a extended ServerStatusParams with a new field called workspaceInfo.

@Veykril
Copy link
Member

Veykril commented May 23, 2024

Although lsp-extensions.md hasn't been updated, commit 18ca22a extended ServerStatusParams with a new field called workspaceInfo.

#17287 removes this again as it feels out of place for the status notification. (I didn't post about it here when adding it because I was mainly experimenting, should've made that clear from the start)

@nemethf
Copy link
Contributor

nemethf commented May 25, 2024

Commit ef59b49 by @roife extended the args of Runnable with an optional cwd field for the cargo kind. It seems cwd sould be used instead of workspaceRoot when it is present.

On the other hand, the log of commit a55e8bf has this sentence: "When the kind of runnable is bin", but according to the docs, kind can only be cargo.

@roife
Copy link
Member

roife commented May 25, 2024

On the other hand, the log of commit a55e8bf has this sentence: "When the kind of runnable is bin", but according to the docs, kind can only be cargo.

There was some ambiguity regarding the term kind due to my previous lack of clarity. In this context, kind refers to ide::Runnable.kind, which is of type RunnableKind (can be Test, Bin, Bench, etc.), is used internally within r-a.

The kind you mentioned refers to rust_analyzer::lsp_ext::Runnable.kind, which is of type rust_analyzer::lsp_ext::RunnableKind (and can only be cargo), is used for responses sent to the client.

@davidbarsky
Copy link
Contributor

#16840 added runnable support to rust-project.json. I'll create a PR to update the manual, but the newly added rustdocs on project_json.rs will are a reasonable starting point for the new behavior.

@Veykril
Copy link
Member

Veykril commented Jul 6, 2024

#17547 changes the runnable payload, notably it now has an environment field for env vars to be set, always sents a cwd working directory that a client should honor, gets rid of cargoExtraArgs and bakes that into cargoArgs (as there is no need for the client to do this) and drops the expectTest field in favor of the env var field.

@joshka
Copy link
Contributor

joshka commented Jul 14, 2024

#17587 adds a rust-analyzer.rename command that triggers the editor.action.rename. This allows extract symbols assists to cause the editor to prompt the user to rename the newly extracted symbol in place.

@matklad matklad mentioned this issue Jul 15, 2024
5 tasks
@Veykril
Copy link
Member

Veykril commented Jul 22, 2024

Heads up, #17647 changes two command names. This is unfortunately a breaking change but the previous names were accidentally plainly copied from VSCode whereas they should've been more rust-analyzer specific

@joshka
Copy link
Contributor

joshka commented Jul 22, 2024

Heads up, #17647 changes two command names. This is unfortunately a breaking change but the previous names were accidentally plainly copied from VSCode whereas they should've been more rust-analyzer specific

To save the extra click (and make this thread searchable for changes in the future):

The commands editor.action.triggerParameterHints and
editor.action.rename are now renamed to
rust-analyzer.triggerParameterHints and rust-analyzer.rename

@lnicola
Copy link
Member

lnicola commented Oct 29, 2024

#18412 disabled the generation of .gz binary artifacts for Windows. If your client downloads rust-analyzer from GitHub, you should switch to the .zip ones.

We might make a similar change to the Linux ones in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: tracking issue S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests