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

internal: Clean up runnable lsp extension #17547

Merged
merged 3 commits into from
Jul 6, 2024
Merged

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jul 6, 2024

This feels like a natural addition to me, and also allows us to drop the expect-test hardcoding from the extension. Additionally, cargoExtraArgs is pointless, all the client will do is merge it with cargoArgs so the server can do that instead of delegating that to the client.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 6, 2024
@Veykril Veykril changed the title Add environment to runnable lsp extension internal: Clean up runnable lsp extension Jul 6, 2024
/**
* Environment variables to set before running the command.
*/
environment?: Record<string, string>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to alternative names, should we be explicit with environmentVariables?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also call it envVariables?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I'll stick with environment I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough! not terribly attached.

/**
* The working directory to run the command in.
*/
cwd: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this being mandatory gives a more unique experience across clients. We should not leave this decision to clients as that could result in runnables sometimes working sometimes not. (notable it is required by the shell version already)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, reducing the number of possible options is great. the combinatorial explosion of options made this really difficult to reason about.

@Veykril
Copy link
Member Author

Veykril commented Jul 6, 2024

r? @davidbarsky

Copy link
Contributor

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good and reasonable to me.

@Veykril
Copy link
Member Author

Veykril commented Jul 6, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 6, 2024

📌 Commit 8f69d98 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 6, 2024

⌛ Testing commit 8f69d98 with merge 360b1f5...

bors added a commit that referenced this pull request Jul 6, 2024
internal: Clean up runnable lsp extension

This feels like a natural addition to me, and also allows us to drop the expect-test hardcoding from the extension. Additionally, `cargoExtraArgs` is pointless, all the client will do is merge it with `cargoArgs` so the server can do that instead of delegating that to the client.
@Veykril
Copy link
Member Author

Veykril commented Jul 6, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 6, 2024

📌 Commit 8f69d98 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 6, 2024

⌛ Testing commit 8f69d98 with merge 35db3f5...

@ia0
Copy link

ia0 commented Jul 6, 2024

I'm a bit confused by #4604 (comment), in particular:

gets rid of cargoExtraArgs and bakes that into cargoArgs

Does this refer to rust-analyzer.cargo.extraArgs? I don't see any rust-analyzer.cargo.args in the manual. Or does this refer to something else?

@davidbarsky
Copy link
Contributor

I'm a bit confused by #4604 (comment), in particular:

gets rid of cargoExtraArgs and bakes that into cargoArgs

Does this refer to rust-analyzer.cargo.extraArgs?

It does not. It refers to the field in the runnable sent from the server to the client.

@Veykril
Copy link
Member Author

Veykril commented Jul 6, 2024

It refers to this

cargoExtraArgs: string[];
which is the rust-analyzer.cargo.extraArgs config yes. rust-analyzer.cargo.args isn't a thing, as the cargoArgs in the runnable is populated by the server depending on the task, its not something the user configures.

@bors
Copy link
Contributor

bors commented Jul 6, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 35db3f5 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Jul 6, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 35db3f5 to master...

@bors bors merged commit 35db3f5 into rust-lang:master Jul 6, 2024
21 checks passed
@bors
Copy link
Contributor

bors commented Jul 6, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@Veykril Veykril deleted the runnables-env branch July 6, 2024 15:21
@ia0
Copy link

ia0 commented Jul 6, 2024

Thanks a lot for the clarification!

nemethf added a commit to nemethf/eglot-x that referenced this pull request Jul 7, 2024
See rust-lang/rust-analyzer#17547

* eglot-x.el (eglot-x--run-after-jump): Handle new property
"environment".  Still accept old properties to keep supporting old
versions of rust-analyzer.
fannheyward added a commit to fannheyward/coc-rust-analyzer that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants