aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
Commit message (Collapse)AuthorAgeFilesLines
* Allow to use a Github Auth token for fetching releasesMatthias Einwag2020-09-233-4/+72
| | | | | | | | | | | | | | | | | | | 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
* Fix LSP requests with no argumentsLaurențiu Nicola2020-09-172-6/+6
|
* Fix delimiter in SSR exampleLaurențiu Nicola2020-09-151-1/+1
|
* Move to vscode-languageclient 7.0.0-next.9kjeremy2020-09-024-18/+9
| | | | Stabilizes call hierarchy and semantic tokens features.
*-. Merge #5910 #5912bors[bot]2020-08-292-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Co-authored-by: Veetaha <[email protected]>
| | * Remove fixme from inlay_hints.tsVeetaha2020-08-291-1/+0
| |/ |/| | | | | | | | | | | | | | | 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
| * Fix some typosKirill Bulatov2020-08-281-1/+1
|/
* Make inlay hints colors more configurableVeetaha2020-08-261-47/+28
|
* Merge #5841bors[bot]2020-08-241-0/+8
|\ | | | | | | | | | | | | | | | | | | 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 <[email protected]>
| * Gate stream.pipeline workaround on fixed versions of nodeVeetaha2020-08-211-0/+8
| |
* | Dont ask me why...Veetaha2020-08-211-1/+0
|/
* Merge #5782bors[bot]2020-08-172-2/+5
|\ | | | | | | | | | | | | | | | | | | 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 <[email protected]>
| * Fix StatusNotificationvsrs2020-08-172-2/+5
| |
* | Rename ra_toolchain -> toolchainAleksey Kladov2020-08-121-2/+2
|/
* Merge #5697bors[bot]2020-08-101-8/+2
|\ | | | | | | | | | | | | | | | | | | 5697: Remove workaround for semantic token flickering r=jonas-schievink a=kjeremy See: https://github.com/microsoft/vscode-languageserver-node/issues/576#issuecomment-593384479 This has been fixed since vscode 1.44 Co-authored-by: Jeremy Kolb <[email protected]>
| * Remove 'as any'Jeremy Kolb2020-08-091-1/+1
| |
| * Remove workaround for semantic token flickeringJeremy Kolb2020-08-091-7/+1
| | | | | | | | | | | | See: https://github.com/microsoft/vscode-languageserver-node/issues/576#issuecomment-593384479 This has been fixed since vscode 1.44
* | Fix no inlay hints / unresolved tokens until manual editVeetaha2020-08-081-3/+3
|/ | | | | | | | | | No we return ContentModified during the workspace loading. This signifies the language client to retry the operation (i.e. the client will continue polling the server while it returns ContentModified). I believe that there might be cases of overly big projects where the backoff logic we have setup in `sendRequestWithRetry` (which we use for inlay hints) might bail too early (currently the largest retry standby time is 10 seconds). However, I've tried on one of my project with 500+ dependencies and it is still enough.
* Merge #5513bors[bot]2020-07-311-2/+10
|\ | | | | | | | | | | | | | | | | | | 5513: Try figure out correct workspace in vscode multi root workspace r=vsrs a=urbandove the code to replace the root with the `${workspaceRoot}` arg breaks in multi root workspaces as it needs a qualifier `${workspaceRoot:workspaceName}` This PR attempts to figure out the root workspace - and if it cant find it falls back to the first workspace Co-authored-by: Urban Dove <[email protected]>
| * delete empty lineUrban Dove2020-07-261-1/+0
| |
| * try select correct workspace in vscode multi workspaceUrban Dove2020-07-261-2/+11
| |
* | SSR: Restrict to current selection if anyDavid Lattimore2020-07-292-2/+4
| | | | | | | | | | The selection is also used to avoid unnecessary work, but only to the file level. Further restricting unnecessary work is left for later.
* | SSR: Fix a typescript lint warningDavid Lattimore2020-07-241-1/+1
| |
* | SSR: Pass current file position through to SSR code.David Lattimore2020-07-242-3/+13
|/ | | | In a subsequent commit, it will be used for resolving paths.
* Merge #5480bors[bot]2020-07-231-0/+4
|\ | | | | | | | | | | | | | | | | | | | | 5480: Fix snippetTextEdits applying to other files r=matklad a=TimoFreiberg Fixes #4551 `vscode.window.visibleTextEditors` only contains editors whose contents are being displayed at the moment, so the previous logic only worked if the other file for which a snippetTextEdit is being received was visible in a separate split. I feel that this is a hacky approach, so feel free to reject it for something nicer :) Co-authored-by: Timo Freiberg <[email protected]>
| * Fix snippetTextEdits applying to other filesTimo Freiberg2020-07-221-0/+4
| | | | | | | | | | | | | | vscode.window.visibleTextEditors only contains editors whose contents are being displayed at the moment, so the previous logic only worked if the other file for which a snippetTextEdit is being received was visible in a separate split.
* | ProblemMatcher auto detects relative/absolute paths and matches VSCode LSP's ↵James Leitch2020-07-231-0/+1
|/ | | | owner and source. VSCode LSP updated to specify owner.
* Workaround rollup messing up default importsVeetaha2020-07-081-1/+4
|
* Gzip artifactsVeetaha2020-07-072-16/+17
| | | | | | | | | | Co-authored-by: bjorn3 <[email protected]> Override miniz_oxide to build it with optimizations Building this crate with optimizations decreases the gzipping part of `cargo xtask dist` from `30-40s` down to `3s`, the overhead for `rustc` to apply optimizations is miserable on this background
* Add a command to compute memory usage statisticsJonas Schievink2020-07-073-0/+34
|
* Consider EPERM error as other vscode processes using rust-analyzerVeetaha2020-07-071-1/+1
|
* Fix: allow for binaries from $PATH to pass validity checkVeetaha2020-07-061-6/+2
|
* Revert "Dispose logger on extension deactivation"Veetaha2020-07-052-6/+0
| | | | | This reverts commit 13872543e074adc153b440660beda441fd562f53. That commit was wrong because we use-after-free the logger
* Dispose logger on extension deactivationVeetaha2020-07-052-0/+6
|
* Improve client logging (use output channel and more log levels)Veetaha2020-07-054-18/+49
|
* Merge #5202bors[bot]2020-07-033-13/+44
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5202: Runnable env r=matklad a=vsrs This PR adds on option to specify (in the settings.json) environment variables passed to the runnable. The simplest way for all runnables in a bunch: ```jsonc "rust-analyzer.runnableEnv": { "RUN_SLOW_TESTS": "1" } ``` Or it is possible to specify vars more granularly: ```jsonc "rust-analyzer.runnableEnv": [ { // "mask": null, // null mask means that this rule will be applied for all runnables env: { "APP_ID": "1", "APP_DATA": "asdf" } }, { "mask": "test_name", "env": { "APP_ID": "2", // overwrites only APP_ID } } ] ``` You can use any valid RegExp as a mask. Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively. Fixes #4450 I suppose this info should be somewhere in the docs, but unsure where is the best place. Co-authored-by: vsrs <[email protected]>
| * Fix workspaceRootvsrs2020-07-031-1/+3
| |
| * code lintingvsrs2020-07-032-2/+2
| |
| * Add testsvsrs2020-07-033-10/+10
| |
| * Add runnable env support.vsrs2020-07-033-11/+40
| |
* | Pass CodeActionKind through our middleware to populate menusJeremy Kolb2020-07-021-2/+4
|/
* Merge #5188bors[bot]2020-07-023-1/+46
|\ | | | | | | | | | | | | | | 5188: Implement StatusBar r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * Implement StatusBarAleksey Kladov2020-07-023-1/+46
| |
| |
| \
| \
| \
*---. \ Merge #5089 #5161 #5184 #5185 #5186bors[bot]2020-07-021-7/+19
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5089: Disable auto-complete on comments r=matklad a=BGluth Resolves #4907 by disabling any auto-completion on comments. As flodiebold [pointed out](https://github.com/rust-analyzer/rust-analyzer/issues/4907#issuecomment-648439979), in the future we may want to support some form of auto-completion within doc comments, but for now it was suggested to just disable auto-completion on them entirely. The implementation involves adding a new field `is_comment` to `CompletionContext` and checking if the immediate token we auto-completed on is a comment. I couldn't see a case where we need to check any of the ancestors, but let me know if this is not sufficient. I also wasn't sure if it was necessary to add a new field to this struct, but I decided it's probably the best option if we want to potentially do auto-completion on doc comments in the future. Finally, the three tests I added should I think ideally not filter results by `CompletionKind::Keyword`, but if I want to get unfiltered results, I need access to a non-public function [get_all_completion_items](https://github.com/rust-analyzer/rust-analyzer/blob/9a4d02faf9c47f401b8756c3f7fcab2198f5f9cd/crates/ra_ide/src/completion/test_utils.rs#L32-L39) which I don't know if I should make public just for this. 5161: SSR: Add initial support for placeholder constraints r=matklad a=davidlattimore 5184: Always install required nightly extension if current one is not nightly r=matklad a=Veetaha This is weird, but having switched back to stable by uninstalling the extension appears that vscode doesn't destroy the `PersistentState` and thus changing to `nightly` channel doesn't work because the last check for nightly extension was less than 1 hour ago. The simple solution is to skip this check if we know that the current extension version is not nightly. 5185: Force showing extension activation error pop-up notification r=matklad a=Veetaha Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5091 5186: fix: correct pd/ppd/tfn/tmod completion doc r=matklad a=fannheyward https://github.com/rust-analyzer/rust-analyzer/blob/a33eefa3b26000b3018e6bb873f18dbe15ab4ab7/crates/ra_ide/src/completion/complete_snippet.rs#L23-L24 Co-authored-by: BGluth <[email protected]> Co-authored-by: David Lattimore <[email protected]> Co-authored-by: Veetaha <[email protected]> Co-authored-by: Heyward Fann <[email protected]>
| | | * Force showing extension activation error pop-up notificationVeetaha2020-07-021-3/+11
| | | |
| | * | Always install required nightly extension if current one is not nightlyVeetaha2020-07-021-4/+8
| | |/
* | / Add reload workspace commandAleksey Kladov2020-07-013-4/+4
|/ /
* | Merge #5101bors[bot]2020-06-302-1/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5101: Add expect -- a light-weight alternative to insta r=matklad a=matklad This PR implements a small snapshot-testing library. Snapshot updating is done by setting an env var, or by using editor feature (which runs a test with env-var set). Here's workflow for updating a failing test: ![expect](https://user-images.githubusercontent.com/1711539/85926956-28afa080-b8a3-11ea-9260-c6d0d8914d0b.gif) Here's workflow for adding a new test: ![expect-fresh](https://user-images.githubusercontent.com/1711539/85926961-306f4500-b8a3-11ea-9369-f2373e327a3f.gif) Note that colorized diffs are not implemented in this PR, but should be easy to add (we already use them in test_utils). Main differences from insta (which is essential for rust-analyzer development, thanks @mitsuhiko!): * self-updating tests, no need for a separate tool * fewer features (only inline snapshots, no redactions) * fewer deps (no yaml, no persistence) * tighter integration with editor * first-class snapshot object, which can be used to write test functions (as opposed to testing macros) * trivial to tweak for rust-analyzer needs, by virtue of being a workspace member. I think eventually we should converge to a single snapshot testing library, but I am not sure that `expect` is exactly right, so I suggest rolling with both insta and expect for some time (if folks agree that expect might be better in the first place!). # Editor Integration Implementation The thing I am most excited about is the ability to update a specific snapshot from the editor. I want this to be available to other snapshot-testing libraries (cc @mitsuhiko, @aaronabramov), so I want to document how this works. The ideal UI here would be a code action (:bulb:). Unfortunately, it seems like it is impossible to implement without some kind of persistence (if you save test failures into some kind of a database, like insta does, than you can read the database from the editor plugin). Note that it is possible to highlight error by outputing error message in rustc's format. Unfortunately, one can't use the same trick to implement a quick fix. For this reason, expect makes use of another rust-analyzer feature -- ability to run a single test at the cursor position. This does need some expect-specific code in rust-analyzer unfortunately. Specifically, if rust-analyzer notices that the cursor is on `expect!` macro, it adds a special flag to runnable's JSON. However, given #5017 it is possible to approximate this well-enough without rust-analyzer integration. Specifically, an extension can register a special runner which checks (using regexes) if rust-anlyzer runnable covers text with specific macro invocation and do special magic in that case. closes #3835 Co-authored-by: Aleksey Kladov <[email protected]>
| * Add light-weight snapshot testing library with editor integrationAleksey Kladov2020-06-272-1/+6
| |
* | Merge #5119bors[bot]2020-06-291-3/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | 5119: Show notification while SSR is in progress r=matklad a=davidlattimore Ideally we would (a) show progress and (b) allow cancellation, but at least now there's some indication to the user that something is happening. Co-authored-by: David Lattimore <[email protected]>