diff options
-rw-r--r-- | Cargo.lock | 70 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | crates/base_db/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/expect/Cargo.toml | 5 | ||||
-rw-r--r-- | crates/flycheck/Cargo.toml | 7 | ||||
-rw-r--r-- | crates/ide/Cargo.toml (renamed from crates/ra_ide/Cargo.toml) | 14 | ||||
-rw-r--r-- | crates/ide/src/call_hierarchy.rs (renamed from crates/ra_ide/src/call_hierarchy.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/call_info.rs (renamed from crates/ra_ide/src/call_info.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion.rs (renamed from crates/ra_ide/src/completion.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_attribute.rs (renamed from crates/ra_ide/src/completion/complete_attribute.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_dot.rs (renamed from crates/ra_ide/src/completion/complete_dot.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_fn_param.rs (renamed from crates/ra_ide/src/completion/complete_fn_param.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_keyword.rs (renamed from crates/ra_ide/src/completion/complete_keyword.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_macro_in_item_position.rs (renamed from crates/ra_ide/src/completion/complete_macro_in_item_position.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_pattern.rs (renamed from crates/ra_ide/src/completion/complete_pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_postfix.rs (renamed from crates/ra_ide/src/completion/complete_postfix.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_qualified_path.rs (renamed from crates/ra_ide/src/completion/complete_qualified_path.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_record.rs (renamed from crates/ra_ide/src/completion/complete_record.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_snippet.rs (renamed from crates/ra_ide/src/completion/complete_snippet.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_trait_impl.rs (renamed from crates/ra_ide/src/completion/complete_trait_impl.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/complete_unqualified_path.rs (renamed from crates/ra_ide/src/completion/complete_unqualified_path.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/completion_config.rs (renamed from crates/ra_ide/src/completion/completion_config.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/completion_context.rs (renamed from crates/ra_ide/src/completion/completion_context.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/completion_item.rs (renamed from crates/ra_ide/src/completion/completion_item.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/patterns.rs (renamed from crates/ra_ide/src/completion/patterns.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/presentation.rs (renamed from crates/ra_ide/src/completion/presentation.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/completion/test_utils.rs (renamed from crates/ra_ide/src/completion/test_utils.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/diagnostics.rs (renamed from crates/ra_ide/src/diagnostics.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/diagnostics/diagnostics_with_fix.rs (renamed from crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/display.rs (renamed from crates/ra_ide/src/display.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/display/navigation_target.rs (renamed from crates/ra_ide/src/display/navigation_target.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/display/short_label.rs (renamed from crates/ra_ide/src/display/short_label.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/expand_macro.rs (renamed from crates/ra_ide/src/expand_macro.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/extend_selection.rs (renamed from crates/ra_ide/src/extend_selection.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/file_structure.rs (renamed from crates/ra_ide/src/file_structure.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/folding_ranges.rs (renamed from crates/ra_ide/src/folding_ranges.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/goto_definition.rs (renamed from crates/ra_ide/src/goto_definition.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/goto_implementation.rs (renamed from crates/ra_ide/src/goto_implementation.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/goto_type_definition.rs (renamed from crates/ra_ide/src/goto_type_definition.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/hover.rs (renamed from crates/ra_ide/src/hover.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/inlay_hints.rs (renamed from crates/ra_ide/src/inlay_hints.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/join_lines.rs (renamed from crates/ra_ide/src/join_lines.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/lib.rs (renamed from crates/ra_ide/src/lib.rs) | 2 | ||||
-rw-r--r-- | crates/ide/src/markup.rs (renamed from crates/ra_ide/src/markup.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/matching_brace.rs (renamed from crates/ra_ide/src/matching_brace.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/mock_analysis.rs (renamed from crates/ra_ide/src/mock_analysis.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/parent_module.rs (renamed from crates/ra_ide/src/parent_module.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/prime_caches.rs (renamed from crates/ra_ide/src/prime_caches.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/references.rs (renamed from crates/ra_ide/src/references.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/references/rename.rs (renamed from crates/ra_ide/src/references/rename.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/runnables.rs (renamed from crates/ra_ide/src/runnables.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/status.rs (renamed from crates/ra_ide/src/status.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting.rs (renamed from crates/ra_ide/src/syntax_highlighting.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting/html.rs (renamed from crates/ra_ide/src/syntax_highlighting/html.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting/injection.rs (renamed from crates/ra_ide/src/syntax_highlighting/injection.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting/tags.rs (renamed from crates/ra_ide/src/syntax_highlighting/tags.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs (renamed from crates/ra_ide/src/syntax_highlighting/tests.rs) | 14 | ||||
-rw-r--r-- | crates/ide/src/syntax_tree.rs (renamed from crates/ra_ide/src/syntax_tree.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/typing.rs (renamed from crates/ra_ide/src/typing.rs) | 0 | ||||
-rw-r--r-- | crates/ide/src/typing/on_enter.rs (renamed from crates/ra_ide/src/typing/on_enter.rs) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlight_doctest.html (renamed from crates/ra_ide/test_data/highlight_doctest.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlight_extern_crate.html (renamed from crates/ra_ide/test_data/highlight_extern_crate.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlight_injection.html (renamed from crates/ra_ide/test_data/highlight_injection.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlight_strings.html (renamed from crates/ra_ide/test_data/highlight_strings.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlight_unsafe.html (renamed from crates/ra_ide/test_data/highlight_unsafe.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/highlighting.html (renamed from crates/ra_ide/test_data/highlighting.html) | 0 | ||||
-rw-r--r-- | crates/ide/test_data/rainbow_highlighting.html (renamed from crates/ra_ide/test_data/rainbow_highlighting.html) | 0 | ||||
-rw-r--r-- | crates/ide_db/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ide_db/src/defs.rs | 2 | ||||
-rw-r--r-- | crates/parser/src/grammar.rs | 16 | ||||
-rw-r--r-- | crates/parser/src/grammar/attributes.rs | 10 | ||||
-rw-r--r-- | crates/parser/src/grammar/expressions.rs | 14 | ||||
-rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 20 | ||||
-rw-r--r-- | crates/parser/src/grammar/items.rs | 54 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/adt.rs | 34 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/consts.rs | 4 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/traits.rs | 38 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/use_item.rs | 4 | ||||
-rw-r--r-- | crates/parser/src/grammar/params.rs | 12 | ||||
-rw-r--r-- | crates/parser/src/grammar/paths.rs | 6 | ||||
-rw-r--r-- | crates/parser/src/grammar/patterns.rs | 20 | ||||
-rw-r--r-- | crates/parser/src/grammar/type_args.rs | 6 | ||||
-rw-r--r-- | crates/parser/src/grammar/type_params.rs | 12 | ||||
-rw-r--r-- | crates/parser/src/grammar/types.rs | 20 | ||||
-rw-r--r-- | crates/paths/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/proc_macro_api/Cargo.toml | 7 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 11 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cargo_target_spec.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_bench.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/diagnostics.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/load_cargo.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/diagnostics.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/from_proto.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 12 | ||||
-rw-r--r-- | crates/rust-analyzer/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/src/lsp_utils.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 6 | ||||
-rw-r--r-- | crates/ssr/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/stdx/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast | 71 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs | 6 | ||||
-rw-r--r-- | crates/test_utils/Cargo.toml | 7 | ||||
-rw-r--r-- | crates/vfs-notify/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/vfs/Cargo.toml | 4 | ||||
-rw-r--r-- | docs/dev/README.md | 4 | ||||
-rw-r--r-- | docs/dev/architecture.md | 8 | ||||
-rw-r--r-- | docs/dev/guide.md | 24 | ||||
-rw-r--r-- | xtask/tests/tidy.rs | 2 |
113 files changed, 246 insertions, 348 deletions
diff --git a/Cargo.lock b/Cargo.lock index 621be0832..2386c8f3a 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -346,7 +346,7 @@ dependencies = [ | |||
346 | 346 | ||
347 | [[package]] | 347 | [[package]] |
348 | name = "expect" | 348 | name = "expect" |
349 | version = "0.1.0" | 349 | version = "0.0.0" |
350 | dependencies = [ | 350 | dependencies = [ |
351 | "difference", | 351 | "difference", |
352 | "once_cell", | 352 | "once_cell", |
@@ -385,7 +385,7 @@ dependencies = [ | |||
385 | 385 | ||
386 | [[package]] | 386 | [[package]] |
387 | name = "flycheck" | 387 | name = "flycheck" |
388 | version = "0.1.0" | 388 | version = "0.0.0" |
389 | dependencies = [ | 389 | dependencies = [ |
390 | "cargo_metadata", | 390 | "cargo_metadata", |
391 | "crossbeam-channel", | 391 | "crossbeam-channel", |
@@ -580,6 +580,30 @@ dependencies = [ | |||
580 | ] | 580 | ] |
581 | 581 | ||
582 | [[package]] | 582 | [[package]] |
583 | name = "ide" | ||
584 | version = "0.0.0" | ||
585 | dependencies = [ | ||
586 | "assists", | ||
587 | "base_db", | ||
588 | "cfg", | ||
589 | "either", | ||
590 | "expect", | ||
591 | "hir", | ||
592 | "ide_db", | ||
593 | "indexmap", | ||
594 | "itertools", | ||
595 | "log", | ||
596 | "oorandom", | ||
597 | "profile", | ||
598 | "rustc-hash", | ||
599 | "ssr", | ||
600 | "stdx", | ||
601 | "syntax", | ||
602 | "test_utils", | ||
603 | "text_edit", | ||
604 | ] | ||
605 | |||
606 | [[package]] | ||
583 | name = "ide_db" | 607 | name = "ide_db" |
584 | version = "0.0.0" | 608 | version = "0.0.0" |
585 | dependencies = [ | 609 | dependencies = [ |
@@ -992,7 +1016,7 @@ dependencies = [ | |||
992 | 1016 | ||
993 | [[package]] | 1017 | [[package]] |
994 | name = "paths" | 1018 | name = "paths" |
995 | version = "0.1.0" | 1019 | version = "0.0.0" |
996 | 1020 | ||
997 | [[package]] | 1021 | [[package]] |
998 | name = "percent-encoding" | 1022 | name = "percent-encoding" |
@@ -1052,7 +1076,7 @@ dependencies = [ | |||
1052 | 1076 | ||
1053 | [[package]] | 1077 | [[package]] |
1054 | name = "proc_macro_api" | 1078 | name = "proc_macro_api" |
1055 | version = "0.1.0" | 1079 | version = "0.0.0" |
1056 | dependencies = [ | 1080 | dependencies = [ |
1057 | "crossbeam-channel", | 1081 | "crossbeam-channel", |
1058 | "jod-thread", | 1082 | "jod-thread", |
@@ -1120,30 +1144,6 @@ dependencies = [ | |||
1120 | ] | 1144 | ] |
1121 | 1145 | ||
1122 | [[package]] | 1146 | [[package]] |
1123 | name = "ra_ide" | ||
1124 | version = "0.1.0" | ||
1125 | dependencies = [ | ||
1126 | "assists", | ||
1127 | "base_db", | ||
1128 | "cfg", | ||
1129 | "either", | ||
1130 | "expect", | ||
1131 | "hir", | ||
1132 | "ide_db", | ||
1133 | "indexmap", | ||
1134 | "itertools", | ||
1135 | "log", | ||
1136 | "oorandom", | ||
1137 | "profile", | ||
1138 | "rustc-hash", | ||
1139 | "ssr", | ||
1140 | "stdx", | ||
1141 | "syntax", | ||
1142 | "test_utils", | ||
1143 | "text_edit", | ||
1144 | ] | ||
1145 | |||
1146 | [[package]] | ||
1147 | name = "rayon" | 1147 | name = "rayon" |
1148 | version = "1.3.1" | 1148 | version = "1.3.1" |
1149 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1213,7 +1213,7 @@ dependencies = [ | |||
1213 | 1213 | ||
1214 | [[package]] | 1214 | [[package]] |
1215 | name = "rust-analyzer" | 1215 | name = "rust-analyzer" |
1216 | version = "0.1.0" | 1216 | version = "0.0.0" |
1217 | dependencies = [ | 1217 | dependencies = [ |
1218 | "anyhow", | 1218 | "anyhow", |
1219 | "base_db", | 1219 | "base_db", |
@@ -1225,6 +1225,7 @@ dependencies = [ | |||
1225 | "hir", | 1225 | "hir", |
1226 | "hir_def", | 1226 | "hir_def", |
1227 | "hir_ty", | 1227 | "hir_ty", |
1228 | "ide", | ||
1228 | "ide_db", | 1229 | "ide_db", |
1229 | "itertools", | 1230 | "itertools", |
1230 | "jod-thread", | 1231 | "jod-thread", |
@@ -1239,7 +1240,6 @@ dependencies = [ | |||
1239 | "proc_macro_srv", | 1240 | "proc_macro_srv", |
1240 | "profile", | 1241 | "profile", |
1241 | "project_model", | 1242 | "project_model", |
1242 | "ra_ide", | ||
1243 | "rayon", | 1243 | "rayon", |
1244 | "rustc-hash", | 1244 | "rustc-hash", |
1245 | "serde", | 1245 | "serde", |
@@ -1444,7 +1444,7 @@ dependencies = [ | |||
1444 | 1444 | ||
1445 | [[package]] | 1445 | [[package]] |
1446 | name = "ssr" | 1446 | name = "ssr" |
1447 | version = "0.1.0" | 1447 | version = "0.0.0" |
1448 | dependencies = [ | 1448 | dependencies = [ |
1449 | "base_db", | 1449 | "base_db", |
1450 | "expect", | 1450 | "expect", |
@@ -1458,7 +1458,7 @@ dependencies = [ | |||
1458 | 1458 | ||
1459 | [[package]] | 1459 | [[package]] |
1460 | name = "stdx" | 1460 | name = "stdx" |
1461 | version = "0.1.0" | 1461 | version = "0.0.0" |
1462 | 1462 | ||
1463 | [[package]] | 1463 | [[package]] |
1464 | name = "syn" | 1464 | name = "syn" |
@@ -1515,7 +1515,7 @@ dependencies = [ | |||
1515 | 1515 | ||
1516 | [[package]] | 1516 | [[package]] |
1517 | name = "test_utils" | 1517 | name = "test_utils" |
1518 | version = "0.1.0" | 1518 | version = "0.0.0" |
1519 | dependencies = [ | 1519 | dependencies = [ |
1520 | "difference", | 1520 | "difference", |
1521 | "rustc-hash", | 1521 | "rustc-hash", |
@@ -1729,7 +1729,7 @@ dependencies = [ | |||
1729 | 1729 | ||
1730 | [[package]] | 1730 | [[package]] |
1731 | name = "vfs" | 1731 | name = "vfs" |
1732 | version = "0.1.0" | 1732 | version = "0.0.0" |
1733 | dependencies = [ | 1733 | dependencies = [ |
1734 | "fst", | 1734 | "fst", |
1735 | "paths", | 1735 | "paths", |
@@ -1738,7 +1738,7 @@ dependencies = [ | |||
1738 | 1738 | ||
1739 | [[package]] | 1739 | [[package]] |
1740 | name = "vfs-notify" | 1740 | name = "vfs-notify" |
1741 | version = "0.1.0" | 1741 | version = "0.0.0" |
1742 | dependencies = [ | 1742 | dependencies = [ |
1743 | "crossbeam-channel", | 1743 | "crossbeam-channel", |
1744 | "jod-thread", | 1744 | "jod-thread", |
@@ -39,7 +39,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 | |||
39 | 39 | ||
40 | * Website: https://rust-analyzer.github.io/ | 40 | * Website: https://rust-analyzer.github.io/ |
41 | * Metrics: https://rust-analyzer.github.io/metrics/ | 41 | * Metrics: https://rust-analyzer.github.io/metrics/ |
42 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide/ | 42 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ide/ |
43 | 43 | ||
44 | ## License | 44 | ## License |
45 | 45 | ||
diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs index 811057251..ee3415850 100644 --- a/crates/base_db/src/lib.rs +++ b/crates/base_db/src/lib.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! base_db defines basic database traits. The concrete DB is defined by ra_ide. | 1 | //! base_db defines basic database traits. The concrete DB is defined by ide. |
2 | mod cancellation; | 2 | mod cancellation; |
3 | mod input; | 3 | mod input; |
4 | pub mod fixture; | 4 | pub mod fixture; |
diff --git a/crates/expect/Cargo.toml b/crates/expect/Cargo.toml index 77775630d..b54d3a60e 100644 --- a/crates/expect/Cargo.toml +++ b/crates/expect/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "expect" | 2 | name = "expect" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
4 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
5 | edition = "2018" | 6 | edition = "2018" |
6 | license = "MIT OR Apache-2.0" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
@@ -11,4 +11,5 @@ doctest = false | |||
11 | [dependencies] | 11 | [dependencies] |
12 | once_cell = "1" | 12 | once_cell = "1" |
13 | difference = "2" | 13 | difference = "2" |
14 | |||
14 | stdx = { path = "../stdx" } | 15 | stdx = { path = "../stdx" } |
diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index acc72bc59..262a66e4e 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | ||
3 | name = "flycheck" | 2 | name = "flycheck" |
4 | version = "0.1.0" | 3 | version = "0.0.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
@@ -14,4 +14,5 @@ log = "0.4.8" | |||
14 | cargo_metadata = "0.11.1" | 14 | cargo_metadata = "0.11.1" |
15 | serde_json = "1.0.48" | 15 | serde_json = "1.0.48" |
16 | jod-thread = "0.1.1" | 16 | jod-thread = "0.1.1" |
17 | |||
17 | toolchain = { path = "../toolchain" } | 18 | toolchain = { path = "../toolchain" } |
diff --git a/crates/ra_ide/Cargo.toml b/crates/ide/Cargo.toml index 2eb86755f..e4b970c73 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ide/Cargo.toml | |||
@@ -1,16 +1,13 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "ide" |
3 | name = "ra_ide" | 3 | version = "0.0.0" |
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
10 | 10 | ||
11 | [features] | ||
12 | wasm = [] | ||
13 | |||
14 | [dependencies] | 11 | [dependencies] |
15 | either = "1.5.3" | 12 | either = "1.5.3" |
16 | indexmap = "1.3.2" | 13 | indexmap = "1.3.2" |
@@ -20,7 +17,6 @@ rustc-hash = "1.1.0" | |||
20 | oorandom = "11.1.2" | 17 | oorandom = "11.1.2" |
21 | 18 | ||
22 | stdx = { path = "../stdx" } | 19 | stdx = { path = "../stdx" } |
23 | |||
24 | syntax = { path = "../syntax" } | 20 | syntax = { path = "../syntax" } |
25 | text_edit = { path = "../text_edit" } | 21 | text_edit = { path = "../text_edit" } |
26 | base_db = { path = "../base_db" } | 22 | base_db = { path = "../base_db" } |
@@ -31,7 +27,7 @@ test_utils = { path = "../test_utils" } | |||
31 | assists = { path = "../assists" } | 27 | assists = { path = "../assists" } |
32 | ssr = { path = "../ssr" } | 28 | ssr = { path = "../ssr" } |
33 | 29 | ||
34 | # ra_ide should depend only on the top-level `hir` package. if you need | 30 | # ide should depend only on the top-level `hir` package. if you need |
35 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. | 31 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. |
36 | hir = { path = "../hir" } | 32 | hir = { path = "../hir" } |
37 | 33 | ||
diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs index 58e26b94c..58e26b94c 100644 --- a/crates/ra_ide/src/call_hierarchy.rs +++ b/crates/ide/src/call_hierarchy.rs | |||
diff --git a/crates/ra_ide/src/call_info.rs b/crates/ide/src/call_info.rs index 86abd2d8c..86abd2d8c 100644 --- a/crates/ra_ide/src/call_info.rs +++ b/crates/ide/src/call_info.rs | |||
diff --git a/crates/ra_ide/src/completion.rs b/crates/ide/src/completion.rs index 7fb4d687e..7fb4d687e 100644 --- a/crates/ra_ide/src/completion.rs +++ b/crates/ide/src/completion.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ide/src/completion/complete_attribute.rs index 603d935de..603d935de 100644 --- a/crates/ra_ide/src/completion/complete_attribute.rs +++ b/crates/ide/src/completion/complete_attribute.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ide/src/completion/complete_dot.rs index 532665285..532665285 100644 --- a/crates/ra_ide/src/completion/complete_dot.rs +++ b/crates/ide/src/completion/complete_dot.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ide/src/completion/complete_fn_param.rs index 7c63ce58f..7c63ce58f 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ide/src/completion/complete_fn_param.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ide/src/completion/complete_keyword.rs index a80708935..a80708935 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ide/src/completion/complete_keyword.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs b/crates/ide/src/completion/complete_macro_in_item_position.rs index 0447f0511..0447f0511 100644 --- a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs +++ b/crates/ide/src/completion/complete_macro_in_item_position.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_pattern.rs b/crates/ide/src/completion/complete_pattern.rs index aceb77cb5..aceb77cb5 100644 --- a/crates/ra_ide/src/completion/complete_pattern.rs +++ b/crates/ide/src/completion/complete_pattern.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs index d50b13c52..d50b13c52 100644 --- a/crates/ra_ide/src/completion/complete_postfix.rs +++ b/crates/ide/src/completion/complete_postfix.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_qualified_path.rs b/crates/ide/src/completion/complete_qualified_path.rs index cb7dd23c1..cb7dd23c1 100644 --- a/crates/ra_ide/src/completion/complete_qualified_path.rs +++ b/crates/ide/src/completion/complete_qualified_path.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ide/src/completion/complete_record.rs index 74b94594d..74b94594d 100644 --- a/crates/ra_ide/src/completion/complete_record.rs +++ b/crates/ide/src/completion/complete_record.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_snippet.rs b/crates/ide/src/completion/complete_snippet.rs index 4368e4eec..4368e4eec 100644 --- a/crates/ra_ide/src/completion/complete_snippet.rs +++ b/crates/ide/src/completion/complete_snippet.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ide/src/completion/complete_trait_impl.rs index 478e31262..478e31262 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ide/src/completion/complete_trait_impl.rs | |||
diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ide/src/completion/complete_unqualified_path.rs index 824227f31..824227f31 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ide/src/completion/complete_unqualified_path.rs | |||
diff --git a/crates/ra_ide/src/completion/completion_config.rs b/crates/ide/src/completion/completion_config.rs index 71b49ace8..71b49ace8 100644 --- a/crates/ra_ide/src/completion/completion_config.rs +++ b/crates/ide/src/completion/completion_config.rs | |||
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ide/src/completion/completion_context.rs index 047ecd9d7..047ecd9d7 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ide/src/completion/completion_context.rs | |||
diff --git a/crates/ra_ide/src/completion/completion_item.rs b/crates/ide/src/completion/completion_item.rs index 9377cdc57..9377cdc57 100644 --- a/crates/ra_ide/src/completion/completion_item.rs +++ b/crates/ide/src/completion/completion_item.rs | |||
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ide/src/completion/patterns.rs index ffc97c076..ffc97c076 100644 --- a/crates/ra_ide/src/completion/patterns.rs +++ b/crates/ide/src/completion/patterns.rs | |||
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ide/src/completion/presentation.rs index e1b1ea4ce..e1b1ea4ce 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ide/src/completion/presentation.rs | |||
diff --git a/crates/ra_ide/src/completion/test_utils.rs b/crates/ide/src/completion/test_utils.rs index 1452d7e9e..1452d7e9e 100644 --- a/crates/ra_ide/src/completion/test_utils.rs +++ b/crates/ide/src/completion/test_utils.rs | |||
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index a3ec98178..a3ec98178 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
diff --git a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs b/crates/ide/src/diagnostics/diagnostics_with_fix.rs index 85b46c995..85b46c995 100644 --- a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs +++ b/crates/ide/src/diagnostics/diagnostics_with_fix.rs | |||
diff --git a/crates/ra_ide/src/display.rs b/crates/ide/src/display.rs index 41b5bdc49..41b5bdc49 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ide/src/display.rs | |||
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index e77106177..e77106177 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ide/src/display/short_label.rs index ea49d9f97..ea49d9f97 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ide/src/display/short_label.rs | |||
diff --git a/crates/ra_ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index 31455709d..31455709d 100644 --- a/crates/ra_ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs | |||
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ide/src/extend_selection.rs index 34563a026..34563a026 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ide/src/extend_selection.rs | |||
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ide/src/file_structure.rs index c90247ba6..c90247ba6 100644 --- a/crates/ra_ide/src/file_structure.rs +++ b/crates/ide/src/file_structure.rs | |||
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ide/src/folding_ranges.rs index 7523aec55..7523aec55 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ide/src/folding_ranges.rs | |||
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 15e9b7fad..15e9b7fad 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs | |||
diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs index f503f4ec5..f503f4ec5 100644 --- a/crates/ra_ide/src/goto_implementation.rs +++ b/crates/ide/src/goto_implementation.rs | |||
diff --git a/crates/ra_ide/src/goto_type_definition.rs b/crates/ide/src/goto_type_definition.rs index 4a151b150..4a151b150 100644 --- a/crates/ra_ide/src/goto_type_definition.rs +++ b/crates/ide/src/goto_type_definition.rs | |||
diff --git a/crates/ra_ide/src/hover.rs b/crates/ide/src/hover.rs index 331aa4db0..331aa4db0 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 002adf915..002adf915 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs | |||
diff --git a/crates/ra_ide/src/join_lines.rs b/crates/ide/src/join_lines.rs index e37702acd..e37702acd 100644 --- a/crates/ra_ide/src/join_lines.rs +++ b/crates/ide/src/join_lines.rs | |||
diff --git a/crates/ra_ide/src/lib.rs b/crates/ide/src/lib.rs index 4321a6b74..eb6389529 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! ra_ide crate provides "ide-centric" APIs for the rust-analyzer. That is, | 1 | //! ide crate provides "ide-centric" APIs for the rust-analyzer. That is, |
2 | //! it generally operates with files and text ranges, and returns results as | 2 | //! it generally operates with files and text ranges, and returns results as |
3 | //! Strings, suitable for displaying to the human. | 3 | //! Strings, suitable for displaying to the human. |
4 | //! | 4 | //! |
diff --git a/crates/ra_ide/src/markup.rs b/crates/ide/src/markup.rs index 60c193c40..60c193c40 100644 --- a/crates/ra_ide/src/markup.rs +++ b/crates/ide/src/markup.rs | |||
diff --git a/crates/ra_ide/src/matching_brace.rs b/crates/ide/src/matching_brace.rs index cb6abb0db..cb6abb0db 100644 --- a/crates/ra_ide/src/matching_brace.rs +++ b/crates/ide/src/matching_brace.rs | |||
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ide/src/mock_analysis.rs index 363e6d27e..363e6d27e 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ide/src/mock_analysis.rs | |||
diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ide/src/parent_module.rs index 59ed2967c..59ed2967c 100644 --- a/crates/ra_ide/src/parent_module.rs +++ b/crates/ide/src/parent_module.rs | |||
diff --git a/crates/ra_ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs index c5ab5a1d8..c5ab5a1d8 100644 --- a/crates/ra_ide/src/prime_caches.rs +++ b/crates/ide/src/prime_caches.rs | |||
diff --git a/crates/ra_ide/src/references.rs b/crates/ide/src/references.rs index 0a76ec6b4..0a76ec6b4 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index d73dc9cd0..d73dc9cd0 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ide/src/runnables.rs index c3e07c8de..c3e07c8de 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs | |||
diff --git a/crates/ra_ide/src/status.rs b/crates/ide/src/status.rs index c23708181..c23708181 100644 --- a/crates/ra_ide/src/status.rs +++ b/crates/ide/src/status.rs | |||
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 5d7c7e8d0..5d7c7e8d0 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs | |||
diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index 249368ff8..249368ff8 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs | |||
diff --git a/crates/ra_ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs index 43f4e6fea..43f4e6fea 100644 --- a/crates/ra_ide/src/syntax_highlighting/injection.rs +++ b/crates/ide/src/syntax_highlighting/injection.rs | |||
diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index 49ec94bdc..49ec94bdc 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs | |||
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 594f61e85..94f37d773 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -105,7 +105,7 @@ impl<T> Option<T> { | |||
105 | } | 105 | } |
106 | "# | 106 | "# |
107 | .trim(), | 107 | .trim(), |
108 | expect_file!["crates/ra_ide/test_data/highlighting.html"], | 108 | expect_file!["crates/ide/test_data/highlighting.html"], |
109 | false, | 109 | false, |
110 | ); | 110 | ); |
111 | } | 111 | } |
@@ -128,7 +128,7 @@ fn bar() { | |||
128 | } | 128 | } |
129 | "# | 129 | "# |
130 | .trim(), | 130 | .trim(), |
131 | expect_file!["crates/ra_ide/test_data/rainbow_highlighting.html"], | 131 | expect_file!["crates/ide/test_data/rainbow_highlighting.html"], |
132 | true, | 132 | true, |
133 | ); | 133 | ); |
134 | } | 134 | } |
@@ -181,7 +181,7 @@ fn main() { | |||
181 | ); | 181 | ); |
182 | }"## | 182 | }"## |
183 | .trim(), | 183 | .trim(), |
184 | expect_file!["crates/ra_ide/test_data/highlight_injection.html"], | 184 | expect_file!["crates/ide/test_data/highlight_injection.html"], |
185 | false, | 185 | false, |
186 | ); | 186 | ); |
187 | } | 187 | } |
@@ -264,7 +264,7 @@ fn main() { | |||
264 | println!("{ничоси}", ничоси = 92); | 264 | println!("{ничоси}", ничоси = 92); |
265 | }"# | 265 | }"# |
266 | .trim(), | 266 | .trim(), |
267 | expect_file!["crates/ra_ide/test_data/highlight_strings.html"], | 267 | expect_file!["crates/ide/test_data/highlight_strings.html"], |
268 | false, | 268 | false, |
269 | ); | 269 | ); |
270 | } | 270 | } |
@@ -337,7 +337,7 @@ fn main() { | |||
337 | } | 337 | } |
338 | "# | 338 | "# |
339 | .trim(), | 339 | .trim(), |
340 | expect_file!["crates/ra_ide/test_data/highlight_unsafe.html"], | 340 | expect_file!["crates/ide/test_data/highlight_unsafe.html"], |
341 | false, | 341 | false, |
342 | ); | 342 | ); |
343 | } | 343 | } |
@@ -413,7 +413,7 @@ macro_rules! noop { | |||
413 | } | 413 | } |
414 | "# | 414 | "# |
415 | .trim(), | 415 | .trim(), |
416 | expect_file!["crates/ra_ide/test_data/highlight_doctest.html"], | 416 | expect_file!["crates/ide/test_data/highlight_doctest.html"], |
417 | false, | 417 | false, |
418 | ); | 418 | ); |
419 | } | 419 | } |
@@ -430,7 +430,7 @@ fn test_extern_crate() { | |||
430 | //- /alloc/lib.rs | 430 | //- /alloc/lib.rs |
431 | pub struct A | 431 | pub struct A |
432 | "#, | 432 | "#, |
433 | expect_file!["crates/ra_ide/test_data/highlight_extern_crate.html"], | 433 | expect_file!["crates/ide/test_data/highlight_extern_crate.html"], |
434 | false, | 434 | false, |
435 | ); | 435 | ); |
436 | } | 436 | } |
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs index f80044959..f80044959 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ide/src/syntax_tree.rs | |||
diff --git a/crates/ra_ide/src/typing.rs b/crates/ide/src/typing.rs index 899ce5f26..899ce5f26 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ide/src/typing.rs | |||
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs index f7d46146c..f7d46146c 100644 --- a/crates/ra_ide/src/typing/on_enter.rs +++ b/crates/ide/src/typing/on_enter.rs | |||
diff --git a/crates/ra_ide/test_data/highlight_doctest.html b/crates/ide/test_data/highlight_doctest.html index 6322d404f..6322d404f 100644 --- a/crates/ra_ide/test_data/highlight_doctest.html +++ b/crates/ide/test_data/highlight_doctest.html | |||
diff --git a/crates/ra_ide/test_data/highlight_extern_crate.html b/crates/ide/test_data/highlight_extern_crate.html index 800d894c7..800d894c7 100644 --- a/crates/ra_ide/test_data/highlight_extern_crate.html +++ b/crates/ide/test_data/highlight_extern_crate.html | |||
diff --git a/crates/ra_ide/test_data/highlight_injection.html b/crates/ide/test_data/highlight_injection.html index 18addd00d..18addd00d 100644 --- a/crates/ra_ide/test_data/highlight_injection.html +++ b/crates/ide/test_data/highlight_injection.html | |||
diff --git a/crates/ra_ide/test_data/highlight_strings.html b/crates/ide/test_data/highlight_strings.html index 1b681b2c6..1b681b2c6 100644 --- a/crates/ra_ide/test_data/highlight_strings.html +++ b/crates/ide/test_data/highlight_strings.html | |||
diff --git a/crates/ra_ide/test_data/highlight_unsafe.html b/crates/ide/test_data/highlight_unsafe.html index 552fea668..552fea668 100644 --- a/crates/ra_ide/test_data/highlight_unsafe.html +++ b/crates/ide/test_data/highlight_unsafe.html | |||
diff --git a/crates/ra_ide/test_data/highlighting.html b/crates/ide/test_data/highlighting.html index 8e0160eee..8e0160eee 100644 --- a/crates/ra_ide/test_data/highlighting.html +++ b/crates/ide/test_data/highlighting.html | |||
diff --git a/crates/ra_ide/test_data/rainbow_highlighting.html b/crates/ide/test_data/rainbow_highlighting.html index 401e87a73..401e87a73 100644 --- a/crates/ra_ide/test_data/rainbow_highlighting.html +++ b/crates/ide/test_data/rainbow_highlighting.html | |||
diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml index 885212162..692fb6415 100644 --- a/crates/ide_db/Cargo.toml +++ b/crates/ide_db/Cargo.toml | |||
@@ -25,6 +25,6 @@ text_edit = { path = "../text_edit" } | |||
25 | base_db = { path = "../base_db" } | 25 | base_db = { path = "../base_db" } |
26 | profile = { path = "../profile" } | 26 | profile = { path = "../profile" } |
27 | test_utils = { path = "../test_utils" } | 27 | test_utils = { path = "../test_utils" } |
28 | # ra_ide should depend only on the top-level `hir` package. if you need | 28 | # ide should depend only on the top-level `hir` package. if you need |
29 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. | 29 | # something from some `hir_xxx` subpackage, reexport the API via `hir`. |
30 | hir = { path = "../hir" } | 30 | hir = { path = "../hir" } |
diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index 7b5d6ac49..0d0affc27 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs | |||
@@ -243,7 +243,7 @@ impl NameRefClass { | |||
243 | } | 243 | } |
244 | 244 | ||
245 | // Note: we don't have unit-tests for this rather important function. | 245 | // Note: we don't have unit-tests for this rather important function. |
246 | // It is primarily exercised via goto definition tests in `ra_ide`. | 246 | // It is primarily exercised via goto definition tests in `ide`. |
247 | pub fn classify_name_ref( | 247 | pub fn classify_name_ref( |
248 | sema: &Semantics<RootDatabase>, | 248 | sema: &Semantics<RootDatabase>, |
249 | name_ref: &ast::NameRef, | 249 | name_ref: &ast::NameRef, |
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 9dbd2ebc4..562e92252 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs | |||
@@ -142,19 +142,19 @@ pub(crate) fn reparser( | |||
142 | ) -> Option<fn(&mut Parser)> { | 142 | ) -> Option<fn(&mut Parser)> { |
143 | let res = match node { | 143 | let res = match node { |
144 | BLOCK_EXPR => expressions::block_expr, | 144 | BLOCK_EXPR => expressions::block_expr, |
145 | RECORD_FIELD_LIST => items::record_field_def_list, | 145 | RECORD_FIELD_LIST => items::record_field_list, |
146 | RECORD_EXPR_FIELD_LIST => items::record_field_list, | 146 | RECORD_EXPR_FIELD_LIST => items::record_expr_field_list, |
147 | VARIANT_LIST => items::enum_variant_list, | 147 | VARIANT_LIST => items::variant_list, |
148 | MATCH_ARM_LIST => items::match_arm_list, | 148 | MATCH_ARM_LIST => items::match_arm_list, |
149 | USE_TREE_LIST => items::use_tree_list, | 149 | USE_TREE_LIST => items::use_tree_list, |
150 | EXTERN_ITEM_LIST => items::extern_item_list, | 150 | EXTERN_ITEM_LIST => items::extern_item_list, |
151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, | 151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, |
152 | ASSOC_ITEM_LIST => match parent? { | 152 | ASSOC_ITEM_LIST => match parent? { |
153 | IMPL => items::impl_item_list, | 153 | IMPL => items::assoc_item_list, |
154 | TRAIT => items::trait_item_list, | 154 | TRAIT => items::assoc_item_list, |
155 | _ => return None, | 155 | _ => return None, |
156 | }, | 156 | }, |
157 | ITEM_LIST => items::mod_item_list, | 157 | ITEM_LIST => items::item_list, |
158 | _ => return None, | 158 | _ => return None, |
159 | }; | 159 | }; |
160 | Some(res) | 160 | Some(res) |
@@ -217,7 +217,7 @@ fn opt_visibility(p: &mut Parser) -> bool { | |||
217 | true | 217 | true |
218 | } | 218 | } |
219 | 219 | ||
220 | fn opt_alias(p: &mut Parser) { | 220 | fn opt_rename(p: &mut Parser) { |
221 | if p.at(T![as]) { | 221 | if p.at(T![as]) { |
222 | let m = p.start(); | 222 | let m = p.start(); |
223 | p.bump(T![as]); | 223 | p.bump(T![as]); |
@@ -239,7 +239,7 @@ fn abi(p: &mut Parser) { | |||
239 | abi.complete(p, ABI); | 239 | abi.complete(p, ABI); |
240 | } | 240 | } |
241 | 241 | ||
242 | fn opt_fn_ret_type(p: &mut Parser) -> bool { | 242 | fn opt_ret_type(p: &mut Parser) -> bool { |
243 | if p.at(T![->]) { | 243 | if p.at(T![->]) { |
244 | let m = p.start(); | 244 | let m = p.start(); |
245 | p.bump(T![->]); | 245 | p.bump(T![->]); |
diff --git a/crates/parser/src/grammar/attributes.rs b/crates/parser/src/grammar/attributes.rs index f3158ade3..dab0f62c3 100644 --- a/crates/parser/src/grammar/attributes.rs +++ b/crates/parser/src/grammar/attributes.rs | |||
@@ -2,19 +2,19 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn inner_attributes(p: &mut Parser) { | 5 | pub(super) fn inner_attrs(p: &mut Parser) { |
6 | while p.at(T![#]) && p.nth(1) == T![!] { | 6 | while p.at(T![#]) && p.nth(1) == T![!] { |
7 | attribute(p, true) | 7 | attr(p, true) |
8 | } | 8 | } |
9 | } | 9 | } |
10 | 10 | ||
11 | pub(super) fn outer_attributes(p: &mut Parser) { | 11 | pub(super) fn outer_attrs(p: &mut Parser) { |
12 | while p.at(T![#]) { | 12 | while p.at(T![#]) { |
13 | attribute(p, false) | 13 | attr(p, false) |
14 | } | 14 | } |
15 | } | 15 | } |
16 | 16 | ||
17 | fn attribute(p: &mut Parser, inner: bool) { | 17 | fn attr(p: &mut Parser, inner: bool) { |
18 | let attr = p.start(); | 18 | let attr = p.start(); |
19 | assert!(p.at(T![#])); | 19 | assert!(p.at(T![#])); |
20 | p.bump(T![#]); | 20 | p.bump(T![#]); |
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 3291e3f14..e72929f8c 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs | |||
@@ -22,7 +22,7 @@ pub(super) fn expr(p: &mut Parser) -> (Option<CompletedMarker>, BlockLike) { | |||
22 | pub(super) fn expr_with_attrs(p: &mut Parser) -> bool { | 22 | pub(super) fn expr_with_attrs(p: &mut Parser) -> bool { |
23 | let m = p.start(); | 23 | let m = p.start(); |
24 | let has_attrs = p.at(T![#]); | 24 | let has_attrs = p.at(T![#]); |
25 | attributes::outer_attributes(p); | 25 | attributes::outer_attrs(p); |
26 | 26 | ||
27 | let (cm, _block_like) = expr(p); | 27 | let (cm, _block_like) = expr(p); |
28 | let success = cm.is_some(); | 28 | let success = cm.is_some(); |
@@ -64,7 +64,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) { | |||
64 | // #[D] return (); | 64 | // #[D] return (); |
65 | // } | 65 | // } |
66 | let has_attrs = p.at(T![#]); | 66 | let has_attrs = p.at(T![#]); |
67 | attributes::outer_attributes(p); | 67 | attributes::outer_attrs(p); |
68 | 68 | ||
69 | if p.at(T![let]) { | 69 | if p.at(T![let]) { |
70 | let_stmt(p, m, with_semi); | 70 | let_stmt(p, m, with_semi); |
@@ -175,7 +175,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) { | |||
175 | 175 | ||
176 | pub(super) fn expr_block_contents(p: &mut Parser) { | 176 | pub(super) fn expr_block_contents(p: &mut Parser) { |
177 | // This is checked by a validator | 177 | // This is checked by a validator |
178 | attributes::inner_attributes(p); | 178 | attributes::inner_attrs(p); |
179 | 179 | ||
180 | while !p.at(EOF) && !p.at(T!['}']) { | 180 | while !p.at(EOF) && !p.at(T!['}']) { |
181 | // test nocontentexpr | 181 | // test nocontentexpr |
@@ -489,7 +489,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
489 | let m = lhs.precede(p); | 489 | let m = lhs.precede(p); |
490 | p.bump_any(); | 490 | p.bump_any(); |
491 | name_ref(p); | 491 | name_ref(p); |
492 | type_args::opt_type_arg_list(p, true); | 492 | type_args::opt_generic_arg_list(p, true); |
493 | if p.at(T!['(']) { | 493 | if p.at(T!['(']) { |
494 | arg_list(p); | 494 | arg_list(p); |
495 | } | 495 | } |
@@ -585,7 +585,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { | |||
585 | paths::expr_path(p); | 585 | paths::expr_path(p); |
586 | match p.current() { | 586 | match p.current() { |
587 | T!['{'] if !r.forbid_structs => { | 587 | T!['{'] if !r.forbid_structs => { |
588 | record_field_list(p); | 588 | record_expr_field_list(p); |
589 | (m.complete(p, RECORD_EXPR), BlockLike::NotBlock) | 589 | (m.complete(p, RECORD_EXPR), BlockLike::NotBlock) |
590 | } | 590 | } |
591 | T![!] if !p.at(T![!=]) => { | 591 | T![!] if !p.at(T![!=]) => { |
@@ -603,7 +603,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { | |||
603 | // S { x, y: 32, ..Default::default() }; | 603 | // S { x, y: 32, ..Default::default() }; |
604 | // TupleStruct { 0: 1 }; | 604 | // TupleStruct { 0: 1 }; |
605 | // } | 605 | // } |
606 | pub(crate) fn record_field_list(p: &mut Parser) { | 606 | pub(crate) fn record_expr_field_list(p: &mut Parser) { |
607 | assert!(p.at(T!['{'])); | 607 | assert!(p.at(T!['{'])); |
608 | let m = p.start(); | 608 | let m = p.start(); |
609 | p.bump(T!['{']); | 609 | p.bump(T!['{']); |
@@ -613,7 +613,7 @@ pub(crate) fn record_field_list(p: &mut Parser) { | |||
613 | // fn main() { | 613 | // fn main() { |
614 | // S { #[cfg(test)] field: 1 } | 614 | // S { #[cfg(test)] field: 1 } |
615 | // } | 615 | // } |
616 | attributes::outer_attributes(p); | 616 | attributes::outer_attrs(p); |
617 | 617 | ||
618 | match p.current() { | 618 | match p.current() { |
619 | IDENT | INT_NUMBER => { | 619 | IDENT | INT_NUMBER => { |
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 0b01d3bc6..ba6dd2fbc 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs | |||
@@ -75,9 +75,9 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar | |||
75 | T!['('] => tuple_expr(p), | 75 | T!['('] => tuple_expr(p), |
76 | T!['['] => array_expr(p), | 76 | T!['['] => array_expr(p), |
77 | L_DOLLAR => meta_var_expr(p), | 77 | L_DOLLAR => meta_var_expr(p), |
78 | T![|] => lambda_expr(p), | 78 | T![|] => closure_expr(p), |
79 | T![move] if la == T![|] => lambda_expr(p), | 79 | T![move] if la == T![|] => closure_expr(p), |
80 | T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => lambda_expr(p), | 80 | T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p), |
81 | T![if] => if_expr(p), | 81 | T![if] => if_expr(p), |
82 | 82 | ||
83 | T![loop] => loop_expr(p, None), | 83 | T![loop] => loop_expr(p, None), |
@@ -228,7 +228,7 @@ fn array_expr(p: &mut Parser) -> CompletedMarker { | |||
228 | // move || {}; | 228 | // move || {}; |
229 | // async move || {}; | 229 | // async move || {}; |
230 | // } | 230 | // } |
231 | fn lambda_expr(p: &mut Parser) -> CompletedMarker { | 231 | fn closure_expr(p: &mut Parser) -> CompletedMarker { |
232 | assert!( | 232 | assert!( |
233 | p.at(T![|]) | 233 | p.at(T![|]) |
234 | || (p.at(T![move]) && p.nth(1) == T![|]) | 234 | || (p.at(T![move]) && p.nth(1) == T![|]) |
@@ -239,7 +239,7 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker { | |||
239 | p.eat(T![async]); | 239 | p.eat(T![async]); |
240 | p.eat(T![move]); | 240 | p.eat(T![move]); |
241 | params::param_list_closure(p); | 241 | params::param_list_closure(p); |
242 | if opt_fn_ret_type(p) { | 242 | if opt_ret_type(p) { |
243 | // test lambda_ret_block | 243 | // test lambda_ret_block |
244 | // fn main() { || -> i32 { 92 }(); } | 244 | // fn main() { || -> i32 { 92 }(); } |
245 | block_expr(p); | 245 | block_expr(p); |
@@ -265,7 +265,7 @@ fn if_expr(p: &mut Parser) -> CompletedMarker { | |||
265 | assert!(p.at(T![if])); | 265 | assert!(p.at(T![if])); |
266 | let m = p.start(); | 266 | let m = p.start(); |
267 | p.bump(T![if]); | 267 | p.bump(T![if]); |
268 | cond(p); | 268 | condition(p); |
269 | block_expr(p); | 269 | block_expr(p); |
270 | if p.at(T![else]) { | 270 | if p.at(T![else]) { |
271 | p.bump(T![else]); | 271 | p.bump(T![else]); |
@@ -314,7 +314,7 @@ fn while_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | |||
314 | assert!(p.at(T![while])); | 314 | assert!(p.at(T![while])); |
315 | let m = m.unwrap_or_else(|| p.start()); | 315 | let m = m.unwrap_or_else(|| p.start()); |
316 | p.bump(T![while]); | 316 | p.bump(T![while]); |
317 | cond(p); | 317 | condition(p); |
318 | block_expr(p); | 318 | block_expr(p); |
319 | m.complete(p, WHILE_EXPR) | 319 | m.complete(p, WHILE_EXPR) |
320 | } | 320 | } |
@@ -342,7 +342,7 @@ fn for_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | |||
342 | // while let Some(_) | Some(_) = None {} | 342 | // while let Some(_) | Some(_) = None {} |
343 | // while let | Some(_) = None {} | 343 | // while let | Some(_) = None {} |
344 | // } | 344 | // } |
345 | fn cond(p: &mut Parser) { | 345 | fn condition(p: &mut Parser) { |
346 | let m = p.start(); | 346 | let m = p.start(); |
347 | if p.eat(T![let]) { | 347 | if p.eat(T![let]) { |
348 | patterns::pattern_top(p); | 348 | patterns::pattern_top(p); |
@@ -386,7 +386,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) { | |||
386 | // _ => (), | 386 | // _ => (), |
387 | // } | 387 | // } |
388 | // } | 388 | // } |
389 | attributes::inner_attributes(p); | 389 | attributes::inner_attrs(p); |
390 | 390 | ||
391 | while !p.at(EOF) && !p.at(T!['}']) { | 391 | while !p.at(EOF) && !p.at(T!['}']) { |
392 | if p.at(T!['{']) { | 392 | if p.at(T!['{']) { |
@@ -437,7 +437,7 @@ fn match_arm(p: &mut Parser) -> BlockLike { | |||
437 | // _ => (), | 437 | // _ => (), |
438 | // } | 438 | // } |
439 | // } | 439 | // } |
440 | attributes::outer_attributes(p); | 440 | attributes::outer_attrs(p); |
441 | 441 | ||
442 | patterns::pattern_top_r(p, TokenSet::EMPTY); | 442 | patterns::pattern_top_r(p, TokenSet::EMPTY); |
443 | if p.at(T![if]) { | 443 | if p.at(T![if]) { |
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index d091b0fbb..b2f7cc21f 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs | |||
@@ -6,9 +6,9 @@ mod traits; | |||
6 | mod use_item; | 6 | mod use_item; |
7 | 7 | ||
8 | pub(crate) use self::{ | 8 | pub(crate) use self::{ |
9 | adt::{enum_variant_list, record_field_def_list}, | 9 | adt::{record_field_list, variant_list}, |
10 | expressions::{match_arm_list, record_field_list}, | 10 | expressions::{match_arm_list, record_expr_field_list}, |
11 | traits::{impl_item_list, trait_item_list}, | 11 | traits::assoc_item_list, |
12 | use_item::use_tree_list, | 12 | use_item::use_tree_list, |
13 | }; | 13 | }; |
14 | use super::*; | 14 | use super::*; |
@@ -20,7 +20,7 @@ use super::*; | |||
20 | // super::baz! {} | 20 | // super::baz! {} |
21 | // struct S; | 21 | // struct S; |
22 | pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { | 22 | pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { |
23 | attributes::inner_attributes(p); | 23 | attributes::inner_attrs(p); |
24 | while !(stop_on_r_curly && p.at(T!['}']) || p.at(EOF)) { | 24 | while !(stop_on_r_curly && p.at(T!['}']) || p.at(EOF)) { |
25 | item_or_macro(p, stop_on_r_curly) | 25 | item_or_macro(p, stop_on_r_curly) |
26 | } | 26 | } |
@@ -33,7 +33,7 @@ pub(super) const ITEM_RECOVERY_SET: TokenSet = token_set![ | |||
33 | 33 | ||
34 | pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) { | 34 | pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) { |
35 | let m = p.start(); | 35 | let m = p.start(); |
36 | attributes::outer_attributes(p); | 36 | attributes::outer_attrs(p); |
37 | let m = match maybe_item(p, m) { | 37 | let m = match maybe_item(p, m) { |
38 | Ok(()) => { | 38 | Ok(()) => { |
39 | if p.at(T![;]) { | 39 | if p.at(T![;]) { |
@@ -144,30 +144,30 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
144 | // test fn | 144 | // test fn |
145 | // fn foo() {} | 145 | // fn foo() {} |
146 | T![fn] => { | 146 | T![fn] => { |
147 | fn_def(p); | 147 | fn_(p); |
148 | m.complete(p, FN); | 148 | m.complete(p, FN); |
149 | } | 149 | } |
150 | 150 | ||
151 | // test trait | 151 | // test trait |
152 | // trait T {} | 152 | // trait T {} |
153 | T![trait] => { | 153 | T![trait] => { |
154 | traits::trait_def(p); | 154 | traits::trait_(p); |
155 | m.complete(p, TRAIT); | 155 | m.complete(p, TRAIT); |
156 | } | 156 | } |
157 | 157 | ||
158 | T![const] => { | 158 | T![const] => { |
159 | consts::const_def(p, m); | 159 | consts::konst(p, m); |
160 | } | 160 | } |
161 | 161 | ||
162 | // test impl | 162 | // test impl |
163 | // impl T for S {} | 163 | // impl T for S {} |
164 | T![impl] => { | 164 | T![impl] => { |
165 | traits::impl_def(p); | 165 | traits::impl_(p); |
166 | m.complete(p, IMPL); | 166 | m.complete(p, IMPL); |
167 | } | 167 | } |
168 | 168 | ||
169 | T![type] => { | 169 | T![type] => { |
170 | type_def(p, m); | 170 | type_alias(p, m); |
171 | } | 171 | } |
172 | _ => { | 172 | _ => { |
173 | if !has_visibility && !has_mods { | 173 | if !has_visibility && !has_mods { |
@@ -190,9 +190,9 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
190 | match p.current() { | 190 | match p.current() { |
191 | // test extern_crate | 191 | // test extern_crate |
192 | // extern crate foo; | 192 | // extern crate foo; |
193 | T![extern] if la == T![crate] => extern_crate_item(p, m), | 193 | T![extern] if la == T![crate] => extern_crate(p, m), |
194 | T![type] => { | 194 | T![type] => { |
195 | type_def(p, m); | 195 | type_alias(p, m); |
196 | } | 196 | } |
197 | T![mod] => mod_item(p, m), | 197 | T![mod] => mod_item(p, m), |
198 | T![struct] => { | 198 | T![struct] => { |
@@ -205,7 +205,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
205 | // a: i32, | 205 | // a: i32, |
206 | // b: f32, | 206 | // b: f32, |
207 | // } | 207 | // } |
208 | adt::struct_def(p, m); | 208 | adt::strukt(p, m); |
209 | } | 209 | } |
210 | // test pub_macro_def | 210 | // test pub_macro_def |
211 | // pub macro m($:ident) {} | 211 | // pub macro m($:ident) {} |
@@ -219,12 +219,12 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
219 | // a: i32, | 219 | // a: i32, |
220 | // b: f32, | 220 | // b: f32, |
221 | // } | 221 | // } |
222 | adt::union_def(p, m); | 222 | adt::union(p, m); |
223 | } | 223 | } |
224 | T![enum] => adt::enum_def(p, m), | 224 | T![enum] => adt::enum_(p, m), |
225 | T![use] => use_item::use_item(p, m), | 225 | T![use] => use_item::use_(p, m), |
226 | T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::const_def(p, m), | 226 | T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::konst(p, m), |
227 | T![static] => consts::static_def(p, m), | 227 | T![static] => consts::static_(p, m), |
228 | // test extern_block | 228 | // test extern_block |
229 | // extern {} | 229 | // extern {} |
230 | T![extern] | 230 | T![extern] |
@@ -239,7 +239,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
239 | Ok(()) | 239 | Ok(()) |
240 | } | 240 | } |
241 | 241 | ||
242 | fn extern_crate_item(p: &mut Parser, m: Marker) { | 242 | fn extern_crate(p: &mut Parser, m: Marker) { |
243 | assert!(p.at(T![extern])); | 243 | assert!(p.at(T![extern])); |
244 | p.bump(T![extern]); | 244 | p.bump(T![extern]); |
245 | assert!(p.at(T![crate])); | 245 | assert!(p.at(T![crate])); |
@@ -251,7 +251,7 @@ fn extern_crate_item(p: &mut Parser, m: Marker) { | |||
251 | name_ref(p); | 251 | name_ref(p); |
252 | } | 252 | } |
253 | 253 | ||
254 | opt_alias(p); | 254 | opt_rename(p); |
255 | p.expect(T![;]); | 255 | p.expect(T![;]); |
256 | m.complete(p, EXTERN_CRATE); | 256 | m.complete(p, EXTERN_CRATE); |
257 | } | 257 | } |
@@ -265,14 +265,14 @@ pub(crate) fn extern_item_list(p: &mut Parser) { | |||
265 | m.complete(p, EXTERN_ITEM_LIST); | 265 | m.complete(p, EXTERN_ITEM_LIST); |
266 | } | 266 | } |
267 | 267 | ||
268 | fn fn_def(p: &mut Parser) { | 268 | fn fn_(p: &mut Parser) { |
269 | assert!(p.at(T![fn])); | 269 | assert!(p.at(T![fn])); |
270 | p.bump(T![fn]); | 270 | p.bump(T![fn]); |
271 | 271 | ||
272 | name_r(p, ITEM_RECOVERY_SET); | 272 | name_r(p, ITEM_RECOVERY_SET); |
273 | // test function_type_params | 273 | // test function_type_params |
274 | // fn foo<T: Clone + Copy>(){} | 274 | // fn foo<T: Clone + Copy>(){} |
275 | type_params::opt_type_param_list(p); | 275 | type_params::opt_generic_param_list(p); |
276 | 276 | ||
277 | if p.at(T!['(']) { | 277 | if p.at(T!['(']) { |
278 | params::param_list_fn_def(p); | 278 | params::param_list_fn_def(p); |
@@ -282,7 +282,7 @@ fn fn_def(p: &mut Parser) { | |||
282 | // test function_ret_type | 282 | // test function_ret_type |
283 | // fn foo() {} | 283 | // fn foo() {} |
284 | // fn bar() -> () {} | 284 | // fn bar() -> () {} |
285 | opt_fn_ret_type(p); | 285 | opt_ret_type(p); |
286 | 286 | ||
287 | // test function_where_clause | 287 | // test function_where_clause |
288 | // fn foo<T>() where T: Copy {} | 288 | // fn foo<T>() where T: Copy {} |
@@ -299,7 +299,7 @@ fn fn_def(p: &mut Parser) { | |||
299 | 299 | ||
300 | // test type_item | 300 | // test type_item |
301 | // type Foo = Bar; | 301 | // type Foo = Bar; |
302 | fn type_def(p: &mut Parser, m: Marker) { | 302 | fn type_alias(p: &mut Parser, m: Marker) { |
303 | assert!(p.at(T![type])); | 303 | assert!(p.at(T![type])); |
304 | p.bump(T![type]); | 304 | p.bump(T![type]); |
305 | 305 | ||
@@ -307,7 +307,7 @@ fn type_def(p: &mut Parser, m: Marker) { | |||
307 | 307 | ||
308 | // test type_item_type_params | 308 | // test type_item_type_params |
309 | // type Result<T> = (); | 309 | // type Result<T> = (); |
310 | type_params::opt_type_param_list(p); | 310 | type_params::opt_generic_param_list(p); |
311 | 311 | ||
312 | if p.at(T![:]) { | 312 | if p.at(T![:]) { |
313 | type_params::bounds(p); | 313 | type_params::bounds(p); |
@@ -329,14 +329,14 @@ pub(crate) fn mod_item(p: &mut Parser, m: Marker) { | |||
329 | 329 | ||
330 | name(p); | 330 | name(p); |
331 | if p.at(T!['{']) { | 331 | if p.at(T!['{']) { |
332 | mod_item_list(p); | 332 | item_list(p); |
333 | } else if !p.eat(T![;]) { | 333 | } else if !p.eat(T![;]) { |
334 | p.error("expected `;` or `{`"); | 334 | p.error("expected `;` or `{`"); |
335 | } | 335 | } |
336 | m.complete(p, MODULE); | 336 | m.complete(p, MODULE); |
337 | } | 337 | } |
338 | 338 | ||
339 | pub(crate) fn mod_item_list(p: &mut Parser) { | 339 | pub(crate) fn item_list(p: &mut Parser) { |
340 | assert!(p.at(T!['{'])); | 340 | assert!(p.at(T!['{'])); |
341 | let m = p.start(); | 341 | let m = p.start(); |
342 | p.bump(T!['{']); | 342 | p.bump(T!['{']); |
diff --git a/crates/parser/src/grammar/items/adt.rs b/crates/parser/src/grammar/items/adt.rs index addfb59d4..67c0c5697 100644 --- a/crates/parser/src/grammar/items/adt.rs +++ b/crates/parser/src/grammar/items/adt.rs | |||
@@ -2,13 +2,13 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn struct_def(p: &mut Parser, m: Marker) { | 5 | pub(super) fn strukt(p: &mut Parser, m: Marker) { |
6 | assert!(p.at(T![struct])); | 6 | assert!(p.at(T![struct])); |
7 | p.bump(T![struct]); | 7 | p.bump(T![struct]); |
8 | struct_or_union(p, m, T![struct], STRUCT); | 8 | struct_or_union(p, m, T![struct], STRUCT); |
9 | } | 9 | } |
10 | 10 | ||
11 | pub(super) fn union_def(p: &mut Parser, m: Marker) { | 11 | pub(super) fn union(p: &mut Parser, m: Marker) { |
12 | assert!(p.at_contextual_kw("union")); | 12 | assert!(p.at_contextual_kw("union")); |
13 | p.bump_remap(T![union]); | 13 | p.bump_remap(T![union]); |
14 | struct_or_union(p, m, T![union], UNION); | 14 | struct_or_union(p, m, T![union], UNION); |
@@ -16,7 +16,7 @@ pub(super) fn union_def(p: &mut Parser, m: Marker) { | |||
16 | 16 | ||
17 | fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { | 17 | fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { |
18 | name_r(p, ITEM_RECOVERY_SET); | 18 | name_r(p, ITEM_RECOVERY_SET); |
19 | type_params::opt_type_param_list(p); | 19 | type_params::opt_generic_param_list(p); |
20 | match p.current() { | 20 | match p.current() { |
21 | T![where] => { | 21 | T![where] => { |
22 | type_params::opt_where_clause(p); | 22 | type_params::opt_where_clause(p); |
@@ -24,7 +24,7 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { | |||
24 | T![;] => { | 24 | T![;] => { |
25 | p.bump(T![;]); | 25 | p.bump(T![;]); |
26 | } | 26 | } |
27 | T!['{'] => record_field_def_list(p), | 27 | T!['{'] => record_field_list(p), |
28 | _ => { | 28 | _ => { |
29 | //FIXME: special case `(` error message | 29 | //FIXME: special case `(` error message |
30 | p.error("expected `;` or `{`"); | 30 | p.error("expected `;` or `{`"); |
@@ -34,9 +34,9 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { | |||
34 | T![;] if kw == T![struct] => { | 34 | T![;] if kw == T![struct] => { |
35 | p.bump(T![;]); | 35 | p.bump(T![;]); |
36 | } | 36 | } |
37 | T!['{'] => record_field_def_list(p), | 37 | T!['{'] => record_field_list(p), |
38 | T!['('] if kw == T![struct] => { | 38 | T!['('] if kw == T![struct] => { |
39 | tuple_field_def_list(p); | 39 | tuple_field_list(p); |
40 | // test tuple_struct_where | 40 | // test tuple_struct_where |
41 | // struct Test<T>(T) where T: Clone; | 41 | // struct Test<T>(T) where T: Clone; |
42 | // struct Test<T>(T); | 42 | // struct Test<T>(T); |
@@ -53,21 +53,21 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { | |||
53 | m.complete(p, def); | 53 | m.complete(p, def); |
54 | } | 54 | } |
55 | 55 | ||
56 | pub(super) fn enum_def(p: &mut Parser, m: Marker) { | 56 | pub(super) fn enum_(p: &mut Parser, m: Marker) { |
57 | assert!(p.at(T![enum])); | 57 | assert!(p.at(T![enum])); |
58 | p.bump(T![enum]); | 58 | p.bump(T![enum]); |
59 | name_r(p, ITEM_RECOVERY_SET); | 59 | name_r(p, ITEM_RECOVERY_SET); |
60 | type_params::opt_type_param_list(p); | 60 | type_params::opt_generic_param_list(p); |
61 | type_params::opt_where_clause(p); | 61 | type_params::opt_where_clause(p); |
62 | if p.at(T!['{']) { | 62 | if p.at(T!['{']) { |
63 | enum_variant_list(p); | 63 | variant_list(p); |
64 | } else { | 64 | } else { |
65 | p.error("expected `{`") | 65 | p.error("expected `{`") |
66 | } | 66 | } |
67 | m.complete(p, ENUM); | 67 | m.complete(p, ENUM); |
68 | } | 68 | } |
69 | 69 | ||
70 | pub(crate) fn enum_variant_list(p: &mut Parser) { | 70 | pub(crate) fn variant_list(p: &mut Parser) { |
71 | assert!(p.at(T!['{'])); | 71 | assert!(p.at(T!['{'])); |
72 | let m = p.start(); | 72 | let m = p.start(); |
73 | p.bump(T!['{']); | 73 | p.bump(T!['{']); |
@@ -77,12 +77,12 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { | |||
77 | continue; | 77 | continue; |
78 | } | 78 | } |
79 | let var = p.start(); | 79 | let var = p.start(); |
80 | attributes::outer_attributes(p); | 80 | attributes::outer_attrs(p); |
81 | if p.at(IDENT) { | 81 | if p.at(IDENT) { |
82 | name(p); | 82 | name(p); |
83 | match p.current() { | 83 | match p.current() { |
84 | T!['{'] => record_field_def_list(p), | 84 | T!['{'] => record_field_list(p), |
85 | T!['('] => tuple_field_def_list(p), | 85 | T!['('] => tuple_field_list(p), |
86 | _ => (), | 86 | _ => (), |
87 | } | 87 | } |
88 | 88 | ||
@@ -104,7 +104,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { | |||
104 | m.complete(p, VARIANT_LIST); | 104 | m.complete(p, VARIANT_LIST); |
105 | } | 105 | } |
106 | 106 | ||
107 | pub(crate) fn record_field_def_list(p: &mut Parser) { | 107 | pub(crate) fn record_field_list(p: &mut Parser) { |
108 | assert!(p.at(T!['{'])); | 108 | assert!(p.at(T!['{'])); |
109 | let m = p.start(); | 109 | let m = p.start(); |
110 | p.bump(T!['{']); | 110 | p.bump(T!['{']); |
@@ -128,7 +128,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { | |||
128 | // #[serde(with = "url_serde")] | 128 | // #[serde(with = "url_serde")] |
129 | // pub uri: Uri, | 129 | // pub uri: Uri, |
130 | // } | 130 | // } |
131 | attributes::outer_attributes(p); | 131 | attributes::outer_attrs(p); |
132 | opt_visibility(p); | 132 | opt_visibility(p); |
133 | if p.at(IDENT) { | 133 | if p.at(IDENT) { |
134 | name(p); | 134 | name(p); |
@@ -142,7 +142,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { | |||
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | fn tuple_field_def_list(p: &mut Parser) { | 145 | fn tuple_field_list(p: &mut Parser) { |
146 | assert!(p.at(T!['('])); | 146 | assert!(p.at(T!['('])); |
147 | let m = p.start(); | 147 | let m = p.start(); |
148 | if !p.expect(T!['(']) { | 148 | if !p.expect(T!['(']) { |
@@ -159,7 +159,7 @@ fn tuple_field_def_list(p: &mut Parser) { | |||
159 | // enum S { | 159 | // enum S { |
160 | // Uri(#[serde(with = "url_serde")] Uri), | 160 | // Uri(#[serde(with = "url_serde")] Uri), |
161 | // } | 161 | // } |
162 | attributes::outer_attributes(p); | 162 | attributes::outer_attrs(p); |
163 | opt_visibility(p); | 163 | opt_visibility(p); |
164 | if !p.at_ts(types::TYPE_FIRST) { | 164 | if !p.at_ts(types::TYPE_FIRST) { |
165 | p.error("expected a type"); | 165 | p.error("expected a type"); |
diff --git a/crates/parser/src/grammar/items/consts.rs b/crates/parser/src/grammar/items/consts.rs index 35ad766dc..eb7d1f828 100644 --- a/crates/parser/src/grammar/items/consts.rs +++ b/crates/parser/src/grammar/items/consts.rs | |||
@@ -2,11 +2,11 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn static_def(p: &mut Parser, m: Marker) { | 5 | pub(super) fn static_(p: &mut Parser, m: Marker) { |
6 | const_or_static(p, m, T![static], STATIC) | 6 | const_or_static(p, m, T![static], STATIC) |
7 | } | 7 | } |
8 | 8 | ||
9 | pub(super) fn const_def(p: &mut Parser, m: Marker) { | 9 | pub(super) fn konst(p: &mut Parser, m: Marker) { |
10 | const_or_static(p, m, T![const], CONST) | 10 | const_or_static(p, m, T![const], CONST) |
11 | } | 11 | } |
12 | 12 | ||
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index 751ce65f2..8394020da 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs | |||
@@ -5,11 +5,11 @@ use super::*; | |||
5 | // test trait_item | 5 | // test trait_item |
6 | // trait T<U>: Hash + Clone where U: Copy {} | 6 | // trait T<U>: Hash + Clone where U: Copy {} |
7 | // trait X<U: Debug + Display>: Hash + Clone where U: Copy {} | 7 | // trait X<U: Debug + Display>: Hash + Clone where U: Copy {} |
8 | pub(super) fn trait_def(p: &mut Parser) { | 8 | pub(super) fn trait_(p: &mut Parser) { |
9 | assert!(p.at(T![trait])); | 9 | assert!(p.at(T![trait])); |
10 | p.bump(T![trait]); | 10 | p.bump(T![trait]); |
11 | name_r(p, ITEM_RECOVERY_SET); | 11 | name_r(p, ITEM_RECOVERY_SET); |
12 | type_params::opt_type_param_list(p); | 12 | type_params::opt_generic_param_list(p); |
13 | // test trait_alias | 13 | // test trait_alias |
14 | // trait Z<U> = T<U>; | 14 | // trait Z<U> = T<U>; |
15 | // trait Z<U> = T<U> where U: Copy; | 15 | // trait Z<U> = T<U> where U: Copy; |
@@ -25,41 +25,19 @@ pub(super) fn trait_def(p: &mut Parser) { | |||
25 | } | 25 | } |
26 | type_params::opt_where_clause(p); | 26 | type_params::opt_where_clause(p); |
27 | if p.at(T!['{']) { | 27 | if p.at(T!['{']) { |
28 | trait_item_list(p); | 28 | assoc_item_list(p); |
29 | } else { | 29 | } else { |
30 | p.error("expected `{`"); | 30 | p.error("expected `{`"); |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | // test trait_item_list | ||
35 | // impl F { | ||
36 | // type A: Clone; | ||
37 | // const B: i32; | ||
38 | // fn foo() {} | ||
39 | // fn bar(&self); | ||
40 | // } | ||
41 | pub(crate) fn trait_item_list(p: &mut Parser) { | ||
42 | assert!(p.at(T!['{'])); | ||
43 | let m = p.start(); | ||
44 | p.bump(T!['{']); | ||
45 | while !p.at(EOF) && !p.at(T!['}']) { | ||
46 | if p.at(T!['{']) { | ||
47 | error_block(p, "expected an item"); | ||
48 | continue; | ||
49 | } | ||
50 | item_or_macro(p, true); | ||
51 | } | ||
52 | p.expect(T!['}']); | ||
53 | m.complete(p, ASSOC_ITEM_LIST); | ||
54 | } | ||
55 | |||
56 | // test impl_def | 34 | // test impl_def |
57 | // impl Foo {} | 35 | // impl Foo {} |
58 | pub(super) fn impl_def(p: &mut Parser) { | 36 | pub(super) fn impl_(p: &mut Parser) { |
59 | assert!(p.at(T![impl])); | 37 | assert!(p.at(T![impl])); |
60 | p.bump(T![impl]); | 38 | p.bump(T![impl]); |
61 | if choose_type_params_over_qpath(p) { | 39 | if choose_type_params_over_qpath(p) { |
62 | type_params::opt_type_param_list(p); | 40 | type_params::opt_generic_param_list(p); |
63 | } | 41 | } |
64 | 42 | ||
65 | // FIXME: never type | 43 | // FIXME: never type |
@@ -74,7 +52,7 @@ pub(super) fn impl_def(p: &mut Parser) { | |||
74 | } | 52 | } |
75 | type_params::opt_where_clause(p); | 53 | type_params::opt_where_clause(p); |
76 | if p.at(T!['{']) { | 54 | if p.at(T!['{']) { |
77 | impl_item_list(p); | 55 | assoc_item_list(p); |
78 | } else { | 56 | } else { |
79 | p.error("expected `{`"); | 57 | p.error("expected `{`"); |
80 | } | 58 | } |
@@ -87,7 +65,7 @@ pub(super) fn impl_def(p: &mut Parser) { | |||
87 | // fn foo() {} | 65 | // fn foo() {} |
88 | // fn bar(&self) {} | 66 | // fn bar(&self) {} |
89 | // } | 67 | // } |
90 | pub(crate) fn impl_item_list(p: &mut Parser) { | 68 | pub(crate) fn assoc_item_list(p: &mut Parser) { |
91 | assert!(p.at(T!['{'])); | 69 | assert!(p.at(T!['{'])); |
92 | let m = p.start(); | 70 | let m = p.start(); |
93 | p.bump(T!['{']); | 71 | p.bump(T!['{']); |
@@ -97,7 +75,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) { | |||
97 | // //! This is a doc comment | 75 | // //! This is a doc comment |
98 | // #![doc("This is also a doc comment")] | 76 | // #![doc("This is also a doc comment")] |
99 | // } | 77 | // } |
100 | attributes::inner_attributes(p); | 78 | attributes::inner_attrs(p); |
101 | 79 | ||
102 | while !p.at(EOF) && !p.at(T!['}']) { | 80 | while !p.at(EOF) && !p.at(T!['}']) { |
103 | if p.at(T!['{']) { | 81 | if p.at(T!['{']) { |
diff --git a/crates/parser/src/grammar/items/use_item.rs b/crates/parser/src/grammar/items/use_item.rs index 8e836a77e..20e6a13cf 100644 --- a/crates/parser/src/grammar/items/use_item.rs +++ b/crates/parser/src/grammar/items/use_item.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn use_item(p: &mut Parser, m: Marker) { | 5 | pub(super) fn use_(p: &mut Parser, m: Marker) { |
6 | assert!(p.at(T![use])); | 6 | assert!(p.at(T![use])); |
7 | p.bump(T![use]); | 7 | p.bump(T![use]); |
8 | use_tree(p, true); | 8 | use_tree(p, true); |
@@ -80,7 +80,7 @@ fn use_tree(p: &mut Parser, top_level: bool) { | |||
80 | // running::out::of::synonyms::for_::different::* | 80 | // running::out::of::synonyms::for_::different::* |
81 | // }; | 81 | // }; |
82 | // use Trait as _; | 82 | // use Trait as _; |
83 | opt_alias(p); | 83 | opt_rename(p); |
84 | } | 84 | } |
85 | T![:] if p.at(T![::]) => { | 85 | T![:] if p.at(T![::]) => { |
86 | p.bump(T![::]); | 86 | p.bump(T![::]); |
diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs index f0da173cc..a665ffc13 100644 --- a/crates/parser/src/grammar/params.rs +++ b/crates/parser/src/grammar/params.rs | |||
@@ -47,20 +47,20 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
47 | if let FnDef = flavor { | 47 | if let FnDef = flavor { |
48 | // test self_param_outer_attr | 48 | // test self_param_outer_attr |
49 | // fn f(#[must_use] self) {} | 49 | // fn f(#[must_use] self) {} |
50 | attributes::outer_attributes(p); | 50 | attributes::outer_attrs(p); |
51 | opt_self_param(p); | 51 | opt_self_param(p); |
52 | } | 52 | } |
53 | 53 | ||
54 | while !p.at(EOF) && !p.at(ket) { | 54 | while !p.at(EOF) && !p.at(ket) { |
55 | // test param_outer_arg | 55 | // test param_outer_arg |
56 | // fn f(#[attr1] pat: Type) {} | 56 | // fn f(#[attr1] pat: Type) {} |
57 | attributes::outer_attributes(p); | 57 | attributes::outer_attrs(p); |
58 | 58 | ||
59 | if !p.at_ts(VALUE_PARAMETER_FIRST) { | 59 | if !p.at_ts(PARAM_FIRST) { |
60 | p.error("expected value parameter"); | 60 | p.error("expected value parameter"); |
61 | break; | 61 | break; |
62 | } | 62 | } |
63 | let param = value_parameter(p, flavor); | 63 | let param = param(p, flavor); |
64 | if !p.at(ket) { | 64 | if !p.at(ket) { |
65 | p.expect(T![,]); | 65 | p.expect(T![,]); |
66 | } | 66 | } |
@@ -73,11 +73,11 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
73 | m.complete(p, PARAM_LIST); | 73 | m.complete(p, PARAM_LIST); |
74 | } | 74 | } |
75 | 75 | ||
76 | const VALUE_PARAMETER_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST); | 76 | const PARAM_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST); |
77 | 77 | ||
78 | struct Variadic(bool); | 78 | struct Variadic(bool); |
79 | 79 | ||
80 | fn value_parameter(p: &mut Parser, flavor: Flavor) -> Variadic { | 80 | fn param(p: &mut Parser, flavor: Flavor) -> Variadic { |
81 | let mut res = Variadic(false); | 81 | let mut res = Variadic(false); |
82 | let m = p.start(); | 82 | let m = p.start(); |
83 | match flavor { | 83 | match flavor { |
diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs index b503af1dc..52562afa4 100644 --- a/crates/parser/src/grammar/paths.rs +++ b/crates/parser/src/grammar/paths.rs | |||
@@ -105,11 +105,11 @@ fn opt_path_type_args(p: &mut Parser, mode: Mode) { | |||
105 | // type F = Box<Fn(i32) -> ()>; | 105 | // type F = Box<Fn(i32) -> ()>; |
106 | if p.at(T!['(']) { | 106 | if p.at(T!['(']) { |
107 | params::param_list_fn_trait(p); | 107 | params::param_list_fn_trait(p); |
108 | opt_fn_ret_type(p); | 108 | opt_ret_type(p); |
109 | } else { | 109 | } else { |
110 | type_args::opt_type_arg_list(p, false) | 110 | type_args::opt_generic_arg_list(p, false) |
111 | } | 111 | } |
112 | } | 112 | } |
113 | Mode::Expr => type_args::opt_type_arg_list(p, true), | 113 | Mode::Expr => type_args::opt_generic_arg_list(p, true), |
114 | } | 114 | } |
115 | } | 115 | } |
diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs index 716bdc978..07b1d6dd5 100644 --- a/crates/parser/src/grammar/patterns.rs +++ b/crates/parser/src/grammar/patterns.rs | |||
@@ -79,13 +79,13 @@ const PAT_RECOVERY_SET: TokenSet = | |||
79 | fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { | 79 | fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { |
80 | let m = match p.nth(0) { | 80 | let m = match p.nth(0) { |
81 | T![box] => box_pat(p), | 81 | T![box] => box_pat(p), |
82 | T![ref] | T![mut] => bind_pat(p, true), | 82 | T![ref] | T![mut] => ident_pat(p, true), |
83 | IDENT => match p.nth(1) { | 83 | IDENT => match p.nth(1) { |
84 | // Checks the token after an IDENT to see if a pattern is a path (Struct { .. }) or macro | 84 | // Checks the token after an IDENT to see if a pattern is a path (Struct { .. }) or macro |
85 | // (T![x]). | 85 | // (T![x]). |
86 | T!['('] | T!['{'] | T![!] => path_or_macro_pat(p), | 86 | T!['('] | T!['{'] | T![!] => path_or_macro_pat(p), |
87 | T![:] if p.nth_at(1, T![::]) => path_or_macro_pat(p), | 87 | T![:] if p.nth_at(1, T![::]) => path_or_macro_pat(p), |
88 | _ => bind_pat(p, true), | 88 | _ => ident_pat(p, true), |
89 | }, | 89 | }, |
90 | 90 | ||
91 | // test type_path_in_pattern | 91 | // test type_path_in_pattern |
@@ -93,8 +93,8 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { | |||
93 | _ if paths::is_path_start(p) => path_or_macro_pat(p), | 93 | _ if paths::is_path_start(p) => path_or_macro_pat(p), |
94 | _ if is_literal_pat_start(p) => literal_pat(p), | 94 | _ if is_literal_pat_start(p) => literal_pat(p), |
95 | 95 | ||
96 | T![.] if p.at(T![..]) => dot_dot_pat(p), | 96 | T![.] if p.at(T![..]) => rest_pat(p), |
97 | T![_] => placeholder_pat(p), | 97 | T![_] => wildcard_pat(p), |
98 | T![&] => ref_pat(p), | 98 | T![&] => ref_pat(p), |
99 | T!['('] => tuple_pat(p), | 99 | T!['('] => tuple_pat(p), |
100 | T!['['] => slice_pat(p), | 100 | T!['['] => slice_pat(p), |
@@ -149,7 +149,7 @@ fn path_or_macro_pat(p: &mut Parser) -> CompletedMarker { | |||
149 | TUPLE_STRUCT_PAT | 149 | TUPLE_STRUCT_PAT |
150 | } | 150 | } |
151 | T!['{'] => { | 151 | T!['{'] => { |
152 | record_field_pat_list(p); | 152 | record_pat_field_list(p); |
153 | RECORD_PAT | 153 | RECORD_PAT |
154 | } | 154 | } |
155 | // test marco_pat | 155 | // test marco_pat |
@@ -186,7 +186,7 @@ fn tuple_pat_fields(p: &mut Parser) { | |||
186 | // let S { h: _, ..} = (); | 186 | // let S { h: _, ..} = (); |
187 | // let S { h: _, } = (); | 187 | // let S { h: _, } = (); |
188 | // } | 188 | // } |
189 | fn record_field_pat_list(p: &mut Parser) { | 189 | fn record_pat_field_list(p: &mut Parser) { |
190 | assert!(p.at(T!['{'])); | 190 | assert!(p.at(T!['{'])); |
191 | let m = p.start(); | 191 | let m = p.start(); |
192 | p.bump(T!['{']); | 192 | p.bump(T!['{']); |
@@ -214,7 +214,7 @@ fn record_field_pat_list(p: &mut Parser) { | |||
214 | box_pat(p); | 214 | box_pat(p); |
215 | } | 215 | } |
216 | _ => { | 216 | _ => { |
217 | bind_pat(p, false); | 217 | ident_pat(p, false); |
218 | } | 218 | } |
219 | } | 219 | } |
220 | m.complete(p, RECORD_PAT_FIELD); | 220 | m.complete(p, RECORD_PAT_FIELD); |
@@ -230,7 +230,7 @@ fn record_field_pat_list(p: &mut Parser) { | |||
230 | 230 | ||
231 | // test placeholder_pat | 231 | // test placeholder_pat |
232 | // fn main() { let _ = (); } | 232 | // fn main() { let _ = (); } |
233 | fn placeholder_pat(p: &mut Parser) -> CompletedMarker { | 233 | fn wildcard_pat(p: &mut Parser) -> CompletedMarker { |
234 | assert!(p.at(T![_])); | 234 | assert!(p.at(T![_])); |
235 | let m = p.start(); | 235 | let m = p.start(); |
236 | p.bump(T![_]); | 236 | p.bump(T![_]); |
@@ -263,7 +263,7 @@ fn placeholder_pat(p: &mut Parser) -> CompletedMarker { | |||
263 | // let [head, .., mid, tail @ ..] = (); | 263 | // let [head, .., mid, tail @ ..] = (); |
264 | // let [head, .., mid, .., cons] = (); | 264 | // let [head, .., mid, .., cons] = (); |
265 | // } | 265 | // } |
266 | fn dot_dot_pat(p: &mut Parser) -> CompletedMarker { | 266 | fn rest_pat(p: &mut Parser) -> CompletedMarker { |
267 | assert!(p.at(T![..])); | 267 | assert!(p.at(T![..])); |
268 | let m = p.start(); | 268 | let m = p.start(); |
269 | p.bump(T![..]); | 269 | p.bump(T![..]); |
@@ -353,7 +353,7 @@ fn pat_list(p: &mut Parser, ket: SyntaxKind) { | |||
353 | // let e @ _ = (); | 353 | // let e @ _ = (); |
354 | // let ref mut f @ g @ _ = (); | 354 | // let ref mut f @ g @ _ = (); |
355 | // } | 355 | // } |
356 | fn bind_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { | 356 | fn ident_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { |
357 | let m = p.start(); | 357 | let m = p.start(); |
358 | p.eat(T![ref]); | 358 | p.eat(T![ref]); |
359 | p.eat(T![mut]); | 359 | p.eat(T![mut]); |
diff --git a/crates/parser/src/grammar/type_args.rs b/crates/parser/src/grammar/type_args.rs index aef7cd6fb..f2d34a749 100644 --- a/crates/parser/src/grammar/type_args.rs +++ b/crates/parser/src/grammar/type_args.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { | 5 | pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) { |
6 | let m; | 6 | let m; |
7 | if p.at(T![::]) && p.nth(2) == T![<] { | 7 | if p.at(T![::]) && p.nth(2) == T![<] { |
8 | m = p.start(); | 8 | m = p.start(); |
@@ -16,7 +16,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | while !p.at(EOF) && !p.at(T![>]) { | 18 | while !p.at(EOF) && !p.at(T![>]) { |
19 | type_arg(p); | 19 | generic_arg(p); |
20 | if !p.at(T![>]) && !p.expect(T![,]) { | 20 | if !p.at(T![>]) && !p.expect(T![,]) { |
21 | break; | 21 | break; |
22 | } | 22 | } |
@@ -27,7 +27,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { | |||
27 | 27 | ||
28 | // test type_arg | 28 | // test type_arg |
29 | // type A = B<'static, i32, 1, { 2 }, Item=u64>; | 29 | // type A = B<'static, i32, 1, { 2 }, Item=u64>; |
30 | fn type_arg(p: &mut Parser) { | 30 | fn generic_arg(p: &mut Parser) { |
31 | let m = p.start(); | 31 | let m = p.start(); |
32 | match p.current() { | 32 | match p.current() { |
33 | LIFETIME => { | 33 | LIFETIME => { |
diff --git a/crates/parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs index 90dabb4c0..bc7d8d724 100644 --- a/crates/parser/src/grammar/type_params.rs +++ b/crates/parser/src/grammar/type_params.rs | |||
@@ -2,14 +2,14 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn opt_type_param_list(p: &mut Parser) { | 5 | pub(super) fn opt_generic_param_list(p: &mut Parser) { |
6 | if !p.at(T![<]) { | 6 | if !p.at(T![<]) { |
7 | return; | 7 | return; |
8 | } | 8 | } |
9 | type_param_list(p); | 9 | generic_param_list(p); |
10 | } | 10 | } |
11 | 11 | ||
12 | fn type_param_list(p: &mut Parser) { | 12 | fn generic_param_list(p: &mut Parser) { |
13 | assert!(p.at(T![<])); | 13 | assert!(p.at(T![<])); |
14 | let m = p.start(); | 14 | let m = p.start(); |
15 | p.bump(T![<]); | 15 | p.bump(T![<]); |
@@ -20,12 +20,12 @@ fn type_param_list(p: &mut Parser) { | |||
20 | // test generic_lifetime_type_attribute | 20 | // test generic_lifetime_type_attribute |
21 | // fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { | 21 | // fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { |
22 | // } | 22 | // } |
23 | attributes::outer_attributes(p); | 23 | attributes::outer_attrs(p); |
24 | 24 | ||
25 | match p.current() { | 25 | match p.current() { |
26 | LIFETIME => lifetime_param(p, m), | 26 | LIFETIME => lifetime_param(p, m), |
27 | IDENT => type_param(p, m), | 27 | IDENT => type_param(p, m), |
28 | CONST_KW => type_const_param(p, m), | 28 | CONST_KW => const_param(p, m), |
29 | _ => { | 29 | _ => { |
30 | m.abandon(p); | 30 | m.abandon(p); |
31 | p.err_and_bump("expected type parameter") | 31 | p.err_and_bump("expected type parameter") |
@@ -65,7 +65,7 @@ fn type_param(p: &mut Parser, m: Marker) { | |||
65 | 65 | ||
66 | // test const_param | 66 | // test const_param |
67 | // struct S<const N: u32>; | 67 | // struct S<const N: u32>; |
68 | fn type_const_param(p: &mut Parser, m: Marker) { | 68 | fn const_param(p: &mut Parser, m: Marker) { |
69 | assert!(p.at(CONST_KW)); | 69 | assert!(p.at(CONST_KW)); |
70 | p.bump(T![const]); | 70 | p.bump(T![const]); |
71 | name(p); | 71 | name(p); |
diff --git a/crates/parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs index 0aa173a52..c876545f4 100644 --- a/crates/parser/src/grammar/types.rs +++ b/crates/parser/src/grammar/types.rs | |||
@@ -32,11 +32,11 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) { | |||
32 | match p.current() { | 32 | match p.current() { |
33 | T!['('] => paren_or_tuple_type(p), | 33 | T!['('] => paren_or_tuple_type(p), |
34 | T![!] => never_type(p), | 34 | T![!] => never_type(p), |
35 | T![*] => pointer_type(p), | 35 | T![*] => ptr_type(p), |
36 | T!['['] => array_or_slice_type(p), | 36 | T!['['] => array_or_slice_type(p), |
37 | T![&] => reference_type(p), | 37 | T![&] => ref_type(p), |
38 | T![_] => placeholder_type(p), | 38 | T![_] => infer_type(p), |
39 | T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), | 39 | T![fn] | T![unsafe] | T![extern] => fn_ptr_type(p), |
40 | T![for] => for_type(p), | 40 | T![for] => for_type(p), |
41 | T![impl] => impl_trait_type(p), | 41 | T![impl] => impl_trait_type(p), |
42 | T![dyn] => dyn_trait_type(p), | 42 | T![dyn] => dyn_trait_type(p), |
@@ -96,7 +96,7 @@ fn never_type(p: &mut Parser) { | |||
96 | m.complete(p, NEVER_TYPE); | 96 | m.complete(p, NEVER_TYPE); |
97 | } | 97 | } |
98 | 98 | ||
99 | fn pointer_type(p: &mut Parser) { | 99 | fn ptr_type(p: &mut Parser) { |
100 | assert!(p.at(T![*])); | 100 | assert!(p.at(T![*])); |
101 | let m = p.start(); | 101 | let m = p.start(); |
102 | p.bump(T![*]); | 102 | p.bump(T![*]); |
@@ -156,7 +156,7 @@ fn array_or_slice_type(p: &mut Parser) { | |||
156 | // type A = &(); | 156 | // type A = &(); |
157 | // type B = &'static (); | 157 | // type B = &'static (); |
158 | // type C = &mut (); | 158 | // type C = &mut (); |
159 | fn reference_type(p: &mut Parser) { | 159 | fn ref_type(p: &mut Parser) { |
160 | assert!(p.at(T![&])); | 160 | assert!(p.at(T![&])); |
161 | let m = p.start(); | 161 | let m = p.start(); |
162 | p.bump(T![&]); | 162 | p.bump(T![&]); |
@@ -168,7 +168,7 @@ fn reference_type(p: &mut Parser) { | |||
168 | 168 | ||
169 | // test placeholder_type | 169 | // test placeholder_type |
170 | // type Placeholder = _; | 170 | // type Placeholder = _; |
171 | fn placeholder_type(p: &mut Parser) { | 171 | fn infer_type(p: &mut Parser) { |
172 | assert!(p.at(T![_])); | 172 | assert!(p.at(T![_])); |
173 | let m = p.start(); | 173 | let m = p.start(); |
174 | p.bump(T![_]); | 174 | p.bump(T![_]); |
@@ -180,7 +180,7 @@ fn placeholder_type(p: &mut Parser) { | |||
180 | // type B = unsafe fn(); | 180 | // type B = unsafe fn(); |
181 | // type C = unsafe extern "C" fn(); | 181 | // type C = unsafe extern "C" fn(); |
182 | // type D = extern "C" fn ( u8 , ... ) -> u8; | 182 | // type D = extern "C" fn ( u8 , ... ) -> u8; |
183 | fn fn_pointer_type(p: &mut Parser) { | 183 | fn fn_ptr_type(p: &mut Parser) { |
184 | let m = p.start(); | 184 | let m = p.start(); |
185 | p.eat(T![unsafe]); | 185 | p.eat(T![unsafe]); |
186 | if p.at(T![extern]) { | 186 | if p.at(T![extern]) { |
@@ -200,7 +200,7 @@ fn fn_pointer_type(p: &mut Parser) { | |||
200 | } | 200 | } |
201 | // test fn_pointer_type_with_ret | 201 | // test fn_pointer_type_with_ret |
202 | // type F = fn() -> (); | 202 | // type F = fn() -> (); |
203 | opt_fn_ret_type(p); | 203 | opt_ret_type(p); |
204 | m.complete(p, FN_PTR_TYPE); | 204 | m.complete(p, FN_PTR_TYPE); |
205 | } | 205 | } |
206 | 206 | ||
@@ -208,7 +208,7 @@ pub(super) fn for_binder(p: &mut Parser) { | |||
208 | assert!(p.at(T![for])); | 208 | assert!(p.at(T![for])); |
209 | p.bump(T![for]); | 209 | p.bump(T![for]); |
210 | if p.at(T![<]) { | 210 | if p.at(T![<]) { |
211 | type_params::opt_type_param_list(p); | 211 | type_params::opt_generic_param_list(p); |
212 | } else { | 212 | } else { |
213 | p.error("expected `<`"); | 213 | p.error("expected `<`"); |
214 | } | 214 | } |
diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml index cbe2c26e2..5ac18d63b 100644 --- a/crates/paths/Cargo.toml +++ b/crates/paths/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "paths" | 2 | name = "paths" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
4 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
5 | edition = "2018" | 6 | edition = "2018" |
6 | license = "MIT OR Apache-2.0" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
diff --git a/crates/proc_macro_api/Cargo.toml b/crates/proc_macro_api/Cargo.toml index c1abb5627..a3a4c1103 100644 --- a/crates/proc_macro_api/Cargo.toml +++ b/crates/proc_macro_api/Cargo.toml | |||
@@ -1,10 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | ||
3 | name = "proc_macro_api" | 2 | name = "proc_macro_api" |
4 | version = "0.1.0" | 3 | version = "0.0.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | publish = false | ||
7 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
8 | 7 | ||
9 | [lib] | 8 | [lib] |
10 | doctest = false | 9 | doctest = false |
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 749cf648c..c7c1eda0f 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -1,10 +1,10 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | ||
3 | name = "rust-analyzer" | 2 | name = "rust-analyzer" |
4 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
5 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
6 | autobins = false | 6 | autobins = false |
7 | license = "MIT OR Apache-2.0" | 7 | edition = "2018" |
8 | 8 | ||
9 | [lib] | 9 | [lib] |
10 | doctest = false | 10 | doctest = false |
@@ -30,12 +30,11 @@ serde_json = "1.0.48" | |||
30 | threadpool = "1.7.1" | 30 | threadpool = "1.7.1" |
31 | rayon = "1.3.1" | 31 | rayon = "1.3.1" |
32 | mimalloc = { version = "0.1.19", default-features = false, optional = true } | 32 | mimalloc = { version = "0.1.19", default-features = false, optional = true } |
33 | lsp-server = "0.3.3" | ||
33 | 34 | ||
34 | stdx = { path = "../stdx" } | 35 | stdx = { path = "../stdx" } |
35 | |||
36 | lsp-server = "0.3.3" | ||
37 | flycheck = { path = "../flycheck" } | 36 | flycheck = { path = "../flycheck" } |
38 | ra_ide = { path = "../ra_ide" } | 37 | ide = { path = "../ide" } |
39 | profile = { path = "../profile" } | 38 | profile = { path = "../profile" } |
40 | project_model = { path = "../project_model" } | 39 | project_model = { path = "../project_model" } |
41 | syntax = { path = "../syntax" } | 40 | syntax = { path = "../syntax" } |
diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index 5ba30dbad..3041915e1 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | //! See `CargoTargetSpec` | 1 | //! See `CargoTargetSpec` |
2 | 2 | ||
3 | use cfg::CfgExpr; | 3 | use cfg::CfgExpr; |
4 | use ide::{FileId, RunnableKind, TestId}; | ||
4 | use project_model::{self, TargetKind}; | 5 | use project_model::{self, TargetKind}; |
5 | use ra_ide::{FileId, RunnableKind, TestId}; | ||
6 | use vfs::AbsPathBuf; | 6 | use vfs::AbsPathBuf; |
7 | 7 | ||
8 | use crate::{global_state::GlobalStateSnapshot, Result}; | 8 | use crate::{global_state::GlobalStateSnapshot, Result}; |
diff --git a/crates/rust-analyzer/src/cli.rs b/crates/rust-analyzer/src/cli.rs index b237a94d1..6966ee576 100644 --- a/crates/rust-analyzer/src/cli.rs +++ b/crates/rust-analyzer/src/cli.rs | |||
@@ -10,7 +10,7 @@ mod ssr; | |||
10 | use std::io::Read; | 10 | use std::io::Read; |
11 | 11 | ||
12 | use anyhow::Result; | 12 | use anyhow::Result; |
13 | use ra_ide::Analysis; | 13 | use ide::Analysis; |
14 | use syntax::{AstNode, SourceFile}; | 14 | use syntax::{AstNode, SourceFile}; |
15 | 15 | ||
16 | pub use self::{ | 16 | pub use self::{ |
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index b20a1675e..0f614f9e0 100644 --- a/crates/rust-analyzer/src/cli/analysis_bench.rs +++ b/crates/rust-analyzer/src/cli/analysis_bench.rs | |||
@@ -7,7 +7,7 @@ use base_db::{ | |||
7 | salsa::{Database, Durability}, | 7 | salsa::{Database, Durability}, |
8 | FileId, | 8 | FileId, |
9 | }; | 9 | }; |
10 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, CompletionConfig, FilePosition, LineCol}; | 10 | use ide::{Analysis, AnalysisChange, AnalysisHost, CompletionConfig, FilePosition, LineCol}; |
11 | use vfs::AbsPathBuf; | 11 | use vfs::AbsPathBuf; |
12 | 12 | ||
13 | use crate::{ | 13 | use crate::{ |
diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs index 56403cabe..3371c4fd3 100644 --- a/crates/rust-analyzer/src/cli/diagnostics.rs +++ b/crates/rust-analyzer/src/cli/diagnostics.rs | |||
@@ -8,7 +8,7 @@ use rustc_hash::FxHashSet; | |||
8 | 8 | ||
9 | use base_db::SourceDatabaseExt; | 9 | use base_db::SourceDatabaseExt; |
10 | use hir::Crate; | 10 | use hir::Crate; |
11 | use ra_ide::Severity; | 11 | use ide::Severity; |
12 | 12 | ||
13 | use crate::cli::{load_cargo::load_cargo, Result}; | 13 | use crate::cli::{load_cargo::load_cargo, Result}; |
14 | 14 | ||
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index 542734803..c47cf6ef3 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs | |||
@@ -5,8 +5,8 @@ use std::{path::Path, sync::Arc}; | |||
5 | use anyhow::Result; | 5 | use anyhow::Result; |
6 | use base_db::CrateGraph; | 6 | use base_db::CrateGraph; |
7 | use crossbeam_channel::{unbounded, Receiver}; | 7 | use crossbeam_channel::{unbounded, Receiver}; |
8 | use ide::{AnalysisChange, AnalysisHost}; | ||
8 | use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; | 9 | use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; |
9 | use ra_ide::{AnalysisChange, AnalysisHost}; | ||
10 | use vfs::{loader::Handle, AbsPath, AbsPathBuf}; | 10 | use vfs::{loader::Handle, AbsPath, AbsPathBuf}; |
11 | 11 | ||
12 | use crate::reload::{ProjectFolders, SourceRootConfig}; | 12 | use crate::reload::{ProjectFolders, SourceRootConfig}; |
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index bfc84147c..33fb5e9c2 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -10,9 +10,9 @@ | |||
10 | use std::{ffi::OsString, path::PathBuf}; | 10 | use std::{ffi::OsString, path::PathBuf}; |
11 | 11 | ||
12 | use flycheck::FlycheckConfig; | 12 | use flycheck::FlycheckConfig; |
13 | use ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; | ||
13 | use lsp_types::ClientCapabilities; | 14 | use lsp_types::ClientCapabilities; |
14 | use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; | 15 | use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; |
15 | use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; | ||
16 | use serde::Deserialize; | 16 | use serde::Deserialize; |
17 | use vfs::AbsPathBuf; | 17 | use vfs::AbsPathBuf; |
18 | 18 | ||
diff --git a/crates/rust-analyzer/src/diagnostics.rs b/crates/rust-analyzer/src/diagnostics.rs index d24c55cee..108df3eb0 100644 --- a/crates/rust-analyzer/src/diagnostics.rs +++ b/crates/rust-analyzer/src/diagnostics.rs | |||
@@ -3,7 +3,7 @@ pub(crate) mod to_proto; | |||
3 | 3 | ||
4 | use std::{mem, sync::Arc}; | 4 | use std::{mem, sync::Arc}; |
5 | 5 | ||
6 | use ra_ide::FileId; | 6 | use ide::FileId; |
7 | use rustc_hash::{FxHashMap, FxHashSet}; | 7 | use rustc_hash::{FxHashMap, FxHashSet}; |
8 | 8 | ||
9 | use crate::lsp_ext; | 9 | use crate::lsp_ext; |
diff --git a/crates/rust-analyzer/src/from_proto.rs b/crates/rust-analyzer/src/from_proto.rs index 945a353dd..5b9f52993 100644 --- a/crates/rust-analyzer/src/from_proto.rs +++ b/crates/rust-analyzer/src/from_proto.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | use std::convert::TryFrom; | 2 | use std::convert::TryFrom; |
3 | 3 | ||
4 | use base_db::{FileId, FilePosition, FileRange}; | 4 | use base_db::{FileId, FilePosition, FileRange}; |
5 | use ra_ide::{AssistKind, LineCol, LineIndex}; | 5 | use ide::{AssistKind, LineCol, LineIndex}; |
6 | use syntax::{TextRange, TextSize}; | 6 | use syntax::{TextRange, TextSize}; |
7 | use vfs::AbsPathBuf; | 7 | use vfs::AbsPathBuf; |
8 | 8 | ||
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index f04a0a59f..212f98a30 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -8,10 +8,10 @@ use std::{sync::Arc, time::Instant}; | |||
8 | use base_db::{CrateId, VfsPath}; | 8 | use base_db::{CrateId, VfsPath}; |
9 | use crossbeam_channel::{unbounded, Receiver, Sender}; | 9 | use crossbeam_channel::{unbounded, Receiver, Sender}; |
10 | use flycheck::FlycheckHandle; | 10 | use flycheck::FlycheckHandle; |
11 | use ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; | ||
11 | use lsp_types::{SemanticTokens, Url}; | 12 | use lsp_types::{SemanticTokens, Url}; |
12 | use parking_lot::{Mutex, RwLock}; | 13 | use parking_lot::{Mutex, RwLock}; |
13 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | 14 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; |
14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; | ||
15 | use rustc_hash::FxHashMap; | 15 | use rustc_hash::FxHashMap; |
16 | 16 | ||
17 | use crate::{ | 17 | use crate::{ |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 4b5ca7eec..74f73655a 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -1,12 +1,16 @@ | |||
1 | //! This module is responsible for implementing handlers for Language Server | 1 | //! This module is responsible for implementing handlers for Language Server |
2 | //! Protocol. The majority of requests are fulfilled by calling into the | 2 | //! Protocol. The majority of requests are fulfilled by calling into the |
3 | //! `ra_ide` crate. | 3 | //! `ide` crate. |
4 | 4 | ||
5 | use std::{ | 5 | use std::{ |
6 | io::Write as _, | 6 | io::Write as _, |
7 | process::{self, Stdio}, | 7 | process::{self, Stdio}, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | use ide::{ | ||
11 | FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, | ||
12 | RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, | ||
13 | }; | ||
10 | use lsp_server::ErrorCode; | 14 | use lsp_server::ErrorCode; |
11 | use lsp_types::{ | 15 | use lsp_types::{ |
12 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, | 16 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, |
@@ -19,10 +23,6 @@ use lsp_types::{ | |||
19 | TextDocumentIdentifier, Url, WorkspaceEdit, | 23 | TextDocumentIdentifier, Url, WorkspaceEdit, |
20 | }; | 24 | }; |
21 | use project_model::TargetKind; | 25 | use project_model::TargetKind; |
22 | use ra_ide::{ | ||
23 | FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, | ||
24 | RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, | ||
25 | }; | ||
26 | use serde::{Deserialize, Serialize}; | 26 | use serde::{Deserialize, Serialize}; |
27 | use serde_json::to_value; | 27 | use serde_json::to_value; |
28 | use stdx::{format_to, split_once}; | 28 | use stdx::{format_to, split_once}; |
@@ -212,7 +212,7 @@ pub(crate) fn handle_on_type_formatting( | |||
212 | let line_index = snap.analysis.file_line_index(position.file_id)?; | 212 | let line_index = snap.analysis.file_line_index(position.file_id)?; |
213 | let line_endings = snap.file_line_endings(position.file_id); | 213 | let line_endings = snap.file_line_endings(position.file_id); |
214 | 214 | ||
215 | // in `ra_ide`, the `on_type` invariant is that | 215 | // in `ide`, the `on_type` invariant is that |
216 | // `text.char_at(position) == typed_char`. | 216 | // `text.char_at(position) == typed_char`. |
217 | position.offset -= TextSize::of('.'); | 217 | position.offset -= TextSize::of('.'); |
218 | let char_typed = params.ch.chars().next().unwrap_or('\0'); | 218 | let char_typed = params.ch.chars().next().unwrap_or('\0'); |
diff --git a/crates/rust-analyzer/src/lib.rs b/crates/rust-analyzer/src/lib.rs index 8d2e76cc2..87f72b497 100644 --- a/crates/rust-analyzer/src/lib.rs +++ b/crates/rust-analyzer/src/lib.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Implementation of the LSP for rust-analyzer. | 1 | //! Implementation of the LSP for rust-analyzer. |
2 | //! | 2 | //! |
3 | //! This crate takes Rust-specific analysis results from ra_ide and translates | 3 | //! This crate takes Rust-specific analysis results from ide and translates |
4 | //! into LSP types. | 4 | //! into LSP types. |
5 | //! | 5 | //! |
6 | //! It also is the root of all state. `world` module defines the bulk of the | 6 | //! It also is the root of all state. `world` module defines the bulk of the |
@@ -41,7 +41,7 @@ use serde::de::DeserializeOwned; | |||
41 | 41 | ||
42 | pub type Result<T, E = Box<dyn std::error::Error + Send + Sync>> = std::result::Result<T, E>; | 42 | pub type Result<T, E = Box<dyn std::error::Error + Send + Sync>> = std::result::Result<T, E>; |
43 | pub use crate::{caps::server_capabilities, main_loop::main_loop}; | 43 | pub use crate::{caps::server_capabilities, main_loop::main_loop}; |
44 | use ra_ide::AnalysisHost; | 44 | use ide::AnalysisHost; |
45 | use std::fmt; | 45 | use std::fmt; |
46 | use vfs::Vfs; | 46 | use vfs::Vfs; |
47 | 47 | ||
diff --git a/crates/rust-analyzer/src/lsp_utils.rs b/crates/rust-analyzer/src/lsp_utils.rs index 17d1550cd..85c661571 100644 --- a/crates/rust-analyzer/src/lsp_utils.rs +++ b/crates/rust-analyzer/src/lsp_utils.rs | |||
@@ -2,8 +2,8 @@ | |||
2 | use std::{error::Error, ops::Range}; | 2 | use std::{error::Error, ops::Range}; |
3 | 3 | ||
4 | use base_db::Canceled; | 4 | use base_db::Canceled; |
5 | use ide::LineIndex; | ||
5 | use lsp_server::Notification; | 6 | use lsp_server::Notification; |
6 | use ra_ide::LineIndex; | ||
7 | 7 | ||
8 | use crate::{from_proto, global_state::GlobalState}; | 8 | use crate::{from_proto, global_state::GlobalState}; |
9 | 9 | ||
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 5726820f9..66e04653a 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -7,9 +7,9 @@ use std::{ | |||
7 | 7 | ||
8 | use base_db::VfsPath; | 8 | use base_db::VfsPath; |
9 | use crossbeam_channel::{select, Receiver}; | 9 | use crossbeam_channel::{select, Receiver}; |
10 | use ide::{Canceled, FileId}; | ||
10 | use lsp_server::{Connection, Notification, Request, Response}; | 11 | use lsp_server::{Connection, Notification, Request, Response}; |
11 | use lsp_types::notification::Notification as _; | 12 | use lsp_types::notification::Notification as _; |
12 | use ra_ide::{Canceled, FileId}; | ||
13 | 13 | ||
14 | use crate::{ | 14 | use crate::{ |
15 | config::Config, | 15 | config::Config, |
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index fd133e312..a2cfb4e0d 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -3,8 +3,8 @@ use std::{mem, sync::Arc}; | |||
3 | 3 | ||
4 | use base_db::{CrateGraph, SourceRoot, VfsPath}; | 4 | use base_db::{CrateGraph, SourceRoot, VfsPath}; |
5 | use flycheck::FlycheckHandle; | 5 | use flycheck::FlycheckHandle; |
6 | use ide::AnalysisChange; | ||
6 | use project_model::{ProcMacroClient, ProjectWorkspace}; | 7 | use project_model::{ProcMacroClient, ProjectWorkspace}; |
7 | use ra_ide::AnalysisChange; | ||
8 | use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; | 8 | use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 93a4b1f27..8a2cfa2ae 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -5,13 +5,13 @@ use std::{ | |||
5 | }; | 5 | }; |
6 | 6 | ||
7 | use base_db::{FileId, FileRange}; | 7 | use base_db::{FileId, FileRange}; |
8 | use itertools::Itertools; | 8 | use ide::{ |
9 | use ra_ide::{ | ||
10 | Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, | 9 | Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, |
11 | FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, HighlightedRange, | 10 | FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, HighlightedRange, |
12 | Indel, InlayHint, InlayKind, InsertTextFormat, LineIndex, Markup, NavigationTarget, | 11 | Indel, InlayHint, InlayKind, InsertTextFormat, LineIndex, Markup, NavigationTarget, |
13 | ReferenceAccess, ResolvedAssist, Runnable, Severity, SourceChange, SourceFileEdit, TextEdit, | 12 | ReferenceAccess, ResolvedAssist, Runnable, Severity, SourceChange, SourceFileEdit, TextEdit, |
14 | }; | 13 | }; |
14 | use itertools::Itertools; | ||
15 | use syntax::{SyntaxKind, TextRange, TextSize}; | 15 | use syntax::{SyntaxKind, TextRange, TextSize}; |
16 | 16 | ||
17 | use crate::{ | 17 | use crate::{ |
@@ -761,7 +761,7 @@ pub(crate) fn markup_content(markup: Markup) -> lsp_types::MarkupContent { | |||
761 | 761 | ||
762 | #[cfg(test)] | 762 | #[cfg(test)] |
763 | mod tests { | 763 | mod tests { |
764 | use ra_ide::Analysis; | 764 | use ide::Analysis; |
765 | 765 | ||
766 | use super::*; | 766 | use super::*; |
767 | 767 | ||
diff --git a/crates/ssr/Cargo.toml b/crates/ssr/Cargo.toml index cd05eeecc..56c1f7761 100644 --- a/crates/ssr/Cargo.toml +++ b/crates/ssr/Cargo.toml | |||
@@ -1,6 +1,6 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "ssr" | 2 | name = "ssr" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | description = "Structural search and replace of Rust code" | 4 | description = "Structural search and replace of Rust code" |
5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
6 | repository = "https://github.com/rust-analyzer/rust-analyzer" | 6 | repository = "https://github.com/rust-analyzer/rust-analyzer" |
diff --git a/crates/stdx/Cargo.toml b/crates/stdx/Cargo.toml index 4c0b85861..b186b46f2 100644 --- a/crates/stdx/Cargo.toml +++ b/crates/stdx/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "stdx" | 2 | name = "stdx" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
4 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
5 | edition = "2018" | 6 | edition = "2018" |
6 | license = "MIT OR Apache-2.0" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
diff --git a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast deleted file mode 100644 index c7289e400..000000000 --- a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "impl" | ||
4 | [email protected] " " | ||
5 | [email protected] | ||
6 | [email protected] | ||
7 | [email protected] | ||
8 | [email protected] | ||
9 | [email protected] "F" | ||
10 | [email protected] " " | ||
11 | [email protected] | ||
12 | [email protected] "{" | ||
13 | [email protected] "\n " | ||
14 | [email protected] | ||
15 | [email protected] "type" | ||
16 | [email protected] " " | ||
17 | [email protected] | ||
18 | [email protected] "A" | ||
19 | [email protected] ":" | ||
20 | [email protected] " " | ||
21 | [email protected] | ||
22 | [email protected] | ||
23 | [email protected] | ||
24 | [email protected] | ||
25 | [email protected] | ||
26 | [email protected] | ||
27 | [email protected] "Clone" | ||
28 | [email protected] ";" | ||
29 | [email protected] "\n " | ||
30 | [email protected] | ||
31 | [email protected] "const" | ||
32 | [email protected] " " | ||
33 | [email protected] | ||
34 | [email protected] "B" | ||
35 | [email protected] ":" | ||
36 | [email protected] " " | ||
37 | [email protected] | ||
38 | [email protected] | ||
39 | [email protected] | ||
40 | [email protected] | ||
41 | [email protected] "i32" | ||
42 | [email protected] ";" | ||
43 | [email protected] "\n " | ||
44 | [email protected] | ||
45 | [email protected] "fn" | ||
46 | [email protected] " " | ||
47 | [email protected] | ||
48 | [email protected] "foo" | ||
49 | [email protected] | ||
50 | [email protected] "(" | ||
51 | [email protected] ")" | ||
52 | [email protected] " " | ||
53 | [email protected] | ||
54 | [email protected] "{" | ||
55 | [email protected] "}" | ||
56 | [email protected] "\n " | ||
57 | [email protected] | ||
58 | [email protected] "fn" | ||
59 | [email protected] " " | ||
60 | [email protected] | ||
61 | [email protected] "bar" | ||
62 | [email protected] | ||
63 | [email protected] "(" | ||
64 | [email protected] | ||
65 | [email protected] "&" | ||
66 | [email protected] "self" | ||
67 | [email protected] ")" | ||
68 | [email protected] ";" | ||
69 | [email protected] "\n" | ||
70 | [email protected] "}" | ||
71 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs b/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs deleted file mode 100644 index a5ec3239f..000000000 --- a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | impl F { | ||
2 | type A: Clone; | ||
3 | const B: i32; | ||
4 | fn foo() {} | ||
5 | fn bar(&self); | ||
6 | } | ||
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index e719f4f7c..45e5fb97f 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | ||
3 | name = "test_utils" | 2 | name = "test_utils" |
4 | version = "0.1.0" | 3 | version = "0.0.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
@@ -14,4 +14,5 @@ difference = "2.0.0" | |||
14 | text-size = "1.0.0" | 14 | text-size = "1.0.0" |
15 | serde_json = "1.0.48" | 15 | serde_json = "1.0.48" |
16 | rustc-hash = "1.1.0" | 16 | rustc-hash = "1.1.0" |
17 | |||
17 | stdx = { path = "../stdx" } | 18 | stdx = { path = "../stdx" } |
diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index fce7bae3a..c1e53f4b1 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "vfs-notify" | 2 | name = "vfs-notify" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
4 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
5 | edition = "2018" | 6 | edition = "2018" |
6 | license = "MIT OR Apache-2.0" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml index b74cdb7ff..9ae8f19b6 100644 --- a/crates/vfs/Cargo.toml +++ b/crates/vfs/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "vfs" | 2 | name = "vfs" |
3 | version = "0.1.0" | 3 | version = "0.0.0" |
4 | license = "MIT OR Apache-2.0" | ||
4 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
5 | edition = "2018" | 6 | edition = "2018" |
6 | license = "MIT OR Apache-2.0" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
diff --git a/docs/dev/README.md b/docs/dev/README.md index 04bebbfca..ad18217f1 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -14,7 +14,7 @@ To learn more about how rust-analyzer works, see | |||
14 | 14 | ||
15 | We also publish rustdoc docs to pages: | 15 | We also publish rustdoc docs to pages: |
16 | 16 | ||
17 | https://rust-analyzer.github.io/rust-analyzer/ra_ide/ | 17 | https://rust-analyzer.github.io/rust-analyzer/ide/ |
18 | 18 | ||
19 | Various organizational and process issues are discussed in this document. | 19 | Various organizational and process issues are discussed in this document. |
20 | 20 | ||
@@ -159,7 +159,7 @@ IDE should use only types from `hir`, and should not depend on the underling com | |||
159 | 159 | ||
160 | ## IDE API | 160 | ## IDE API |
161 | 161 | ||
162 | The main IDE crate (`ra_ide`) uses "Plain Old Data" for the API. | 162 | The main IDE crate (`ide`) uses "Plain Old Data" for the API. |
163 | Rather than talking in definitions and references, it talks in Strings and textual offsets. | 163 | Rather than talking in definitions and references, it talks in Strings and textual offsets. |
164 | In general, API is centered around UI concerns -- the result of the call is what the user sees in the editor, and not what the compiler sees underneath. | 164 | In general, API is centered around UI concerns -- the result of the call is what the user sees in the editor, and not what the compiler sees underneath. |
165 | The results are 100% Rust specific though. | 165 | The results are 100% Rust specific though. |
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 917f05c81..6f1377f2f 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md | |||
@@ -118,7 +118,7 @@ directly query the database. | |||
118 | 118 | ||
119 | The top-level `hir` façade crate wraps ids into a more OO-flavored API. | 119 | The top-level `hir` façade crate wraps ids into a more OO-flavored API. |
120 | 120 | ||
121 | ### `crates/ra_ide` | 121 | ### `crates/ide` |
122 | 122 | ||
123 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` | 123 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` |
124 | is a mutable entity (clojure's atom) which holds the current state, incorporates | 124 | is a mutable entity (clojure's atom) which holds the current state, incorporates |
@@ -136,11 +136,11 @@ offsets and strings as output. This works on top of rich code model powered by | |||
136 | 136 | ||
137 | ### `crates/rust-analyzer` | 137 | ### `crates/rust-analyzer` |
138 | 138 | ||
139 | An LSP implementation which wraps `ra_ide` into a language server protocol. | 139 | An LSP implementation which wraps `ide` into a language server protocol. |
140 | 140 | ||
141 | ### `ra_vfs` | 141 | ### `ra_vfs` |
142 | 142 | ||
143 | Although `hir` and `ra_ide` don't do any IO, we need to be able to read | 143 | Although `hir` and `ide` don't do any IO, we need to be able to read |
144 | files from disk at the end of the day. This is what `ra_vfs` does. It also | 144 | files from disk at the end of the day. This is what `ra_vfs` does. It also |
145 | manages overlays: "dirty" files in the editor, whose "true" contents is | 145 | manages overlays: "dirty" files in the editor, whose "true" contents is |
146 | different from data on disk. This is more or less the single really | 146 | different from data on disk. This is more or less the single really |
@@ -161,7 +161,7 @@ disk. For this reason, we try to avoid writing too many tests on this boundary: | |||
161 | in a statically typed language, it's hard to make an error in the protocol | 161 | in a statically typed language, it's hard to make an error in the protocol |
162 | itself if messages are themselves typed. | 162 | itself if messages are themselves typed. |
163 | 163 | ||
164 | The middle, and most important, boundary is `ra_ide`. Unlike | 164 | The middle, and most important, boundary is `ide`. Unlike |
165 | `rust-analyzer`, which exposes API, `ide` uses Rust API and is intended to | 165 | `rust-analyzer`, which exposes API, `ide` uses Rust API and is intended to |
166 | use by various tools. Typical test creates an `AnalysisHost`, calls some | 166 | use by various tools. Typical test creates an `AnalysisHost`, calls some |
167 | `Analysis` functions and compares the results against expectation. | 167 | `Analysis` functions and compares the results against expectation. |
diff --git a/docs/dev/guide.md b/docs/dev/guide.md index 29d84bf3f..b5a5d7c93 100644 --- a/docs/dev/guide.md +++ b/docs/dev/guide.md | |||
@@ -40,8 +40,8 @@ terms of files and offsets, and **not** in terms of Rust concepts like structs, | |||
40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the | 40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the |
41 | stack, we'll talk about it later. | 41 | stack, we'll talk about it later. |
42 | 42 | ||
43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L265-L284 | 43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L265-L284 |
44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L291-L478 | 44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L291-L478 |
45 | 45 | ||
46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply | 46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply |
47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to | 47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to |
@@ -69,7 +69,7 @@ the `AnalysisHost::apply_change` method, which accepts a single argument, a | |||
69 | "transaction", so it suffices to study its methods to understand all of the | 69 | "transaction", so it suffices to study its methods to understand all of the |
70 | input data. | 70 | input data. |
71 | 71 | ||
72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L119-L167 | 72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L119-L167 |
73 | 73 | ||
74 | The `(add|change|remove)_file` methods control the set of the input files, where | 74 | The `(add|change|remove)_file` methods control the set of the input files, where |
75 | each file has an integer id (`FileId`, picked by the client), text (`String`) | 75 | each file has an integer id (`FileId`, picked by the client), text (`String`) |
@@ -253,7 +253,7 @@ All analyzer information is stored in a salsa database. `Analysis` and | |||
253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa | 253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa |
254 | database. | 254 | database. |
255 | 255 | ||
256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/db.rs#L88-L134 | 256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/db.rs#L88-L134 |
257 | 257 | ||
258 | Salsa input queries are defined in [`FilesDatabase`] (which is a part of | 258 | Salsa input queries are defined in [`FilesDatabase`] (which is a part of |
259 | `RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: | 259 | `RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: |
@@ -565,11 +565,11 @@ the type to completion. | |||
565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 | 565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 |
566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 | 566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 |
567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps | 567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps |
568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L439-L444 | 568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L439-L444 |
569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L46-L62 | 569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion.rs#L46-L62 |
570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L14-L37 | 570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L14-L37 |
571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L72-L75 | 571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L72-L75 |
572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L116-L120 | 572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L116-L120 |
573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L123 | 573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L123 |
574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L52-L59 | 574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion.rs#L52-L59 |
575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/complete_dot.rs#L6-L22 | 575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/complete_dot.rs#L6-L22 |
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 97a11a01e..76895aeca 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -194,7 +194,7 @@ impl TidyDocs { | |||
194 | let poorly_documented = [ | 194 | let poorly_documented = [ |
195 | "hir", | 195 | "hir", |
196 | "hir_expand", | 196 | "hir_expand", |
197 | "ra_ide", | 197 | "ide", |
198 | "mbe", | 198 | "mbe", |
199 | "parser", | 199 | "parser", |
200 | "profile", | 200 | "profile", |