From e51188cd09d0a78de20d1fdde866fa5a4a31e938 Mon Sep 17 00:00:00 2001 From: Aramis Razzaghipour Date: Mon, 24 May 2021 14:48:42 +1000 Subject: =?UTF-8?q?Rename=20=E2=80=98foreign=E2=80=99=20semantic=20token?= =?UTF-8?q?=20modifier=20to=20=E2=80=98library=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ide/src/syntax_highlighting/highlight.rs | 20 ++++++++++---------- crates/ide/src/syntax_highlighting/tags.rs | 6 +++--- .../syntax_highlighting/test_data/highlighting.html | 10 +++++----- crates/rust-analyzer/src/semantic_tokens.rs | 2 +- crates/rust-analyzer/src/to_proto.rs | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'crates') diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 141536dcc..f070601fd 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -288,7 +288,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Macro)); if m.module(db).map(hir::Module::krate) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -297,7 +297,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Field)); if Some(field.parent_def(db).module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -307,7 +307,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Module)); if Some(module.krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -344,7 +344,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) h |= HlMod::Async; } if Some(func.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; } @@ -357,7 +357,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) let mut h = Highlight::new(h); if Some(adt.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -366,7 +366,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Variant)); if Some(variant.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -389,7 +389,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } if Some(konst.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -402,7 +402,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } if Some(trait_.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -425,7 +425,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } if Some(type_.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; @@ -440,7 +440,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } if Some(s.module(db).krate()) != krate { - h |= HlMod::Foreign; + h |= HlMod::Library; } return h; diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index 755599cba..e94f17cd9 100644 --- a/crates/ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs @@ -68,7 +68,7 @@ pub enum HlMod { /// Used with keywords like `async` and `await`. Async, /// Used for items from other crates. - Foreign, + Library, // Keep this last! /// Used for unsafe functions, unsafe traits, mutable statics, union accesses and unsafe operations. Unsafe, @@ -191,7 +191,7 @@ impl HlMod { HlMod::Static, HlMod::Trait, HlMod::Async, - HlMod::Foreign, + HlMod::Library, HlMod::Unsafe, ]; @@ -210,7 +210,7 @@ impl HlMod { HlMod::Static => "static", HlMod::Trait => "trait", HlMod::Async => "async", - HlMod::Foreign => "foreign", + HlMod::Library => "library", HlMod::Unsafe => "unsafe", } } diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index e65dd3ff9..055d21109 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html @@ -251,14 +251,14 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd impl Dangerous for () {} fn use_foo_items() { - let bob = foo::Person { - name: "Bob", - age: foo::consts::NUMBER, + let bob = foo::Person { + name: "Bob", + age: foo::consts::NUMBER, }; - let control_flow = foo::identity(foo::ControlFlow::Continue); + let control_flow = foo::identity(foo::ControlFlow::Continue); - if let foo::ControlFlow::Die = control_flow { + if let foo::ControlFlow::Die = control_flow { foo::die!(); } } diff --git a/crates/rust-analyzer/src/semantic_tokens.rs b/crates/rust-analyzer/src/semantic_tokens.rs index 9ebe000b5..6129af95f 100644 --- a/crates/rust-analyzer/src/semantic_tokens.rs +++ b/crates/rust-analyzer/src/semantic_tokens.rs @@ -92,7 +92,7 @@ define_semantic_token_modifiers![ (MUTABLE, "mutable"), (CONSUMING, "consuming"), (ASYNC, "async"), - (FOREIGN, "foreign"), + (LIBRARY, "library"), (UNSAFE, "unsafe"), (ATTRIBUTE_MODIFIER, "attribute"), (TRAIT_MODIFIER, "trait"), diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 6368ba413..af5152b9c 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -504,7 +504,7 @@ fn semantic_token_type_and_modifiers( HlMod::Mutable => semantic_tokens::MUTABLE, HlMod::Consuming => semantic_tokens::CONSUMING, HlMod::Async => semantic_tokens::ASYNC, - HlMod::Foreign => semantic_tokens::FOREIGN, + HlMod::Library => semantic_tokens::LIBRARY, HlMod::Unsafe => semantic_tokens::UNSAFE, HlMod::Callable => semantic_tokens::CALLABLE, HlMod::Static => lsp_types::SemanticTokenModifier::STATIC, -- cgit v1.2.3