Commit graph

976 commits

Author SHA1 Message Date
GrayJack
2e66fae1db
Editor: Code: Add callable to package.json 2020-10-16 09:06:52 -03:00
Laurențiu Nicola
010d123f23 Insert a ZWNJ before type hints 2020-10-15 10:56:28 +03:00
Laurențiu Nicola
513d25cf03 Fix resolveCodeAction request 2020-10-13 12:47:01 +03:00
bors[bot]
3f96c9b3cc
Merge #6137
6137: add a new TextMate grammar r=matklad a=dustypomerleau

Thanks to everyone working hard on Rust Analyzer - my impression is that it's quickly becoming the community default.

I think it would be helpful to have a more robust TextMate grammar to fall back on, for those who wish to disable semantic highlighting for any reason. It should allow theming of punctuation, and provide scopes for all tokens on the page. This can be done at zero cost to those who enable semantic highlighting, as the TextMate scopes will be invisible to those users.

I can see a couple ways of accomplishing this:

1. Ship a new grammar by merging this PR.
1. Ship no TextMate grammar at all (like the [Rust](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust) extension), and allow users to install a separate extension that provides the grammar of their choice (I have released this one as [Rust Syntax](https://marketplace.visualstudio.com/items?itemName=dustypomerleau.rust-syntax)). If no grammar were installed, they would simply fall back to the default grammar provided by their editor. In the case of VS Code, the default grammar already matches what is currently being shipped, so users who choose not to override it would see no difference.

I have tried to choose sensible default scopes, in the hopes that a wider variety of themes would work out of the box with Rust, even if those themes do not yet supply scopes for semantic highlighting. There is definitely some interest in using this grammar with Rust Analyzer, as this was the very first issue after the syntax extension was shipped: https://github.com/dustypomerleau/rust-syntax/issues/1.

I considered simply using an alternative grammar alongside Rust Analyzer, but this doesn't seem possible. When RA starts, any existing grammar/extension is overridden, and I haven't been able to find a workaround.


Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
2020-10-12 15:45:21 +00:00
Dusty Pomerleau
49d824a99d add new TextMate grammar 2020-10-11 17:55:50 +11:00
Zac Pullar-Strecker
c648884397 Differentiate method/tymethod by determining 'defaultness'
Currently a method only has defaultness if it is a provided trait
method, but this will change when specialisation is available and may
need to become a concept known to hir.

I opted to go for a 'fewest changes' approach given specialisation is
still under development.
2020-10-08 15:04:21 +13:00
Zac Pullar-Strecker
974518fde7 Code reorganisation and field support 2020-10-08 15:04:20 +13:00
Zac Pullar-Strecker
a14194b428 Changes from review 2020-10-08 15:01:30 +13:00
Zac Pullar-Strecker
bfda0d2583 WIP: Command to open docs under cursor 2020-10-08 14:59:31 +13:00
Casey Primozic
56a8a7645f
Bump chalk to use latest git to get fix
* Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See #6134, #6145, Probably #6120
2020-10-06 15:05:20 -07:00
Lukas Wirth
8699331014 Make ImportPrefix a configuration option 2020-10-05 17:41:49 +02:00
Igor Aleksanov
5b26629a4d Support 'runnables' options in the vs code extension 2020-10-02 12:35:22 +03:00
Aleksey Kladov
af8063fe37 Extend **Status** command to also show dep info for the file
This should help with troubleshooting wrong project configuration
2020-09-29 22:13:23 +02:00
vsrs
b7fda5f936 Make method references CodeLens off by default. 2020-09-29 15:29:20 +03:00
vsrs
eeb40dbece Add method references CodeLens 2020-09-29 15:29:20 +03:00
Matthias Einwag
8eae893c76 Fix lint 2020-09-23 08:39:04 -07:00
Matthias Einwag
c7f4647749 Move unlink on download into download function
Since this is required by all callsites its easier to have it in the
function itself.
2020-09-23 08:37:02 -07:00
Matthias Einwag
df4d59512e Remane function 2020-09-23 08:27:25 -07:00
Matthias Einwag
d38f759c63 Use closure in trailing position and strongly type header map 2020-09-23 08:24:35 -07:00
Matthias Einwag
87933e15ce
Apply suggestions from code review
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-09-23 08:14:18 -07:00
Matthias Einwag
45de3e738c Remove stray newline 2020-09-23 01:06:10 -07:00
Matthias Einwag
145bd6f701 Fix clearing the token
The previous version would have interpreted an empty token as
an abort of the dialog and would have not properly cleared the token.
This is now fixed by checking for `undefined` for a an abort and
by setting the token to `undefined` in order to clear it.
2020-09-23 01:03:34 -07:00
Matthias Einwag
501b516db4 Add a command for updating the Github API token 2020-09-23 00:50:34 -07:00
Matthias Einwag
a0a7cd306e Use retry dialog also for downloads
Since the change already implements a retry dialog for
network operations, let's also use it for allowing to retry the
actual file.
2020-09-23 00:28:38 -07:00
Matthias Einwag
1503d9de41 Fix tslint 2020-09-22 23:41:51 -07:00
Matthias Einwag
b93ced6f63 Allow to use a Github Auth token for fetching releases
This change allows to use a authorization token provided by Github in
order to fetch metadata for a RA release. Using an authorization token
prevents to get rate-limited in environments where lots of RA users use
a shared client IP (e.g. behind a company NAT).

The auth token is stored in `ExtensionContext.globalState`.
As far as I could observe through testing with a local WSL2 environment
that state is synced between an extension installed locally and a remote
version.

The change provides no explicit command to query for an auth token.
However in case a download fails it will provide a retry option as well
as an option to enter the auth token. This should be more discoverable
for most users.

Closes #3688
2020-09-22 23:12:51 -07:00
Laurențiu Nicola
c217bc561f Fix LSP requests with no arguments 2020-09-17 13:31:42 +03:00
Veetaha
af8663f2e6 Document "consuming" semantic tokens modifier 2020-09-16 00:53:37 +03:00
Laurențiu Nicola
59cb6a9b31 Fix delimiter in SSR example 2020-09-15 14:32:56 +03:00
bors[bot]
a61178d218
Merge #5985
5985: Make MergeBehaviour configurable r=jonas-schievink a=Veykril

This should make the newly implemented `MergeBehaviour` for import insertion configurable as roughly outlined in https://github.com/rust-analyzer/rust-analyzer/pull/5935#issuecomment-685834257. For the config name and the like I just picked what came to mind so that might be up for bikeshedding.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-09-14 10:12:08 +00:00
dependabot[bot]
6ab54a9d95
Bump node-fetch from 2.6.0 to 2.6.1 in /editors/code
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-12 14:50:54 +00:00
Lukas Wirth
adc4c6b9d7 Make MergeBehaviour configurable 2020-09-12 12:11:16 +02:00
kjeremy
b527257330 Move to vscode-languageclient 7.0.0-next.9
Stabilizes call hierarchy and semantic tokens features.
2020-09-02 09:40:59 -04:00
kjeremy
ffea9bc71e Update the rest of our node packages 2020-09-01 14:22:44 -04:00
kjeremy
bc94db6a2d Bump minimum vscode to 1.47 2020-09-01 14:13:55 -04:00
kjeremy
17d9bed663 Upgrade mocha from npm audit fix 2020-09-01 10:17:24 -04:00
bors[bot]
dd685d0d51
Merge #5910 #5912
5910: Fix some typos r=matklad a=SomeoneToIgnore



5912: Remove fixme from inlay_hints.ts r=matklad a=Veetaha

I have reevaluated the fixme and it doesn't seem necessary to pass an array of files
to the inlay hints request.
This will (a) make the request more compilcated (b), make us wait for
inlay hints for `all` active editors resolve at once before rendering and (c)
doesn't seem required because 99% of the time there is a single active editor
in the IDE

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-08-29 14:52:42 +00:00
Veetaha
de2324d9e6 Remove fixme from inlay_hints.ts
I have reevaluated the fixme and it doesn't seem necessary to pass an array of files
to the inlay hints request.
This will (a) make the request more compilcated (b), make us wait for
inlay hints for `all` active editors resolve at once before rendering and (c)
doesn't seem required because 99% of the time there is a single active editor
in the IDE
2020-08-29 02:05:42 +03:00
Kirill Bulatov
3ac9732ca3 Fix some typos 2020-08-28 21:55:24 +03:00
Laurențiu Nicola
e9f5585724 Add rust-analyzer.checkOnSave.target to package.json 2020-08-28 19:30:07 +03:00
Veetaha
5b9a882edc Make inlay hints colors more configurable 2020-08-26 02:53:42 +03:00
bors[bot]
d7f4711321
Merge #5841
5841: Gate stream.pipeline workaround on fixed versions of node r=matklad a=Veetaha

Fixes the symptom of https://github.com/cdr/code-server/issues/1810
Original report here: https://github.com/rust-analyzer/rust-analyzer/issues/3167#issuecomment-678390564
Thanks to @hjfreyer for precise investigation :D

Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-08-24 14:33:35 +00:00
Veetaha
74ed42c8e9 Gate stream.pipeline workaround on fixed versions of node 2020-08-21 22:15:04 +03:00
Veetaha
54d4bc2622
Dont ask me why... 2020-08-21 21:14:40 +03:00
Aleksey Kladov
0866b1be89 Align diagnostics config with the rest of rust-analyzer 2020-08-18 16:03:15 +02:00
bors[bot]
b8dfc331ab
Merge #5682
5682: Add an option to disable diagnostics r=matklad a=popzxc

As far as I know, currently it's not possible to disable a selected type of diagnostics provided by `rust-analyzer`.

This causes an inconvenient situation with a false-positive warnings: you either have to disable all the diagnostics, or you have to ignore these warnings.

There are some open issues related to this problem, e.g.: https://github.com/rust-analyzer/rust-analyzer/issues/5412, https://github.com/rust-analyzer/rust-analyzer/issues/5502

This PR attempts to make it possible to selectively disable some diagnostics on per-project basis.

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
2020-08-18 12:04:49 +00:00
bors[bot]
7d95a8447c
Merge #5776 #5780
5776: Fix eslint errors on .eslintrc.js and rollup.config.js r=matklad a=fuafa

Eslint complains if these two files does not include in the `tsconfig.json`.
```
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.js.
The file must be included in at least one of the projects provided.eslint
```
![image](https://user-images.githubusercontent.com/20750310/90338269-176d4f80-e01b-11ea-8710-3ea817b235d2.png)



5780: Fixup whitespace when adding missing impl items r=matklad a=jDomantas

Generate properly formatted whitespace when adding impl items - with an empty line between items and removing extra whitespace that often appears at the end.

This is my first time working on rust analyzer so I'm not very familiar with its internal APIs. If there's a better way to do such syntax tree editing I'd be glad to hear it.

Co-authored-by: xiaofa <xiaofalzx@gmail.com>
Co-authored-by: jDomantas <djadenkus@gmail.com>
2020-08-17 14:30:24 +00:00
bors[bot]
6826dd044a
Merge #5782
5782: Fix StatusNotification r=matklad a=vsrs

This PR fixes the following:

As per specification `params` property in [NotificationMessage ](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#notificationMessage) should be `array | object` while RA uses `"loading" | "ready" | "invalid" | "needsReload"`.

Co-authored-by: vsrs <vit@conrlab.com>
2020-08-17 14:23:03 +00:00
vsrs
1eed036a6e Fix StatusNotification 2020-08-17 14:56:27 +03:00
xiaofa
951fc3f65a Fix eslint errors on .eslintrc.js and rollup.config.js 2020-08-16 23:28:26 +08:00