aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Allow fully overriding check and fmt commandsAleksey Kladov2020-04-022-2/+33
|
* Remove vscode_lldb settingAleksey Kladov2020-04-023-20/+18
|
* SiplifyAleksey Kladov2020-04-022-7/+5
|
* Lean onto default implementation of configsAleksey Kladov2020-04-028-70/+24
|
* New config in package.jsonAleksey Kladov2020-04-022-146/+166
|
* Reorder fieldsAleksey Kladov2020-04-021-44/+47
|
* Merge #3816bors[bot]2020-04-023-20/+96
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3816: vscode: add goto ast node definition from rust source code r=Veetaha a=Veetaha By holding the `Ctrl` key you can now goto-definition of the appropriate syntax token in the syntax tree read-only editor. But actually going to the definition is not very convenient, since it opens the new editor, you'd rather just hold the `Ctrl` and look at the syntax tree because it is automatically scrolled to the proper node and the node itself is enclosed with text selection. Unfortunately, the algorithm is very simple (because we don't do any elaborate parsing of the syntax tree text received from the server), but it is enough to debug not very large source files. I tested the performance and in a bad case (rust source file with 5K lines of code) it takes `1.3` seconds to build the `rust -> ast` mapping index (lazily once on the first goto definition request) and each lookup in this worst-case is approx `20-120` ms. I think this is good enough. In the simple case where the file is < 100 lines of code, it is instant. One peculiarity that I've noticed is that vscode doesn't trigger the goto-definition provider when the user triggers it on some punctuation characters (i.e. it doesn't underline them and invoke te goto-definition provider), but if you explicitly click `Ctrl+LMB` it will only then invoke the provider and navigate to the definition in a new editor. I think this is fine ;D ![rust2ast](https://user-images.githubusercontent.com/36276403/78198718-24d1d500-7492-11ea-91f6-2687cedf26ee.gif) Related: #3682 Co-authored-by: veetaha <[email protected]>
| * vscode: move docks about syntax tree to dev/README.mdveetaha2020-04-022-10/+10
| |
| * vscode: postrefactorveetaha2020-04-021-12/+6
| |
| * vscode: add docs about goto-definition for rust syntax treeveetaha2020-04-021-0/+4
| |
| * vscode: postrefactor variable namesveetaha2020-04-021-8/+8
| |
| * vscode: add goto definition from rust file to syntax tree editorveetaha2020-04-021-5/+83
|/
* Merge #3820bors[bot]2020-04-029-359/+3
|\ | | | | | | | | | | | | | | | | | | | | 3820: Remove old syntax highlighting r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * Remove old syntax highlightingAleksey Kladov2020-04-029-359/+3
| |
* | Merge #3819bors[bot]2020-04-021-4/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3819: Unique package by name and version. r=matklad a=o0Ignition0o This commit is a fixup of #3781 I introduced a bug by using a PackageId to refer to a crate when its name conflicts with a dependency. It turns out the package id currently is `name version path` while cargo expects `name:version` as argument eg: Cargo command with a `PackageId`: ``` > Executing task: cargo test --package 'config 0.1.0 (path+file:///Users/ignition/Projects/oss/config)' --test default -- test_with_name --exact --nocapture < ``` Cargo command with `name:version`: ``` > Executing task: cargo test --package 'config:0.1.0' --test default -- test_with_name --exact --nocapture < ``` Co-authored-by: o0Ignition0o <[email protected]>
| * | Unique package by name and version.o0Ignition0o2020-04-021-4/+5
| |/ | | | | | | | | This commit is a fixup of a bug I introduced by using a PackageId to refer to a crate when its name conflicts with a dependency. It turns out the package id currently is `name version path` while cargo expects `name:version` as argument.
* | Merge #3817bors[bot]2020-04-023-1/+50
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3817: vscode: highlight syntax tree ro editor r=matklad a=Veetaha Small textmate grammar declaration to make rust-analyzer syntax tree more easily inspectable: Btw, if we change the file extension of our `ra_syntax/test_data/**` files to `.rast` they should be highlighted in vscode too. The colors of the tokens are actually going to be color-theme dependent, or you can customize them via: ```jsonc { "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "name", "settings": { /* */ } } ] } } ``` ![image](https://user-images.githubusercontent.com/36276403/78204947-99f9d600-74a3-11ea-8315-cb1c87810c7c.png) Related: #3682 Co-authored-by: veetaha <[email protected]>
| * | vscode: add highlighting of syntax treeveetaha2020-04-023-1/+50
| |/
* | Merge #3815bors[bot]2020-04-022-2/+13
|\ \ | |/ |/| | | | | | | | | | | 3815: vscode: add support for light themes in "Show Syntax Tree" command r=matklad a=Veetaha Fixes: #3810 Co-authored-by: veetaha <[email protected]>
| * vscode: add support for light themes and color customization for syntax tree ↵veetaha2020-04-012-2/+13
|/ | | | highlights
* Merge #3812bors[bot]2020-04-012-4/+4
|\ | | | | | | | | | | | | | | 3812: rollup 2.3.2 r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
| * rollup 2.3.2kjeremy2020-04-012-4/+4
|/
* Merge #3806bors[bot]2020-04-012-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | 3806: lower bool literal value r=flodiebold a=JoshMcguigan Following up on #3805, this PR adds the literal value to `ast::LiteralKind` so when we lower we can use the actual value from the source code rather than the default value for the type. Ultimately I plan to use this for exhaustiveness checking in #3706. I didn't include this in the previous PR because I wasn't sure if it made sense to add this information to `ast::LiteralKind` or provide some other mechanism to get this from `ast::Literal`. For now I've only implemented this for boolean literals, but I think it could be easily extended to other types. A possible exception to this are string literals, since we may not want to clone around an owned string to hold onto in `ast::LiteralKind`, and it'd be nice to avoid adding a generic lifetime as well. Perhaps we won't ever care about the actual value of a string literal? Co-authored-by: Josh Mcguigan <[email protected]>
| * lower bool literal with the value from source code rather than default bool ↵Josh Mcguigan2020-04-012-3/+4
| | | | | | | | value
* | Merge #3809bors[bot]2020-04-0114-374/+196
|\ \ | | | | | | | | | | | | | | | | | | | | | 3809: Less config r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | Fix pointer syntaxAleksey Kladov2020-04-012-30/+36
| | |
| * | Centralize defaultsAleksey Kladov2020-04-012-18/+6
| | |
| * | Reduce scope of deserializationAleksey Kladov2020-04-015-21/+16
| | |
| * | Centralize client capabilitiesAleksey Kladov2020-04-016-17/+21
| | |
| * | Centralize all configAleksey Kladov2020-04-019-328/+151
| | |
| * | Move all config to configAleksey Kladov2020-04-013-7/+17
| | |
| * | Reduce feature flagsAleksey Kladov2020-04-014-52/+48
| | |
* | | Merge #3808bors[bot]2020-04-011-4/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 3808: filetime and proc-macro-hack r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
| * | filetime and proc-macro-hackkjeremy2020-04-011-4/+4
|/ /
* | Merge #3807bors[bot]2020-04-014-60/+94
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3807: Generalize rustfmt config r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Move config to config.rsAleksey Kladov2020-04-014-72/+77
| | |
| * | Generalize rustfmt configAleksey Kladov2020-04-013-11/+40
| |/
* | Merge #3797bors[bot]2020-04-011-10/+23
|\ \ | |/ |/| | | | | | | | | | | | | | | 3797: Don't show chaining hints for record literals and unit structs r=matklad a=lnicola Fixes #3796 r? @Veetaha Co-authored-by: LaurenÈ›iu Nicola <[email protected]>
| * Don't show chaining hints for record literals and unit structsLaurențiu Nicola2020-04-011-10/+23
| |
* | Merge #3805bors[bot]2020-04-011-21/+33
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3805: lower literal patterns r=JoshMcguigan a=JoshMcguigan While working on #3706 I discovered literal patterns weren't being lowered. This PR implements that lowering. Questions for reviewers: 1. This re-uses the existing conversion from `ast::LiteralKind` to `Literal`, but `ast::LiteralKind` doesn't include information about the actual value of the literal, which causes `Literal` to be created with the default value for the type (rather than the actual value in the source code). Am I correct in thinking that we'd eventually want to change things in such a way that we could initialize the `Literal` with the actual literal value? Is there an existing issue for this, or else perhaps I should create one to discuss how it should be implemented? My main question would be whether `ast::LiteralKind` should be extended to hold the actual value, or if we should provide some other way to get that information from `ast::Literal`? 2. I couldn't find tests which directly cover this, but it does seem to work in #3706. Do we have unit tests for this lowering code? 3. I'm not sure why `lit.literal()` returns an `Option`. Is returning a `Pat::Missing` in the `None` case the right thing to do? 4. I was basically practicing type-system driven development to figure out the transformation from `ast::Pat::LiteralPat` to `Pat::Lit`. I don't have an immediate question here, but I just wanted to ensure this section is looked at closely during review. Co-authored-by: Josh Mcguigan <[email protected]>
| * | lower literal patternsJosh Mcguigan2020-04-011-21/+33
| | |
* | | Merge #3804bors[bot]2020-04-012-53/+38
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3804: Generalize flycheck to arbitrary commands r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Simplify error handingAleksey Kladov2020-04-011-38/+17
| | | |
| * | | Generalize FlycheckconfigAleksey Kladov2020-04-012-15/+21
|/ / /
* | | Merge #3779bors[bot]2020-04-014-363/+413
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3779: Complete only missing fields in pats r=matklad a=SomeoneToIgnore A follow-up for https://github.com/rust-analyzer/rust-analyzer/pull/3694 Same name vs string [issue](https://github.com/rust-analyzer/rust-analyzer/pull/3694#discussion_r396986819) persists here, now I'm able to obtain `ast::Name`, but I see no way to convert it into `hir::Name` or vice versa. Co-authored-by: Kirill Bulatov <[email protected]>
| * | | Unite record completion logic into a single moduleKirill Bulatov2020-04-014-450/+413
| | | |
| * | | Split draftKirill Bulatov2020-04-013-59/+85
| | | |
| * | | Complete only missing fields in patsKirill Bulatov2020-04-011-1/+62
| |/ /
* | | Merge #3803bors[bot]2020-04-013-39/+35
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3803: Cleanup r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | CleanupAleksey Kladov2020-04-013-39/+35
| | | |