about summary refs log tree commit diff
path: root/crates/rust-analyzer/src
AgeCommit message (Collapse)AuthorLines
2020-08-12Merge branch 'master' into add-disable-diagnosticsIgor Aleksanov-16/+41
2020-08-11Simplify fix structureKirill Bulatov-4/+3
2020-08-11Separate diagnostics and diagnostics fix rangesKirill Bulatov-3/+3
2020-08-11Address some FIXMEsJmPotato-5/+5
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-10Return InvalidRequest if Shutdown has been requestedJeremy Kolb-1/+16
From the LSP 3.16 spec: "If a server receives requests after a shutdown request those requests should error with InvalidRequest."
2020-08-09Merge #5692bors[bot]-2/+2
5692: Add support for extern crate r=jonas-schievink a=Nashenas88 This adds syntax highlighting, hover and goto def functionality for extern crate. Fixes #5690 Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-09Remove Option<...> from result of Crate::root_modulePaul Daniel Faria-2/+2
There doesn't seem to be any need for it, and removing it simplies several paths of code that depend on it.
2020-08-09Merge #5693bors[bot]-0/+10
5693: Fix no inlay hints / unresolved tokens until manual edit to refresh r=jonas-schievink a=Veetaha Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5349 Now 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. Here are the examples before/after the change (the gifs are quite lengthy because they show testing rather large cargo workspace). <details> <summary>Before</summary> Here you can see that the client receives empty array of inlay hints and does nothing more. Same applies to semantic tokens. The client receives unresolved tokens and does nothing more. The user needs to do a manual edit to refresh the editor. ![prev-demo](https://user-images.githubusercontent.com/36276403/89717721-e4471280-d9c1-11ea-89ce-7dc3e83d9768.gif) </details> <details> <summary>After</summary> Here the server returns ContentModified, so the client periodically retries the requests and eventually receives the wellformed response. ![new-demo](https://user-images.githubusercontent.com/36276403/89717725-eb6e2080-d9c1-11ea-84c9-796bb2b22cec.gif) </details> Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-08-10Let shutdown request to pass through when status == LoadingVeetaha-1/+1
2020-08-09Merge #5414bors[bot]-1/+1
5414: Fix test code lens r=jonas-schievink a=avrong Closes #5217 The implementation is quite similar to #4821. Maybe we should somehow deal with duplicated code. Also, both of these requests introduce some unclear behavior. I'm not sure how to process this, therefore asking for advice. Examples are below. <img width="286" alt="image" src="https://user-images.githubusercontent.com/6342851/87713209-83595f80-c7b2-11ea-8c0f-a12e7571e7df.png"> Co-authored-by: Aleksei Trifonov <avrong@avrong.me>
2020-08-09format in to_proto::markup_contentJmPotato-1/+2
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-08Fix no inlay hints / unresolved tokens until manual editVeetaha-0/+10
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.
2020-08-08Remove cloneVeetaha-1/+1
2020-08-08Reverse document symbols for each scope (#5655)Yusuke Tanaka-5/+10
2020-08-07Add an AnalysisConfig structure and use it to configure diagnostics runIgor Aleksanov-3/+11
2020-08-06Merge #5526bors[bot]-14/+208
5526: Handle semantic token deltas r=kjeremy a=kjeremy This basically takes the naive approach where we always compute the tokens but save space sending over the wire which apparently solves some GC problems with vscode. This is waiting for https://github.com/gluon-lang/lsp-types/pull/174 to be merged. I am also unsure of the best way to stash the tokens into `DocumentData` in a safe manner. Co-authored-by: kjeremy <kjeremy@gmail.com> Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-08-05Address PR commentsJeremy Kolb-18/+12
2020-08-05Fix relative path handling for custom rustfmtAleksey Kladov-5/+0
`current_dir` and relative paths to executables works differently on unix and windows (unix behavior does not make sense), see: https://github.com/oconnor663/duct.rs/blob/17e30e83a16b202551df4d70d0b2cc174cb53e5d/src/lib.rs#L295-L324 The original motivation to set cwd was to make rustfmt read the correct rustfmt.toml, but that was future proofing, rather than a bug fix. So, let's just remove this and see if breaks or fixes more use-cases. If support for per-file config is needed, we could use `--config-path` flag.
2020-08-03Revert "Restore line index micro-optimization"Michael Lazear-31/+23
This reverts commit 83a87fcd11298d8de32801ac6496ddf8b4e9c0e1.
2020-08-02Fix test code lensAleksei Trifonov-1/+1
2020-08-01Simplify argument parsingLaurențiu Nicola-24/+27
2020-07-31Handle semantic token deltaskjeremy-13/+213
2020-07-30Merge #5596bors[bot]-0/+5
5596: Add checkOnSave.noDefaultFeatures and correct, how we handle some cargo flags. r=clemenswasser a=clemenswasser This PR adds the `rust-analyzer.checkOnSave.noDefaultFeatures` option and fixes the handling of `cargo.allFeatures`, `cargo.noDefaultFeatures` and `cargo.features`. Fixes: #5550 Co-authored-by: Clemens Wasser <clemens.wasser@gmail.com>
2020-07-30Use CmdArgs pattern for bench & analysis statsAleksey Kladov-331/+305
2020-07-30Use split_once polyfillAleksey Kladov-13/+12
2020-07-30Finalize impl GrammarAleksey Kladov-1/+1
2020-07-30Finalize Trait grammarAleksey Kladov-2/+2
2020-07-30Finalize const&static grammarAleksey Kladov-2/+2
2020-07-30Rename EnumVariant -> VariantAleksey Kladov-1/+1
2020-07-30Rename EnumDef -> EnumAleksey Kladov-2/+2
2020-07-30Rename StructDef -> StructAleksey Kladov-2/+2
2020-07-30Finalize union grammarAleksey Kladov-1/+1
2020-07-30Merge #5597bors[bot]-1/+1
5597: Rename FieldDef -> Field r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-07-30Rename FieldDef -> FieldAleksey Kladov-1/+1
2020-07-30flycheck: Added checkOnSave.noDefaultFeaturesClemens Wasser-0/+5
This commit adds the option `rust-analyzer.checkOnSave.noDefaultFeatures` and fixes #5550.
2020-07-30Code shuffle resilientlyAleksey Kladov-3/+8
2020-07-30Rename TypeAliasDef -> TypeAliasAleksey Kladov-1/+1
2020-07-30Rename FnDef -> FnAleksey Kladov-2/+2
2020-07-30Rename metricAleksey Kladov-1/+1
2020-07-30Do not show progress with parallel analysisAleksey Kladov-0/+1
2020-07-30Report instructions in addition to timeAleksey Kladov-20/+20
They hopefully will be more stable on CI
2020-07-30Allow negative bytesAleksey Kladov-11/+3
Gotta be optimistic about those memory usage optimizations
2020-07-29Merge #5563bors[bot]-2/+3
5563: Check all targets for package-level tasks r=matklad a=SomeoneToIgnore When invoking "Select Runnable" with the caret on a runnable with a specific target (test, bench, binary), append the corresponding argument for the `cargo check -p` module runnable. Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-07-29Update crates/rust-analyzer/src/cli/analysis_stats.rsAleksey Kladov-1/+1
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-07-29Replace rand with oorandomAleksey Kladov-5/+20
2020-07-29Run package-specific cargo check and test for all targetsKirill Bulatov-2/+3
2020-07-29SSR: Restrict to current selection if anyDavid Lattimore-2/+14
The selection is also used to avoid unnecessary work, but only to the file level. Further restricting unnecessary work is left for later.
2020-07-27Merge #5532bors[bot]-23/+31
5532: Restore line index optimization for edits r=matklad a=lnicola Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-07-26Report type errors in metricsAleksey Kladov-0/+4
2020-07-25Restore line index micro-optimizationLaurențiu Nicola-23/+31