diff options
Diffstat (limited to 'crates/ide')
25 files changed, 71 insertions, 33 deletions
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 76b52fa04..4d483580d 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml | |||
@@ -23,14 +23,12 @@ url = "2.1.1" | |||
23 | stdx = { path = "../stdx", version = "0.0.0" } | 23 | stdx = { path = "../stdx", version = "0.0.0" } |
24 | syntax = { path = "../syntax", version = "0.0.0" } | 24 | syntax = { path = "../syntax", version = "0.0.0" } |
25 | text_edit = { path = "../text_edit", version = "0.0.0" } | 25 | text_edit = { path = "../text_edit", version = "0.0.0" } |
26 | base_db = { path = "../base_db", version = "0.0.0" } | ||
27 | ide_db = { path = "../ide_db", version = "0.0.0" } | 26 | ide_db = { path = "../ide_db", version = "0.0.0" } |
28 | cfg = { path = "../cfg", version = "0.0.0" } | 27 | cfg = { path = "../cfg", version = "0.0.0" } |
29 | profile = { path = "../profile", version = "0.0.0" } | 28 | profile = { path = "../profile", version = "0.0.0" } |
30 | test_utils = { path = "../test_utils", version = "0.0.0" } | 29 | test_utils = { path = "../test_utils", version = "0.0.0" } |
31 | assists = { path = "../assists", version = "0.0.0" } | 30 | assists = { path = "../assists", version = "0.0.0" } |
32 | ssr = { path = "../ssr", version = "0.0.0" } | 31 | ssr = { path = "../ssr", version = "0.0.0" } |
33 | call_info = { path = "../call_info", version = "0.0.0" } | ||
34 | completion = { path = "../completion", version = "0.0.0" } | 32 | completion = { path = "../completion", version = "0.0.0" } |
35 | 33 | ||
36 | # ide should depend only on the top-level `hir` package. if you need | 34 | # ide should depend only on the top-level `hir` package. if you need |
diff --git a/crates/ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs index 9d6433fe0..8ad50a2ee 100644 --- a/crates/ide/src/call_hierarchy.rs +++ b/crates/ide/src/call_hierarchy.rs | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | use indexmap::IndexMap; | 3 | use indexmap::IndexMap; |
4 | 4 | ||
5 | use call_info::FnCallNode; | ||
6 | use hir::Semantics; | 5 | use hir::Semantics; |
6 | use ide_db::call_info::FnCallNode; | ||
7 | use ide_db::RootDatabase; | 7 | use ide_db::RootDatabase; |
8 | use syntax::{ast, match_ast, AstNode, TextRange}; | 8 | use syntax::{ast, match_ast, AstNode, TextRange}; |
9 | 9 | ||
@@ -137,7 +137,7 @@ impl CallLocations { | |||
137 | 137 | ||
138 | #[cfg(test)] | 138 | #[cfg(test)] |
139 | mod tests { | 139 | mod tests { |
140 | use base_db::FilePosition; | 140 | use ide_db::base_db::FilePosition; |
141 | 141 | ||
142 | use crate::fixture; | 142 | use crate::fixture; |
143 | 143 | ||
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 232074c3d..d0ee58858 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -9,11 +9,11 @@ mod field_shorthand; | |||
9 | 9 | ||
10 | use std::cell::RefCell; | 10 | use std::cell::RefCell; |
11 | 11 | ||
12 | use base_db::SourceDatabase; | ||
13 | use hir::{ | 12 | use hir::{ |
14 | diagnostics::{Diagnostic as _, DiagnosticSinkBuilder}, | 13 | diagnostics::{Diagnostic as _, DiagnosticSinkBuilder}, |
15 | Semantics, | 14 | Semantics, |
16 | }; | 15 | }; |
16 | use ide_db::base_db::SourceDatabase; | ||
17 | use ide_db::RootDatabase; | 17 | use ide_db::RootDatabase; |
18 | use itertools::Itertools; | 18 | use itertools::Itertools; |
19 | use rustc_hash::FxHashSet; | 19 | use rustc_hash::FxHashSet; |
diff --git a/crates/ide/src/diagnostics/field_shorthand.rs b/crates/ide/src/diagnostics/field_shorthand.rs index 54e9fce9e..f41bcd619 100644 --- a/crates/ide/src/diagnostics/field_shorthand.rs +++ b/crates/ide/src/diagnostics/field_shorthand.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Suggests shortening `Foo { field: field }` to `Foo { field }` in both | 1 | //! Suggests shortening `Foo { field: field }` to `Foo { field }` in both |
2 | //! expressions and patterns. | 2 | //! expressions and patterns. |
3 | 3 | ||
4 | use base_db::FileId; | 4 | use ide_db::base_db::FileId; |
5 | use ide_db::source_change::SourceFileEdit; | 5 | use ide_db::source_change::SourceFileEdit; |
6 | use syntax::{ast, match_ast, AstNode, SyntaxNode}; | 6 | use syntax::{ast, match_ast, AstNode, SyntaxNode}; |
7 | use text_edit::TextEdit; | 7 | use text_edit::TextEdit; |
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 0c75e50b0..0c950003e 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs | |||
@@ -1,6 +1,5 @@ | |||
1 | //! Provides a way to attach fixes to the diagnostics. | 1 | //! Provides a way to attach fixes to the diagnostics. |
2 | //! The same module also has all curret custom fixes for the diagnostics implemented. | 2 | //! The same module also has all curret custom fixes for the diagnostics implemented. |
3 | use base_db::FileId; | ||
4 | use hir::{ | 3 | use hir::{ |
5 | db::AstDatabase, | 4 | db::AstDatabase, |
6 | diagnostics::{ | 5 | diagnostics::{ |
@@ -9,6 +8,7 @@ use hir::{ | |||
9 | }, | 8 | }, |
10 | HasSource, HirDisplay, Semantics, VariantDef, | 9 | HasSource, HirDisplay, Semantics, VariantDef, |
11 | }; | 10 | }; |
11 | use ide_db::base_db::FileId; | ||
12 | use ide_db::{ | 12 | use ide_db::{ |
13 | source_change::{FileSystemEdit, SourceFileEdit}, | 13 | source_change::{FileSystemEdit, SourceFileEdit}, |
14 | RootDatabase, | 14 | RootDatabase, |
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index cf9d617dc..0c429a262 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use base_db::{FileId, SourceDatabase}; | ||
4 | use either::Either; | 3 | use either::Either; |
5 | use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; | 4 | use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource}; |
5 | use ide_db::base_db::{FileId, SourceDatabase}; | ||
6 | use ide_db::{defs::Definition, RootDatabase}; | 6 | use ide_db::{defs::Definition, RootDatabase}; |
7 | use syntax::{ | 7 | use syntax::{ |
8 | ast::{self, DocCommentsOwner, NameOwner}, | 8 | ast::{self, DocCommentsOwner, NameOwner}, |
diff --git a/crates/ide/src/fixture.rs b/crates/ide/src/fixture.rs index ed06689f0..eb57f9224 100644 --- a/crates/ide/src/fixture.rs +++ b/crates/ide/src/fixture.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! Utilities for creating `Analysis` instances for tests. | 1 | //! Utilities for creating `Analysis` instances for tests. |
2 | use base_db::fixture::ChangeFixture; | 2 | use ide_db::base_db::fixture::ChangeFixture; |
3 | use test_utils::{extract_annotations, RangeOrOffset}; | 3 | use test_utils::{extract_annotations, RangeOrOffset}; |
4 | 4 | ||
5 | use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; | 5 | use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; |
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index a87e31019..15792f947 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs | |||
@@ -100,7 +100,7 @@ pub(crate) fn reference_definition( | |||
100 | 100 | ||
101 | #[cfg(test)] | 101 | #[cfg(test)] |
102 | mod tests { | 102 | mod tests { |
103 | use base_db::FileRange; | 103 | use ide_db::base_db::FileRange; |
104 | use syntax::{TextRange, TextSize}; | 104 | use syntax::{TextRange, TextSize}; |
105 | 105 | ||
106 | use crate::fixture; | 106 | use crate::fixture; |
diff --git a/crates/ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs index 6c586bbd1..529004878 100644 --- a/crates/ide/src/goto_implementation.rs +++ b/crates/ide/src/goto_implementation.rs | |||
@@ -74,7 +74,7 @@ fn impls_for_trait( | |||
74 | 74 | ||
75 | #[cfg(test)] | 75 | #[cfg(test)] |
76 | mod tests { | 76 | mod tests { |
77 | use base_db::FileRange; | 77 | use ide_db::base_db::FileRange; |
78 | 78 | ||
79 | use crate::fixture; | 79 | use crate::fixture; |
80 | 80 | ||
diff --git a/crates/ide/src/goto_type_definition.rs b/crates/ide/src/goto_type_definition.rs index 6d0df04dd..aba6bf5dc 100644 --- a/crates/ide/src/goto_type_definition.rs +++ b/crates/ide/src/goto_type_definition.rs | |||
@@ -54,7 +54,7 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> { | |||
54 | 54 | ||
55 | #[cfg(test)] | 55 | #[cfg(test)] |
56 | mod tests { | 56 | mod tests { |
57 | use base_db::FileRange; | 57 | use ide_db::base_db::FileRange; |
58 | 58 | ||
59 | use crate::fixture; | 59 | use crate::fixture; |
60 | 60 | ||
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 0332c7be0..832192881 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use base_db::SourceDatabase; | ||
2 | use hir::{ | 1 | use hir::{ |
3 | Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay, | 2 | Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay, |
4 | Module, ModuleDef, ModuleSource, Semantics, | 3 | Module, ModuleDef, ModuleSource, Semantics, |
5 | }; | 4 | }; |
5 | use ide_db::base_db::SourceDatabase; | ||
6 | use ide_db::{ | 6 | use ide_db::{ |
7 | defs::{Definition, NameClass, NameRefClass}, | 7 | defs::{Definition, NameClass, NameRefClass}, |
8 | RootDatabase, | 8 | RootDatabase, |
@@ -385,8 +385,8 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> { | |||
385 | 385 | ||
386 | #[cfg(test)] | 386 | #[cfg(test)] |
387 | mod tests { | 387 | mod tests { |
388 | use base_db::FileLoader; | ||
389 | use expect_test::{expect, Expect}; | 388 | use expect_test::{expect, Expect}; |
389 | use ide_db::base_db::FileLoader; | ||
390 | 390 | ||
391 | use crate::fixture; | 391 | use crate::fixture; |
392 | 392 | ||
@@ -638,6 +638,33 @@ fn main() { } | |||
638 | } | 638 | } |
639 | 639 | ||
640 | #[test] | 640 | #[test] |
641 | fn hover_shows_fn_doc_attr_raw_string() { | ||
642 | check( | ||
643 | r##" | ||
644 | #[doc = r#"Raw string doc attr"#] | ||
645 | pub fn foo<|>(_: &Path) {} | ||
646 | |||
647 | fn main() { } | ||
648 | "##, | ||
649 | expect![[r##" | ||
650 | *foo* | ||
651 | |||
652 | ```rust | ||
653 | test | ||
654 | ``` | ||
655 | |||
656 | ```rust | ||
657 | pub fn foo(_: &Path) | ||
658 | ``` | ||
659 | |||
660 | --- | ||
661 | |||
662 | Raw string doc attr | ||
663 | "##]], | ||
664 | ); | ||
665 | } | ||
666 | |||
667 | #[test] | ||
641 | fn hover_shows_struct_field_info() { | 668 | fn hover_shows_struct_field_info() { |
642 | // Hovering over the field when instantiating | 669 | // Hovering over the field when instantiating |
643 | check( | 670 | check( |
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index cecfae4c7..4bc733b70 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -48,11 +48,11 @@ mod doc_links; | |||
48 | 48 | ||
49 | use std::sync::Arc; | 49 | use std::sync::Arc; |
50 | 50 | ||
51 | use base_db::{ | 51 | use cfg::CfgOptions; |
52 | use ide_db::base_db::{ | ||
52 | salsa::{self, ParallelDatabase}, | 53 | salsa::{self, ParallelDatabase}, |
53 | CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, | 54 | CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, |
54 | }; | 55 | }; |
55 | use cfg::CfgOptions; | ||
56 | use ide_db::{ | 56 | use ide_db::{ |
57 | symbol_index::{self, FileSymbol}, | 57 | symbol_index::{self, FileSymbol}, |
58 | LineIndexDatabase, | 58 | LineIndexDatabase, |
@@ -80,19 +80,19 @@ pub use crate::{ | |||
80 | Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange, | 80 | Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange, |
81 | }, | 81 | }, |
82 | }; | 82 | }; |
83 | pub use call_info::CallInfo; | ||
84 | pub use completion::{ | 83 | pub use completion::{ |
85 | CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat, | 84 | CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat, |
86 | }; | 85 | }; |
86 | pub use ide_db::call_info::CallInfo; | ||
87 | 87 | ||
88 | pub use assists::{ | 88 | pub use assists::{ |
89 | utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist, | 89 | utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist, |
90 | }; | 90 | }; |
91 | pub use base_db::{ | 91 | pub use hir::{Documentation, Semantics}; |
92 | pub use ide_db::base_db::{ | ||
92 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, | 93 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, |
93 | SourceRootId, | 94 | SourceRootId, |
94 | }; | 95 | }; |
95 | pub use hir::{Documentation, Semantics}; | ||
96 | pub use ide_db::{ | 96 | pub use ide_db::{ |
97 | label::Label, | 97 | label::Label, |
98 | line_index::{LineCol, LineIndex}, | 98 | line_index::{LineCol, LineIndex}, |
@@ -396,7 +396,7 @@ impl Analysis { | |||
396 | 396 | ||
397 | /// Computes parameter information for the given call expression. | 397 | /// Computes parameter information for the given call expression. |
398 | pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>> { | 398 | pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>> { |
399 | self.with_db(|db| call_info::call_info(db, position)) | 399 | self.with_db(|db| ide_db::call_info::call_info(db, position)) |
400 | } | 400 | } |
401 | 401 | ||
402 | /// Computes call hierarchy candidates for the given file position. | 402 | /// Computes call hierarchy candidates for the given file position. |
diff --git a/crates/ide/src/parent_module.rs b/crates/ide/src/parent_module.rs index ef94acfec..6cc3b2991 100644 --- a/crates/ide/src/parent_module.rs +++ b/crates/ide/src/parent_module.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use base_db::{CrateId, FileId, FilePosition}; | ||
2 | use hir::Semantics; | 1 | use hir::Semantics; |
2 | use ide_db::base_db::{CrateId, FileId, FilePosition}; | ||
3 | use ide_db::RootDatabase; | 3 | use ide_db::RootDatabase; |
4 | use syntax::{ | 4 | use syntax::{ |
5 | algo::find_node_at_offset, | 5 | algo::find_node_at_offset, |
diff --git a/crates/ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs index 6944dbcd2..ea0acfaa0 100644 --- a/crates/ide/src/prime_caches.rs +++ b/crates/ide/src/prime_caches.rs | |||
@@ -3,8 +3,8 @@ | |||
3 | //! request takes longer to compute. This modules implemented prepopulating of | 3 | //! request takes longer to compute. This modules implemented prepopulating of |
4 | //! various caches, it's not really advanced at the moment. | 4 | //! various caches, it's not really advanced at the moment. |
5 | 5 | ||
6 | use base_db::SourceDatabase; | ||
7 | use hir::db::DefDatabase; | 6 | use hir::db::DefDatabase; |
7 | use ide_db::base_db::SourceDatabase; | ||
8 | 8 | ||
9 | use crate::RootDatabase; | 9 | use crate::RootDatabase; |
10 | 10 | ||
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 67ec257a8..a517081d5 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -191,8 +191,8 @@ fn get_struct_def_name_for_struct_literal_search( | |||
191 | 191 | ||
192 | #[cfg(test)] | 192 | #[cfg(test)] |
193 | mod tests { | 193 | mod tests { |
194 | use base_db::FileId; | ||
195 | use expect_test::{expect, Expect}; | 194 | use expect_test::{expect, Expect}; |
195 | use ide_db::base_db::FileId; | ||
196 | use stdx::format_to; | 196 | use stdx::format_to; |
197 | 197 | ||
198 | use crate::{fixture, SearchScope}; | 198 | use crate::{fixture, SearchScope}; |
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 35aafc49d..26ac2371a 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use base_db::SourceDatabaseExt; | ||
4 | use hir::{Module, ModuleDef, ModuleSource, Semantics}; | 3 | use hir::{Module, ModuleDef, ModuleSource, Semantics}; |
4 | use ide_db::base_db::SourceDatabaseExt; | ||
5 | use ide_db::{ | 5 | use ide_db::{ |
6 | defs::{Definition, NameClass, NameRefClass}, | 6 | defs::{Definition, NameClass, NameRefClass}, |
7 | RootDatabase, | 7 | RootDatabase, |
diff --git a/crates/ide/src/status.rs b/crates/ide/src/status.rs index 0af84daa0..8e91c99d7 100644 --- a/crates/ide/src/status.rs +++ b/crates/ide/src/status.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | use std::{fmt, iter::FromIterator, sync::Arc}; | 1 | use std::{fmt, iter::FromIterator, sync::Arc}; |
2 | 2 | ||
3 | use base_db::{ | 3 | use hir::MacroFile; |
4 | use ide_db::base_db::{ | ||
4 | salsa::debug::{DebugQueryTable, TableEntry}, | 5 | salsa::debug::{DebugQueryTable, TableEntry}, |
5 | CrateId, FileId, FileTextQuery, SourceDatabase, SourceRootId, | 6 | CrateId, FileId, FileTextQuery, SourceDatabase, SourceRootId, |
6 | }; | 7 | }; |
7 | use hir::MacroFile; | ||
8 | use ide_db::{ | 8 | use ide_db::{ |
9 | symbol_index::{LibrarySymbolsQuery, SymbolIndex}, | 9 | symbol_index::{LibrarySymbolsQuery, SymbolIndex}, |
10 | RootDatabase, | 10 | RootDatabase, |
@@ -16,7 +16,7 @@ use stdx::format_to; | |||
16 | use syntax::{ast, Parse, SyntaxNode}; | 16 | use syntax::{ast, Parse, SyntaxNode}; |
17 | 17 | ||
18 | fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 18 | fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { |
19 | base_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>() | 19 | ide_db::base_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>() |
20 | } | 20 | } |
21 | fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 21 | fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { |
22 | hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>() | 22 | hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>() |
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 750848467..9f864179e 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs | |||
@@ -579,7 +579,14 @@ fn highlight_element( | |||
579 | } | 579 | } |
580 | } | 580 | } |
581 | T![-] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { | 581 | T![-] if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { |
582 | HighlightTag::NumericLiteral.into() | 582 | let prefix_expr = element.parent().and_then(ast::PrefixExpr::cast)?; |
583 | |||
584 | let expr = prefix_expr.expr()?; | ||
585 | match expr { | ||
586 | ast::Expr::Literal(_) => HighlightTag::NumericLiteral, | ||
587 | _ => HighlightTag::Operator, | ||
588 | } | ||
589 | .into() | ||
583 | } | 590 | } |
584 | _ if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { | 591 | _ if element.parent().and_then(ast::PrefixExpr::cast).is_some() => { |
585 | HighlightTag::Operator.into() | 592 | HighlightTag::Operator.into() |
diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index 57e2d2923..abcc5cccc 100644 --- a/crates/ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Renders a bit of code as HTML. | 1 | //! Renders a bit of code as HTML. |
2 | 2 | ||
3 | use base_db::SourceDatabase; | 3 | use ide_db::base_db::SourceDatabase; |
4 | use oorandom::Rand32; | 4 | use oorandom::Rand32; |
5 | use stdx::format_to; | 5 | use stdx::format_to; |
6 | use syntax::{AstNode, TextRange, TextSize}; | 6 | use syntax::{AstNode, TextRange, TextSize}; |
diff --git a/crates/ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs index acd91b26c..59a74bc02 100644 --- a/crates/ide/src/syntax_highlighting/injection.rs +++ b/crates/ide/src/syntax_highlighting/injection.rs | |||
@@ -3,8 +3,8 @@ | |||
3 | use std::{collections::BTreeMap, convert::TryFrom}; | 3 | use std::{collections::BTreeMap, convert::TryFrom}; |
4 | 4 | ||
5 | use ast::{HasQuotes, HasStringValue}; | 5 | use ast::{HasQuotes, HasStringValue}; |
6 | use call_info::ActiveParameter; | ||
7 | use hir::Semantics; | 6 | use hir::Semantics; |
7 | use ide_db::call_info::ActiveParameter; | ||
8 | use itertools::Itertools; | 8 | use itertools::Itertools; |
9 | use syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize}; | 9 | use syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize}; |
10 | 10 | ||
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index 0cb84866d..c6b4f5a00 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html | |||
@@ -176,6 +176,9 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
176 | 176 | ||
177 | <span class="keyword">let</span> <span class="variable declaration callable">a</span> <span class="operator">=</span> <span class="punctuation">|</span><span class="value_param declaration">x</span><span class="punctuation">|</span> <span class="value_param">x</span><span class="punctuation">;</span> | 177 | <span class="keyword">let</span> <span class="variable declaration callable">a</span> <span class="operator">=</span> <span class="punctuation">|</span><span class="value_param declaration">x</span><span class="punctuation">|</span> <span class="value_param">x</span><span class="punctuation">;</span> |
178 | <span class="keyword">let</span> <span class="variable declaration callable">bar</span> <span class="operator">=</span> <span class="struct">Foo</span><span class="operator">::</span><span class="function">baz</span><span class="punctuation">;</span> | 178 | <span class="keyword">let</span> <span class="variable declaration callable">bar</span> <span class="operator">=</span> <span class="struct">Foo</span><span class="operator">::</span><span class="function">baz</span><span class="punctuation">;</span> |
179 | |||
180 | <span class="keyword">let</span> <span class="variable declaration">baz</span> <span class="operator">=</span> <span class="numeric_literal">-</span><span class="numeric_literal">42</span><span class="punctuation">;</span> | ||
181 | <span class="keyword">let</span> <span class="variable declaration">baz</span> <span class="operator">=</span> <span class="operator">-</span><span class="variable">baz</span><span class="punctuation">;</span> | ||
179 | <span class="punctuation">}</span> | 182 | <span class="punctuation">}</span> |
180 | 183 | ||
181 | <span class="keyword">enum</span> <span class="enum declaration">Option</span><span class="punctuation"><</span><span class="type_param declaration">T</span><span class="punctuation">></span> <span class="punctuation">{</span> | 184 | <span class="keyword">enum</span> <span class="enum declaration">Option</span><span class="punctuation"><</span><span class="type_param declaration">T</span><span class="punctuation">></span> <span class="punctuation">{</span> |
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index da20c300e..dd43f9dd9 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -150,6 +150,9 @@ fn main() { | |||
150 | 150 | ||
151 | let a = |x| x; | 151 | let a = |x| x; |
152 | let bar = Foo::baz; | 152 | let bar = Foo::baz; |
153 | |||
154 | let baz = -42; | ||
155 | let baz = -baz; | ||
153 | } | 156 | } |
154 | 157 | ||
155 | enum Option<T> { | 158 | enum Option<T> { |
diff --git a/crates/ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs index 0eed2dbd7..7941610d6 100644 --- a/crates/ide/src/syntax_tree.rs +++ b/crates/ide/src/syntax_tree.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use base_db::{FileId, SourceDatabase}; | 1 | use ide_db::base_db::{FileId, SourceDatabase}; |
2 | use ide_db::RootDatabase; | 2 | use ide_db::RootDatabase; |
3 | use syntax::{ | 3 | use syntax::{ |
4 | algo, AstNode, NodeOrToken, SourceFile, | 4 | algo, AstNode, NodeOrToken, SourceFile, |
diff --git a/crates/ide/src/typing.rs b/crates/ide/src/typing.rs index 94b91f049..43458a3a2 100644 --- a/crates/ide/src/typing.rs +++ b/crates/ide/src/typing.rs | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | mod on_enter; | 16 | mod on_enter; |
17 | 17 | ||
18 | use base_db::{FilePosition, SourceDatabase}; | 18 | use ide_db::base_db::{FilePosition, SourceDatabase}; |
19 | use ide_db::{source_change::SourceFileEdit, RootDatabase}; | 19 | use ide_db::{source_change::SourceFileEdit, RootDatabase}; |
20 | use syntax::{ | 20 | use syntax::{ |
21 | algo::find_node_at_offset, | 21 | algo::find_node_at_offset, |
diff --git a/crates/ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs index 98adef1d6..f4ea30352 100644 --- a/crates/ide/src/typing/on_enter.rs +++ b/crates/ide/src/typing/on_enter.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Handles the `Enter` key press. At the momently, this only continues | 1 | //! Handles the `Enter` key press. At the momently, this only continues |
2 | //! comments, but should handle indent some time in the future as well. | 2 | //! comments, but should handle indent some time in the future as well. |
3 | 3 | ||
4 | use base_db::{FilePosition, SourceDatabase}; | 4 | use ide_db::base_db::{FilePosition, SourceDatabase}; |
5 | use ide_db::RootDatabase; | 5 | use ide_db::RootDatabase; |
6 | use syntax::{ | 6 | use syntax::{ |
7 | ast::{self, AstToken}, | 7 | ast::{self, AstToken}, |