aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add TokenTextRangeEdwin Cheng2019-12-182-10/+35
|
* Add token id to delimsEdwin Cheng2019-12-186-65/+135
|
* Add token ids for all tt::LeafEdwin Cheng2019-12-186-33/+72
|
* Merge #2575bors[bot]2019-12-183-0/+333
|\ | | | | | | | | | | | | | | | | | | | | | | | | 2575: [VS Code Extension] Remap error location if it extracted inside macros r=edwin0cheng a=edwin0cheng It should fix for #2569 Co-authored-by: Edwin Cheng <[email protected]>
| * Use substr instead of endswithEdwin Cheng2019-12-181-3/+3
| |
| * Add testsEdwin Cheng2019-12-182-0/+295
| |
| * Add macro span handlingEdwin Cheng2019-12-181-0/+38
|/
* Merge #2583bors[bot]2019-12-173-3/+47
|\ | | | | | | | | | | | | | | | | | | 2583: Use prettier settings in ts-lint r=matklad a=edwin0cheng This PR add `tslint-plugin-prettier` extension in ts-lint, which "runs prettier rules as tslint rules." and remove `quotemark` from ts-lint and let prettier to handle it. And also fix #2515 Co-authored-by: Edwin Cheng <[email protected]>
| * use pretter settings in ts-lintEdwin Cheng2019-12-173-3/+47
| |
* | Merge #2582bors[bot]2019-12-171-11/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | 2582: Drop dead code r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | Drop dead codeAleksey Kladov2019-12-171-11/+0
| | |
* | | Merge #2581bors[bot]2019-12-176-17/+34
|\| | | | | | | | | | | | | | | | | | | | | | | 2581: Refactor PathKind r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | Refactor PathKindAleksey Kladov2019-12-176-17/+34
| | |
* | | Merge #2580bors[bot]2019-12-174-7/+7
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 2580: Fix highlighting token names r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | Fix highlighting token namesAleksey Kladov2019-12-174-7/+7
| | |
* | | Merge #2562bors[bot]2019-12-175-48/+86
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2562: Fix NavigationTarget ranges r=matklad a=edwin0cheng Fix the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553 This PR change the order for finding `full_range` of `focus_range` in following orders: 1. map both ranges to macro_call 2. map focus range to a token inside macro call, and full range to the whole of macro call 3. map both ranges to the whole of macro call And fix the corresponding tests and make these tests easily to follow. Co-authored-by: Edwin Cheng <[email protected]>
| * | | Use simpler logic on original_rangeEdwin Cheng2019-12-142-56/+46
| | | |
| * | | Re-export Origin to replace ExpansionOriginEdwin Cheng2019-12-144-17/+11
| | | |
| * | | Fix original_source find orderEdwin Cheng2019-12-145-55/+109
| | | |
* | | | Merge #2568bors[bot]2019-12-173-2/+18
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2568: Add option to disable all-targets. r=matklad a=pftbest Can be useful in embedded. Co-authored-by: Vadzim Dambrouski <[email protected]>
| * | | | Fix formattingVadzim Dambrouski2019-12-161-2/+1
| | | | |
| * | | | Add option to disable all-targets.Vadzim Dambrouski2019-12-153-1/+18
| | | | | | | | | | | | | | | | | | | | Can be useful in embedded.
* | | | | Merge #2571bors[bot]2019-12-171-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2571: Fixed a typo in settings r=matklad a=omerbenamram @lnicola found a typo in the description for one of the settings introduced in #2559. Co-authored-by: Omer Ben-Amram <[email protected]>
| * | | | Fixed a typoOmer Ben-Amram2019-12-161-1/+1
| | |_|/ | |/| | | | | | | | | | thanks @lnicola
* | | | Merge #2578bors[bot]2019-12-172-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2578: Default to client watching on VS Code r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Default to client watching on VS CodeAleksey Kladov2019-12-172-3/+3
| | | | |
* | | | | Merge #2577bors[bot]2019-12-173-1/+94
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2577: Improve recovery for incomplete lambdas r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Improve recovery for incomplete lambdasAleksey Kladov2019-12-173-1/+94
|/ / / /
* | | | Merge #2572bors[bot]2019-12-161-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 2572: link website r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | | link websiteAleksey Kladov2019-12-161-1/+1
|/ / /
* | | Merge #2567bors[bot]2019-12-154-3/+91
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | 2567: Handle impl Trait more correctly r=flodiebold a=flodiebold When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there. Co-authored-by: Florian Diebold <[email protected]>
| * | Add test markFlorian Diebold2019-12-153-2/+9
| | |
| * | Handle impl Trait more correctlyFlorian Diebold2019-12-153-1/+56
| | | | | | | | | | | | | | | | | | | | | When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there.
| * | Add test for unifying impl TraitFlorian Diebold2019-12-151-1/+27
|/ /
* | Merge #2565bors[bot]2019-12-152-5/+74
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2565: Fixed syntax highlighting not refreshing on windows. r=matklad a=omerbenamram I was encoutering the same probelm described in #1690. It seems that events initiated by the frontend with `rust-analyzer/decorationsRequest` would go through. So whenever a user switches tabs, highlighting will update. However, when decorations are initiated by a notification with `rust-analyzer/publishDecorations`, it would fail on this check here https://github.com/rust-analyzer/rust-analyzer/blob/6cbd8a4a4bbca8a7656df9f3ef849acebbf9ef9b/editors/code/src/notifications/publish_decorations.ts#L15 (`targetEditor` will always be `undefined`). This is because it's trying to match the uri `rust-analyzer` sends (which uses an uppercase drive letter) to the uri provided at `editor.document.uri.toString()`, which is both escaped (uses `%3a` for `:`), and uses a lowercase letter drive. Aparrently this was an issue for some other extensions aswell - https://github.com/Microsoft/vscode/issues/68325. But this is the defined behavior - https://github.com/microsoft/vscode/blob/c110d84460b3e45842a8fe753562341003595e1d/src/vs/vscode.d.ts#L1304 This fix is only relevant for windows. I've opted for a server-side fix, since rust will always return uppercase letters for drives, there seems to be no other easy solution than manipulating the Url string before sending it to the frontend. Closes #1690. Co-authored-by: Omer Ben-Amram <[email protected]>
| * | remove unnecessary turbofish.Omer Ben-Amram2019-12-151-2/+1
| | |
| * | cfg gated tests that only work on windows.Omer Ben-Amram2019-12-151-10/+16
| | |
| * | improved path checking to consider only paths that may contain a windows drive.Omer Ben-Amram2019-12-151-20/+44
| | |
| * | `npm run fix`Omer Ben-Amram2019-12-151-8/+6
| | |
| * | move import inside cfg blockOmer Ben-Amram2019-12-151-1/+2
| | |
| * | fixed commentOmer Ben-Amram2019-12-151-2/+1
| | |
| * | Lowercase drive letters on windows before sending to extension.Omer Ben-Amram2019-12-152-2/+35
| | |
| * | make drive comparison case-insensitive.Omer Ben-Amram2019-12-151-1/+10
| | |
* | | Merge #2566bors[bot]2019-12-151-0/+22
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 2566: Add a rudimentary json regex to get at information like `endLine` r=matklad a=oli-obk Co-authored-by: Oliver Scherer <[email protected]>
| * | Properly format jsonOliver Scherer2019-12-151-9/+11
| | |
| * | Add a rudimentary json regex to get at information like `endLine`Oliver Scherer2019-12-151-0/+20
|/ /
* | Merge #2564bors[bot]2019-12-151-36/+64
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2564: Introduce named constants for highlighting tag names. r=matklad a=omerbenamram Refers to #2563 . This is just a refactor of all the tag strings to named constants as suggested by @matklad. An enum could _probably_ prevent some future inconsistencies (since strings are still accepted), but I think the constants here are just fine - since the frontend only cares about strings anyways. The frontend doesn't know about about those constants, so we'll still need to be mindful for them there. Note: I didn't touch the `STYLE` const (big css blob), we could probably make it a `format!` string using something like `once_cell::Lazy`, let me know if this is something that needs fixing (since it doesn't seem like a useful API outside of tests). Also - I left those consts private, I assume if they were some kind of API we would have made it into an enum? Co-authored-by: Omer Ben-Amram <[email protected]>
| * | use a module instead of prefixed consts.Omer Ben-Amram2019-12-151-66/+64
| | |
| * | introduce named constants for highlighting tag names.Omer Ben-Amram2019-12-151-37/+67
|/ /
* | Merge #2559bors[bot]2019-12-155-18/+98
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2559: Add some granularity to syntax highlighting. r=matklad a=omerbenamram Hi, I wanted to start using `rust-analyzer` a bit more frequently - one of the main blockers for me so far was the highlighting. I just discovered it's possible to override the default colors with `ralsp.<something>` setting without waiting for #2061! However, the current implementation was lumping a bunch of different tokens into `type` and `literal`. The golden standard IMO is what Clion is currently doing (and is my current daily driver for rust). Clion allows users to control the coloring for specific literal kinds, and the default is to distinguish between them (numerics get a different color from strings, and special colors for bytestrings). I've also splitted the builtin types, which are also allowed to be highlighted speratly. My goal is to match the default experience I'm getting with clion. The only blockers now I think is that `rust-analyzer` doesn't corrently infer types in some situations, so the highlighting information is incorrect in those cases. This is what it looks like so far (with colors overriden to match clion's theme): ![image](https://user-images.githubusercontent.com/2467993/70848219-ccd97900-1e76-11ea-89e1-2e467cfcc9fb.png) If there are any other changes you feel is necessary let me know. I did leave the default colors to match the current behavior, since I'm not familiar with the colors for this theme, I added some random (different) colors in the test to check that it indeed was working. Co-authored-by: Omer Ben-Amram <[email protected]>