Commit Graph

979 Commits

Author SHA1 Message Date
Lukas Wirth
ec9476015c Substitute VSCode variables more generally 2023-01-24 13:46:56 +01:00
Lukas Wirth
64110714f0 🧹 lsp_ext.ts 2023-01-23 16:58:35 +01:00
Lukas Wirth
b9fe5afb30 Add a 'open server logs' button to the error notification 2023-01-23 13:24:42 +01:00
OmarTawfik
7198cd04ac allow using vscode variables in config.serverPath 2023-01-20 13:22:11 -08:00
Lukas Wirth
4267b11c40
Revert "Use ZWNJ to prevent VSCode from forming ligatures between hints and code" 2023-01-10 09:43:08 +01:00
Ian Chamberlain
65cf7abbe2
Use experimental capability to enable color codes 2023-01-09 11:50:35 -05:00
Ian Chamberlain
738ce83d85
Strip colors before matching preview diagnostics 2023-01-09 11:49:59 -05:00
Ian Chamberlain
1b8141b54c
Parse + decorate rendered ANSI cargo output
Use ANSI control characters to display text decorations matching the
VScode terminal theme, and strip them out when providing text content
for rustc diagnostics.

This adds the small `anser` library to parse the control codes, and it
also supports HTML output so it should be fairly easy to switch to a
rendered HTML/webview implementation if desired.
2023-01-09 11:46:29 -05:00
Lukas Wirth
c4d8cf1dad Use ZWNJ to prevent VSCode from forming ligatures between hints and code 2023-01-03 12:32:38 +01:00
Alex Veber
ddc0147d53 Fix diagnostic code 2023-01-03 08:33:27 +02:00
Lukas Wirth
cf8d89e46b Add a command to clear flycheck diagnostics 2022-12-17 23:43:26 +01:00
Lukas Wirth
d8ddde27f9 Make cancelFlycheck request a notification 2022-12-17 23:29:31 +01:00
Lukas Wirth
a04feb915a Add command for manually running flychecks 2022-12-16 22:47:19 +01:00
Maria José Solano
8661740626 Use typed notification method 2022-11-27 09:46:37 -08:00
Lukas Wirth
073a63b93e feat: Allow viewing the full compiler diagnostic in a readonly textview 2022-11-18 19:56:08 +01:00
Lukas Wirth
fccf8eb1fd Properly handle vscode workspace changes 2022-10-29 01:41:02 +02:00
Lukas Wirth
2071d00fd2 Always set up VSCode commands 2022-10-29 00:44:37 +02:00
Lukas Wirth
274df54885 feat: Clicking the status bar item stops and starts the server 2022-10-28 23:10:10 +02:00
bors
8ee23f4f0a Auto merge of #13453 - Veykril:disabled-commands, r=Veykril
internal: Properly handle commands in the VSCode client when the server is stopped
2022-10-21 14:05:25 +00:00
Lukas Wirth
1cb46079e4 internal: Properly handle commands in the VSCode client when the server is stopped 2022-10-21 16:00:43 +02:00
bors
69f01fdff5 Auto merge of #13451 - Veykril:lang-config, r=Veykril
internal: Properly handle language configuration config changes
2022-10-20 19:15:30 +00:00
Lukas Wirth
a8e0a20ce4 internal: Properly handle language configuration config changes 2022-10-20 21:14:36 +02:00
Yotam Ofek
e05df93b8e Workaround the python vscode extension's polyfill 2022-10-20 17:56:51 +00:00
Lukas Wirth
69b845674c Don't catch the server activation error 2022-10-20 11:32:02 +02:00
Lukas Wirth
d63c44e650 Cleanup output channels 2022-10-17 16:01:39 +02:00
Lukas Wirth
0421756b42 Implement stop and start server commands 2022-10-17 15:45:57 +02:00
Lukas Wirth
d68616a140 Make more things private 2022-10-17 15:05:20 +02:00
Lukas Wirth
8aaafddee8 Properly reload changed configs for server start 2022-10-17 14:53:46 +02:00
Lukas Wirth
6f435977df Refactor language client handling 2022-10-17 14:21:12 +02:00
Lukas Wirth
d5f467aa4a Substitute some VSCode variables in the VSCode client 2022-10-16 19:45:08 +02:00
bors
c09151c619 Auto merge of #13402 - HKalbasi:patch-1, r=Veykril
Cast runnableEnv items to string

fix #13390

An alternative approach could be raising an error if there is non string values.
2022-10-16 09:20:38 +00:00
Jonas Schievink
55fdcbe339
Revert "fix: in VSCode, correctly resolve relative paths to errors" 2022-10-14 09:28:44 +02:00
HKalbasi
58e5452a9b
fix formatting 2022-10-12 14:14:59 -07:00
HKalbasi
983ae1b1c9
Cast runnableEnv items to string 2022-10-12 20:40:49 +03:30
Aleksey Kladov
5bbfea03cc fix: in VSCode, correctly resolve relative paths to errors
VS Code problem matcher are restricted to be static "regexes". You can't
create a problem matcher dynamically, and you can't use custom code in
lieu of problem matcher.

This creates a problem for rust/cargo compiler errors. They use paths
relative to the root of the Cargo workspace, but VS Code doesn't
necessary know where that root is.

Luckily, there's a way out: our current problem matcher is defined like
this:

    "fileLocation": [ "autoDetect", "${workspaceRoot}" ],

That means that relative pahts would be resoleved relative to workspace
root. VS Code allows to specify a command inside `${}`. So we can plug
custom logic there to fetch Cargo's workspace root!

And that's exactly what this PR is doing!
2022-10-08 23:25:13 +01:00
Lukas Wirth
9c97997af9 Remove the toggleInlayHints command from VSCode
Inlay hints are no longer something specifc to r-a as it has been
upstreamed into the LSP, we don't have a reason to give the config
for this feature special treatment in regards to toggling. There are
plenty of other options out there in the VSCode marketplace to create
toggle commands/hotkeys for configurations in general which I believe
we should nudge people towards instead.
2022-09-10 11:50:55 +02:00
bors
e8e598f641 Auto merge of #13133 - Veykril:diag-hack, r=Veykril
Move empty diagnostics workaround back into the server

This only touches on the diagnostics in one place instead of multiple as was previously done, since all published diagnostics will go through this code path anyways.

Closes https://github.com/rust-lang/rust-analyzer/issues/13130
2022-08-28 09:56:06 +00:00
Lukas Wirth
9ad0a8c467 Move empty diagnostics workaround back into the server 2022-08-28 11:54:46 +02:00
bors
6bea872edd Auto merge of #13095 - jonas-schievink:avoid-liveshare-error, r=jonas-schievink
fix: Avoid error popup when using in Live Share

cc https://github.com/rust-lang/rust-analyzer/issues/8844

Not sure if there's a better way to do this, feedback appreciated!
2022-08-26 18:39:53 +00:00
bors
55bf51df41 Auto merge of #13087 - Veykril:config-update, r=Veykril
Remove auto-config patching from the VSCode client

This was introduced 4 months ago when we drastically changed the config keys. I'd like to remove this given I always felt uneasy doing edits to a users config from within r-a, and by now most if not all users should've swapped to a new enough version of r-a that should've updated their configs.

The extension will continue to work fine even with the outdated keys afterwards since we still do patching server side as well, and that one we'll have to support for quite some more time (if not until a proper 1.0 release where I assume we can allow ourselves some more user facing breakage)

(There also might've been a small bug in here that prevented users with certain outdated keys to prevent them from enabling certain keys for some reason)
2022-08-26 16:22:57 +00:00
Laurențiu Nicola
10617938b1 Remove unused UpdatesChannel type 2022-08-25 21:33:42 +03:00
Jonas Schievink
dcbbb7f211 ForGoT tO RuN prEttIeR¿ 2022-08-23 15:56:02 +02:00
Jonas Schievink
16a0eb1829 Avoid error popup when using in Live Share 2022-08-23 15:45:02 +02:00
Lukas Wirth
b19f78b022 Remove auto-config patching from the VSCode client 2022-08-22 17:13:49 +02:00
Lukas Wirth
45b7b6a60a Implement lsp extension for cancelling running flychecks 2022-08-19 08:54:53 +02:00
bors
917bd68b37 Auto merge of #13039 - davidbarsky:davidbarsky/remove-used-nightly-checking-code, r=Veykril
chore: remove unused `currentExtensionIsNightly()` in `config.ts`

I was debugging an unrelated issue in rust-analyzer, but came across this unused code and figured that it's fine to send a fully red PR :)
2022-08-18 16:06:18 +00:00
Dezhi Wu
23747419ca fix: a bunch of typos
This PR will fix some typos detected by [typos].

There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.

[typos]: https://github.com/crate-ci/typos
2022-08-17 21:44:58 +08:00
David Barsky
a0b257c9d9 chore: remove unused currentExtensionIsNightly() in config.ts 2022-08-16 13:38:50 -04:00
Jonas Schievink
dcbe892d7c Add an HIR pretty-printer 2022-08-15 13:51:45 +02:00
Lukas Wirth
614969baa7 Pad empty diagnostic messages in relatedInformation as well 2022-08-13 20:49:00 +02:00