| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| | |
2566: Add a rudimentary json regex to get at information like `endLine` r=matklad a=oli-obk
Co-authored-by: Oliver Scherer <[email protected]>
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
2561: Split generic and non-generic paths r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | | |
|
| | |/
| |/| |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2554: Add macros for known names and paths r=matklad a=flodiebold
Co-authored-by: Florian Diebold <[email protected]>
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
2548: Support setting cargo features and resolve `default` features by default r=matklad a=oxalica
Fixes #2524
Co-authored-by: oxalica <[email protected]>
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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]>
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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]>
|
|/ / / |
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | | |
2550: Infer - and ! using std::ops::{Neg, Not} r=flodiebold a=kiljacken
Found some low hanging fruit while taking a cursory look at index inferring.
Co-authored-by: Emil Lauridsen <[email protected]>
|
| | | |
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2551: Refactor tt::Subtree delimiter r=matklad a=edwin0cheng
Refactor to :
```
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
pub struct Subtree {
pub delimiter: Option<Delimiter>,
pub token_trees: Vec<TokenTree>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Delimiter {
Parenthesis,
Brace,
Bracket,
}
```
Co-authored-by: Edwin Cheng <[email protected]>
|
|/ / |
|
|\ \
| |/
|/|
| |
| |
| |
| |
| | |
2544: Map first and last tokens in original_range r=matklad a=edwin0cheng
This PR try to fix the first part of the `original_range` : Try to map the first token and last token of a `SyntaxNode` , If success, return the union range of mapped tokens.
Co-authored-by: Edwin Cheng <[email protected]>
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2543: Move use tree lowering to a separate module r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | |
|
|/ / |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2540: Dedupe from_source impls r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | |
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2539: Remove old location infra r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|