Commit graph

1037 commits

Author SHA1 Message Date
George Fraser ac314f88c6 Just remove the macro fallback 2020-11-25 08:41:40 -08:00
George Fraser fe435ffb27 Use builtin scopes more 2020-11-07 10:50:57 -08:00
Dusty Pomerleau 6959cb045c allow variables to terminate ranges 2020-11-07 22:08:29 +11:00
Dusty Pomerleau ffc5f4cf2b precedence fixes:
- prevent `pat` from matching before `path` in metavariable types
- reduce the precedence of math operators so that assignment operators match correctly
2020-11-07 14:56:06 +11:00
bors[bot] ed9f8d53bc
Merge #6488
6488: Textmate grammar: add `+=` to assignment operators r=dustypomerleau a=dustypomerleau

Fixes https://github.com/dustypomerleau/rust-syntax/issues/3.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
2020-11-06 22:52:13 +00:00
Dusty Pomerleau 397b76f28b add += to assignment operators 2020-11-07 09:49:08 +11:00
Charles Pierce d2bf2ebe15 Restore semantic token flickering workaround removed in #5697 2020-11-04 10:26:58 -08:00
Dusty Pomerleau 4e66fc57bd fix: distinguish turbofish function calls from namespaces 2020-11-03 23:47:15 +11:00
Dusty Pomerleau 01a228f689 fix: allow functions without curly brackets 2020-11-03 18:37:43 +11:00
Dusty Pomerleau 79598f55b0 fix: allow comments in attributes 2020-11-02 15:33:11 +11:00
kjeremy 77ffe137f2 Smaller inlay hints
This makes things a lot more readable but isn't officially supported by vscode: https://github.com/Microsoft/vscode/issues/9078

Inspired by Visual Studio, IntelliJ and Resharper.
2020-10-28 09:52:23 -04:00
Laurențiu Nicola 91b4dd63b0 Also set textDecoration: none on inlay hints 2020-10-28 13:49:38 +02:00
Laurențiu Nicola 8a5a5b2477 Set font-wieght: normal on inlay hints 2020-10-27 09:18:25 +02:00
kjeremy 5444978f68 Update package 2020-10-26 09:23:34 -04:00
kjeremy 5cb6fafd36 Latest proposed LSP 3.16.0
Needs: https://github.com/gluon-lang/lsp-types/pull/183
2020-10-26 09:23:34 -04:00
Dusty Pomerleau efdcfcfb61 fix: narrow the case where angle brackets are seen as comparison operators 2020-10-26 20:16:26 +11:00
Dusty Pomerleau f352b98f7e fix: underscores, raw IDs
- remove comment scope from ignored params
- underscores will automatically receive variable/param scope
- add raw ID syntax to modules, functions, and variables
2020-10-24 13:00:26 +11:00
bors[bot] 2fa942ad30
Merge #6251 #6310
6251: Semantic Highlight: Add Callable modifier for variables r=matklad a=GrayJack

This PR added the `HighlightModifier::Callable` variant and assigned it to variables and parameters that are fn pointers, closures and implements FnOnce trait.

This allows to colorize these variables/parameters when used in call expression.



6310: Rewrite algo::diff to support insertion and deletion r=matklad a=Veykril

This in turn also makes `algo::diff` generate finer diffs(maybe even minimal diffs?) as insertions and deletions aren't always represented as as replacements of parent nodes now.

Required for #6287 to go on.

Co-authored-by: GrayJack <gr41.j4ck@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-23 22:12:15 +00:00
Dusty Pomerleau 26b4b1e2fb fix: prevent line comments inside block comments
- prevent line comments inside block comments
- prevent underscore-prefixed functions and macros from receiving comment scope
2020-10-22 13:33:06 +11:00
Dusty Pomerleau 93eeafc79f fix: require matching hash quantities for raw strings 2020-10-21 10:38:31 +11:00
bors[bot] 2c5bd9517e
Merge #6274
6274: Check cargoExtraArgs for undefined before using r=matklad a=feileacan

Fixes #6273 

Co-authored-by: feileacan <54381366+feileacan@users.noreply.github.com>
2020-10-19 15:35:32 +00:00
Dusty Pomerleau 06208e622f fix: prevent unwanted interpolation scopes 2020-10-18 13:27:03 +11:00
feileacan d019cdbbb2
Check cargoExtraArgs for undefined before using 2020-10-18 11:40:48 +11:00
GrayJack 2e66fae1db
Editor: Code: Add callable to package.json 2020-10-16 09:06:52 -03:00
Dusty Pomerleau c2335d0cb2 fix: prevent early termination of raw strings with hash 2020-10-16 11:08:59 +11: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