-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add library
semantic token modifier to items from other crates
#8942
Conversation
Regarding the tests you should be able to just do the following as the fixture source: //- /main.rs crate:main deps:dep
use dep::Foo;
...
//- /lib.rs crate:dep
pub struct Foo; If I see this right you should only get stuff from Edit: Turns out we already do something like that here https://github.com/rust-analyzer/rust-analyzer/blob/f04daf693aec9f3ffbd98bd368b79646246d506b/crates/ide/src/syntax_highlighting/tests.rs#L666-L681 |
Yeah, that would be a good idea!
…On Mon, 24 May 2021 at 00:15, Aramis Razzaghipour ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In crates/hir/src/lib.rs
<#8942 (comment)>
:
> + pub fn krate(self, db: &dyn HirDatabase) -> Crate {
+ self.module(db).krate()
+ }
Some of the krate methods were there before; should I remove them and
replace the callers with .module(db).krate() too?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8942 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M3FTZ367N2AMGWLPOTTPFV6TANCNFSM45LXKXIQ>
.
|
Should built-in types have the |
library
semantic token modifier to items from other crates
I would say no, since technically they don't come from a library and they already have the |
@Veykril Makes sense. Do you have any other feedback for me? :) |
bors d+ |
✌️ arzg can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
library
semantic token modifier to items from other crateslibrary
semantic token modifier to items from other crates
library
semantic token modifier to items from other crateslibrary
semantic token modifier to items from other crates
Closes #5772.
A lot of code here is pretty repetitive; please let me know if you have any ideas how to improve it, or whether it’s fine as-is.
Side-note: How can I add tests for this? I don’t see a way for the test Rust code in
test_highlighting
to reference other crates to observe the new behaviour.