1316: Simplify code model r=matklad a=matklad
* remove references from types which are now id-based
* remove api/impl separation, as the impl is a tiny fraction of API anyway
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1290: Add Union to code_model r=matklad a=matklad
@flodiebold I am conflicted about two possible implementation approaches:
* we can add a separate `struct Union` to code model
* we can add `fn is_union(&self)` to existing `Struct`
This PR goes with the former approach, because it seems like Unions are sufficiently different in semantics to warrant a separate types. Which is in contrast to Syntax Tree, where both structs and unions share the same node kind, because their syntax is the same.
What would be the right thing to do here?
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1312: Introduce TokenBuffer r=matklad a=edwin0cheng
As discussed in Zulip, this PR Introduce `TokenBuffer` , a safe version of `syn` crate `TokenBuffer` which support cursor based traversal of `tt::TokenTree`. This is the basis of incoming refactoring of `TokenSource` iterator based API.
This PR do the following things:
* Add TokenBuffer in `ra_tt` crate.
* Try to use this new API to refactor the `SubtreeSource` to prove it usage.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1305: Try to resolve name refs during highlighting r=matklad a=lnicola
Preview:
![image](https://user-images.githubusercontent.com/308347/58253075-43464a80-7d70-11e9-84cc-e81990f2d3eb.png)
This is probably not the cleanest implementation, but it's not clear to me what parts of `reference_definition` we don't want to run at this point. Also, is the `SourceAnalyzer` cheap enough to construct for each `NameRef`? Not like there's any alternative at this point, though.
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
1313: Update `gen_lsp_server` examples r=matklad a=dmoonfire
- updated the documentation with an example that has no errors with current compiler
- added two example code to test compilation and show in use
- one example is the bare bones version in documentation
- the other example is the same but with logging statements to show flow
Co-authored-by: Dylan Moonfire <dylan.moonfire@ryan.com>
1281: Move arm cond to match guard r=matklad a=unrealhoang
I did split the rename to another commit, yet Github UI still show entirely new file change. Please review using commits.
Co-authored-by: Unreal Hoang <unrealhoang@gmail.com>
1306: Chalk fuel r=matklad a=flodiebold
This switches Chalk to my fuel branch, and limits the fuel for trait solving. This should improve worst-case performance; for example, we can now run `ra_cli analysis-stats` against rustc again. This also fixes a bug found doing that.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
1299: Use ThemeColor and add support for light themes r=matklad a=lnicola
Part of #1294.
- switch to `ThemeColor`
- add light and high contrast theme definitions
- highlight control flow keywords and `unsafe`
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>