aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | 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]>
| * | fixed rainbow-highlighting testOmer Ben-Amram2019-12-151-0/+2
| | |
| * | Merge branch 'refs/heads/master' into feature/granular-scopesOmer Ben-Amram2019-12-1429-331/+494
| |\ \
| * | | removed `type.alias`Omer Ben-Amram2019-12-144-14/+28
| | | |
| * | | added decorationsOmer Ben-Amram2019-12-143-3/+63
| | | |
| * | | scopes resolution is more granularOmer Ben-Amram2019-12-131-8/+12
| | | |
* | | | Merge #2561bors[bot]2019-12-1419-355/+478
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2561: Split generic and non-generic paths r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Use different types for path with and without genericsAleksey Kladov2019-12-1418-354/+471
| | | | |
| * | | | Use all-features by defaultAleksey Kladov2019-12-141-1/+7
| | |/ / | |/| |
* | | | Merge #2552bors[bot]2019-12-143-6/+106
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2552: fix goto definition when inbetween tokens r=matklad a=succcubbus fixes both goto_definition and goto_type_definition. before, when running goto between some non-trivia token and an identifier, goto would be attempted for the non-trivia token. but this does not make sense for e.g. L_PAREN or COLONCOLON only for IDENTs. this resulted in goto actions not working when running them on the first character of some identifier e.g. for `module::<|>method()` or `method(<|>parameter)`. now only IDENTs will be searched for in goto actions, though i'm not sure if this is correct or if goto should also work for some other token types. Co-authored-by: succcubbus <[email protected]>
| * | | for goto and hover pick the token based on a prioritysucccubbus2019-12-133-17/+46
| | | |
| * | | add tests for goto on tuple fieldssucccubbus2019-12-132-1/+33
| | | |
| * | | try both surrounding tokens for hoversucccubbus2019-12-131-4/+12
| | | |
| * | | add failing testsucccubbus2019-12-131-0/+7
| | | |
| * | | use find() instead of filter().next()succcubbus2019-12-131-1/+1
| | | |
| * | | fix goto definition when inbetween tokenssucccubbus2019-12-132-4/+28
| |/ / | | | | | | | | | | | | | | | | | | | | | fixes both goto_definition and goto_type_definition. before, when running goto between some non-trivia token and an identifier, goto would be attempted for the non-trivia token. but this does not make sense for e.g. L_PAREN or COLONCOLON only for IDENTs. now only IDENTs will be searched for in goto actions.
* | | Merge #2554bors[bot]2019-12-1418-235/+223
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 2554: Add macros for known names and paths r=matklad a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
| * | Use path macroFlorian Diebold2019-12-134-80/+49
| | |
| * | Rename N! to name!Florian Diebold2019-12-1316-63/+63
| | |
| * | Add macros for known names and pathsFlorian Diebold2019-12-1316-173/+192
| | |
* | | Merge #2548bors[bot]2019-12-148-21/+125
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2548: Support setting cargo features and resolve `default` features by default r=matklad a=oxalica Fixes #2524 Co-authored-by: oxalica <[email protected]>
| * | | Enable `allFeatures` by default and fix lintsoxalica2019-12-132-10/+17
| | | |
| * | | Support setting cargo featuresoxalica2019-12-138-21/+118
| | | |
* | | | Merge #2557bors[bot]2019-12-131-19/+16
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2557: Remove some unwraps in add_new r=flodiebold a=kjeremy I think this file could probably be simplified a little more but this at least gets me around the panic. Fixes #2556 Co-authored-by: kjeremy <[email protected]>
| * | | Remove some unwraps in add_newkjeremy2019-12-131-19/+16
|/ / /
* | | Merge #2555bors[bot]2019-12-131-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2555: LSP 3.15 supports the deprecated tag on completions r=matklad a=kjeremy So let's set it. Co-authored-by: kjeremy <[email protected]>
| * | | LSP 3.15 supports the deprecated tag on completionskjeremy2019-12-131-0/+5
|/ / /