From 1b0c7701cc97cd7bef8bb9729011d4cf291a60c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:42:52 +0200 Subject: [PATCH 1/2] Rename ra_ide -> ide --- Cargo.lock | 70 +++++++++---------- README.md | 2 +- crates/base_db/src/lib.rs | 2 +- crates/expect/Cargo.toml | 5 +- crates/flycheck/Cargo.toml | 7 +- crates/{ra_ide => ide}/Cargo.toml | 14 ++-- crates/{ra_ide => ide}/src/call_hierarchy.rs | 0 crates/{ra_ide => ide}/src/call_info.rs | 0 crates/{ra_ide => ide}/src/completion.rs | 0 .../src/completion/complete_attribute.rs | 0 .../src/completion/complete_dot.rs | 0 .../src/completion/complete_fn_param.rs | 0 .../src/completion/complete_keyword.rs | 0 .../complete_macro_in_item_position.rs | 0 .../src/completion/complete_pattern.rs | 0 .../src/completion/complete_postfix.rs | 0 .../src/completion/complete_qualified_path.rs | 0 .../src/completion/complete_record.rs | 0 .../src/completion/complete_snippet.rs | 0 .../src/completion/complete_trait_impl.rs | 0 .../completion/complete_unqualified_path.rs | 0 .../src/completion/completion_config.rs | 0 .../src/completion/completion_context.rs | 0 .../src/completion/completion_item.rs | 0 .../src/completion/patterns.rs | 0 .../src/completion/presentation.rs | 0 .../src/completion/test_utils.rs | 0 crates/{ra_ide => ide}/src/diagnostics.rs | 0 .../src/diagnostics/diagnostics_with_fix.rs | 0 crates/{ra_ide => ide}/src/display.rs | 0 .../src/display/navigation_target.rs | 0 .../src/display/short_label.rs | 0 crates/{ra_ide => ide}/src/expand_macro.rs | 0 .../{ra_ide => ide}/src/extend_selection.rs | 0 crates/{ra_ide => ide}/src/file_structure.rs | 0 crates/{ra_ide => ide}/src/folding_ranges.rs | 0 crates/{ra_ide => ide}/src/goto_definition.rs | 0 .../src/goto_implementation.rs | 0 .../src/goto_type_definition.rs | 0 crates/{ra_ide => ide}/src/hover.rs | 0 crates/{ra_ide => ide}/src/inlay_hints.rs | 0 crates/{ra_ide => ide}/src/join_lines.rs | 0 crates/{ra_ide => ide}/src/lib.rs | 2 +- crates/{ra_ide => ide}/src/markup.rs | 0 crates/{ra_ide => ide}/src/matching_brace.rs | 0 crates/{ra_ide => ide}/src/mock_analysis.rs | 0 crates/{ra_ide => ide}/src/parent_module.rs | 0 crates/{ra_ide => ide}/src/prime_caches.rs | 0 crates/{ra_ide => ide}/src/references.rs | 0 .../{ra_ide => ide}/src/references/rename.rs | 0 crates/{ra_ide => ide}/src/runnables.rs | 0 crates/{ra_ide => ide}/src/status.rs | 0 .../src/syntax_highlighting.rs | 0 .../src/syntax_highlighting/html.rs | 0 .../src/syntax_highlighting/injection.rs | 0 .../src/syntax_highlighting/tags.rs | 0 .../src/syntax_highlighting/tests.rs | 14 ++-- crates/{ra_ide => ide}/src/syntax_tree.rs | 0 crates/{ra_ide => ide}/src/typing.rs | 0 crates/{ra_ide => ide}/src/typing/on_enter.rs | 0 .../test_data/highlight_doctest.html | 0 .../test_data/highlight_extern_crate.html | 0 .../test_data/highlight_injection.html | 0 .../test_data/highlight_strings.html | 0 .../test_data/highlight_unsafe.html | 0 .../test_data/highlighting.html | 0 .../test_data/rainbow_highlighting.html | 0 crates/ide_db/Cargo.toml | 2 +- crates/ide_db/src/defs.rs | 2 +- crates/paths/Cargo.toml | 4 +- crates/proc_macro_api/Cargo.toml | 7 +- crates/rust-analyzer/Cargo.toml | 11 ++- crates/rust-analyzer/src/cargo_target_spec.rs | 2 +- crates/rust-analyzer/src/cli.rs | 2 +- .../rust-analyzer/src/cli/analysis_bench.rs | 2 +- crates/rust-analyzer/src/cli/diagnostics.rs | 2 +- crates/rust-analyzer/src/cli/load_cargo.rs | 2 +- crates/rust-analyzer/src/config.rs | 2 +- crates/rust-analyzer/src/diagnostics.rs | 2 +- crates/rust-analyzer/src/from_proto.rs | 2 +- crates/rust-analyzer/src/global_state.rs | 2 +- crates/rust-analyzer/src/handlers.rs | 12 ++-- crates/rust-analyzer/src/lib.rs | 4 +- crates/rust-analyzer/src/lsp_utils.rs | 2 +- crates/rust-analyzer/src/main_loop.rs | 2 +- crates/rust-analyzer/src/reload.rs | 2 +- crates/rust-analyzer/src/to_proto.rs | 6 +- crates/ssr/Cargo.toml | 2 +- crates/stdx/Cargo.toml | 4 +- crates/test_utils/Cargo.toml | 7 +- crates/vfs-notify/Cargo.toml | 4 +- crates/vfs/Cargo.toml | 4 +- docs/dev/README.md | 4 +- docs/dev/architecture.md | 8 +-- docs/dev/guide.md | 24 +++---- xtask/tests/tidy.rs | 2 +- 96 files changed, 122 insertions(+), 125 deletions(-) rename crates/{ra_ide => ide}/Cargo.toml (84%) rename crates/{ra_ide => ide}/src/call_hierarchy.rs (100%) rename crates/{ra_ide => ide}/src/call_info.rs (100%) rename crates/{ra_ide => ide}/src/completion.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_attribute.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_dot.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_fn_param.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_keyword.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_macro_in_item_position.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_pattern.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_postfix.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_qualified_path.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_record.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_snippet.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_trait_impl.rs (100%) rename crates/{ra_ide => ide}/src/completion/complete_unqualified_path.rs (100%) rename crates/{ra_ide => ide}/src/completion/completion_config.rs (100%) rename crates/{ra_ide => ide}/src/completion/completion_context.rs (100%) rename crates/{ra_ide => ide}/src/completion/completion_item.rs (100%) rename crates/{ra_ide => ide}/src/completion/patterns.rs (100%) rename crates/{ra_ide => ide}/src/completion/presentation.rs (100%) rename crates/{ra_ide => ide}/src/completion/test_utils.rs (100%) rename crates/{ra_ide => ide}/src/diagnostics.rs (100%) rename crates/{ra_ide => ide}/src/diagnostics/diagnostics_with_fix.rs (100%) rename crates/{ra_ide => ide}/src/display.rs (100%) rename crates/{ra_ide => ide}/src/display/navigation_target.rs (100%) rename crates/{ra_ide => ide}/src/display/short_label.rs (100%) rename crates/{ra_ide => ide}/src/expand_macro.rs (100%) rename crates/{ra_ide => ide}/src/extend_selection.rs (100%) rename crates/{ra_ide => ide}/src/file_structure.rs (100%) rename crates/{ra_ide => ide}/src/folding_ranges.rs (100%) rename crates/{ra_ide => ide}/src/goto_definition.rs (100%) rename crates/{ra_ide => ide}/src/goto_implementation.rs (100%) rename crates/{ra_ide => ide}/src/goto_type_definition.rs (100%) rename crates/{ra_ide => ide}/src/hover.rs (100%) rename crates/{ra_ide => ide}/src/inlay_hints.rs (100%) rename crates/{ra_ide => ide}/src/join_lines.rs (100%) rename crates/{ra_ide => ide}/src/lib.rs (99%) rename crates/{ra_ide => ide}/src/markup.rs (100%) rename crates/{ra_ide => ide}/src/matching_brace.rs (100%) rename crates/{ra_ide => ide}/src/mock_analysis.rs (100%) rename crates/{ra_ide => ide}/src/parent_module.rs (100%) rename crates/{ra_ide => ide}/src/prime_caches.rs (100%) rename crates/{ra_ide => ide}/src/references.rs (100%) rename crates/{ra_ide => ide}/src/references/rename.rs (100%) rename crates/{ra_ide => ide}/src/runnables.rs (100%) rename crates/{ra_ide => ide}/src/status.rs (100%) rename crates/{ra_ide => ide}/src/syntax_highlighting.rs (100%) rename crates/{ra_ide => ide}/src/syntax_highlighting/html.rs (100%) rename crates/{ra_ide => ide}/src/syntax_highlighting/injection.rs (100%) rename crates/{ra_ide => ide}/src/syntax_highlighting/tags.rs (100%) rename crates/{ra_ide => ide}/src/syntax_highlighting/tests.rs (94%) rename crates/{ra_ide => ide}/src/syntax_tree.rs (100%) rename crates/{ra_ide => ide}/src/typing.rs (100%) rename crates/{ra_ide => ide}/src/typing/on_enter.rs (100%) rename crates/{ra_ide => ide}/test_data/highlight_doctest.html (100%) rename crates/{ra_ide => ide}/test_data/highlight_extern_crate.html (100%) rename crates/{ra_ide => ide}/test_data/highlight_injection.html (100%) rename crates/{ra_ide => ide}/test_data/highlight_strings.html (100%) rename crates/{ra_ide => ide}/test_data/highlight_unsafe.html (100%) rename crates/{ra_ide => ide}/test_data/highlighting.html (100%) rename crates/{ra_ide => ide}/test_data/rainbow_highlighting.html (100%) diff --git a/Cargo.lock b/Cargo.lock index 621be08320c0..2386c8f3a5d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,7 +346,7 @@ dependencies = [ [[package]] name = "expect" -version = "0.1.0" +version = "0.0.0" dependencies = [ "difference", "once_cell", @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "flycheck" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cargo_metadata", "crossbeam-channel", @@ -579,6 +579,30 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ide" +version = "0.0.0" +dependencies = [ + "assists", + "base_db", + "cfg", + "either", + "expect", + "hir", + "ide_db", + "indexmap", + "itertools", + "log", + "oorandom", + "profile", + "rustc-hash", + "ssr", + "stdx", + "syntax", + "test_utils", + "text_edit", +] + [[package]] name = "ide_db" version = "0.0.0" @@ -992,7 +1016,7 @@ dependencies = [ [[package]] name = "paths" -version = "0.1.0" +version = "0.0.0" [[package]] name = "percent-encoding" @@ -1052,7 +1076,7 @@ dependencies = [ [[package]] name = "proc_macro_api" -version = "0.1.0" +version = "0.0.0" dependencies = [ "crossbeam-channel", "jod-thread", @@ -1119,30 +1143,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "ra_ide" -version = "0.1.0" -dependencies = [ - "assists", - "base_db", - "cfg", - "either", - "expect", - "hir", - "ide_db", - "indexmap", - "itertools", - "log", - "oorandom", - "profile", - "rustc-hash", - "ssr", - "stdx", - "syntax", - "test_utils", - "text_edit", -] - [[package]] name = "rayon" version = "1.3.1" @@ -1213,7 +1213,7 @@ dependencies = [ [[package]] name = "rust-analyzer" -version = "0.1.0" +version = "0.0.0" dependencies = [ "anyhow", "base_db", @@ -1225,6 +1225,7 @@ dependencies = [ "hir", "hir_def", "hir_ty", + "ide", "ide_db", "itertools", "jod-thread", @@ -1239,7 +1240,6 @@ dependencies = [ "proc_macro_srv", "profile", "project_model", - "ra_ide", "rayon", "rustc-hash", "serde", @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "ssr" -version = "0.1.0" +version = "0.0.0" dependencies = [ "base_db", "expect", @@ -1458,7 +1458,7 @@ dependencies = [ [[package]] name = "stdx" -version = "0.1.0" +version = "0.0.0" [[package]] name = "syn" @@ -1515,7 +1515,7 @@ dependencies = [ [[package]] name = "test_utils" -version = "0.1.0" +version = "0.0.0" dependencies = [ "difference", "rustc-hash", @@ -1729,7 +1729,7 @@ dependencies = [ [[package]] name = "vfs" -version = "0.1.0" +version = "0.0.0" dependencies = [ "fst", "paths", @@ -1738,7 +1738,7 @@ dependencies = [ [[package]] name = "vfs-notify" -version = "0.1.0" +version = "0.0.0" dependencies = [ "crossbeam-channel", "jod-thread", diff --git a/README.md b/README.md index 16c980400cf6..264e4da70730 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 * Website: https://rust-analyzer.github.io/ * Metrics: https://rust-analyzer.github.io/metrics/ -* API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide/ +* API docs: https://rust-analyzer.github.io/rust-analyzer/ide/ ## License diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs index 811057251d0b..ee3415850654 100644 --- a/crates/base_db/src/lib.rs +++ b/crates/base_db/src/lib.rs @@ -1,4 +1,4 @@ -//! base_db defines basic database traits. The concrete DB is defined by ra_ide. +//! base_db defines basic database traits. The concrete DB is defined by ide. mod cancellation; mod input; pub mod fixture; diff --git a/crates/expect/Cargo.toml b/crates/expect/Cargo.toml index 77775630dc7a..b54d3a60e300 100644 --- a/crates/expect/Cargo.toml +++ b/crates/expect/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "expect" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2018" -license = "MIT OR Apache-2.0" [lib] doctest = false @@ -11,4 +11,5 @@ doctest = false [dependencies] once_cell = "1" difference = "2" + stdx = { path = "../stdx" } diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index acc72bc59ccf..262a66e4e3db 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml @@ -1,9 +1,9 @@ [package] -edition = "2018" name = "flycheck" -version = "0.1.0" -authors = ["rust-analyzer developers"] +version = "0.0.0" license = "MIT OR Apache-2.0" +authors = ["rust-analyzer developers"] +edition = "2018" [lib] doctest = false @@ -14,4 +14,5 @@ log = "0.4.8" cargo_metadata = "0.11.1" serde_json = "1.0.48" jod-thread = "0.1.1" + toolchain = { path = "../toolchain" } diff --git a/crates/ra_ide/Cargo.toml b/crates/ide/Cargo.toml similarity index 84% rename from crates/ra_ide/Cargo.toml rename to crates/ide/Cargo.toml index 2eb86755f025..e4b970c73b4e 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -1,16 +1,13 @@ [package] -edition = "2018" -name = "ra_ide" -version = "0.1.0" -authors = ["rust-analyzer developers"] +name = "ide" +version = "0.0.0" license = "MIT OR Apache-2.0" +authors = ["rust-analyzer developers"] +edition = "2018" [lib] doctest = false -[features] -wasm = [] - [dependencies] either = "1.5.3" indexmap = "1.3.2" @@ -20,7 +17,6 @@ rustc-hash = "1.1.0" oorandom = "11.1.2" stdx = { path = "../stdx" } - syntax = { path = "../syntax" } text_edit = { path = "../text_edit" } base_db = { path = "../base_db" } @@ -31,7 +27,7 @@ test_utils = { path = "../test_utils" } assists = { path = "../assists" } ssr = { path = "../ssr" } -# ra_ide should depend only on the top-level `hir` package. if you need +# ide should depend only on the top-level `hir` package. if you need # something from some `hir_xxx` subpackage, reexport the API via `hir`. hir = { path = "../hir" } diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs similarity index 100% rename from crates/ra_ide/src/call_hierarchy.rs rename to crates/ide/src/call_hierarchy.rs diff --git a/crates/ra_ide/src/call_info.rs b/crates/ide/src/call_info.rs similarity index 100% rename from crates/ra_ide/src/call_info.rs rename to crates/ide/src/call_info.rs diff --git a/crates/ra_ide/src/completion.rs b/crates/ide/src/completion.rs similarity index 100% rename from crates/ra_ide/src/completion.rs rename to crates/ide/src/completion.rs diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ide/src/completion/complete_attribute.rs similarity index 100% rename from crates/ra_ide/src/completion/complete_attribute.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_dot.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_fn_param.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_keyword.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_macro_in_item_position.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_pattern.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_postfix.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_qualified_path.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_record.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_snippet.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_trait_impl.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/complete_unqualified_path.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/completion_config.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/completion_context.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/completion_item.rs rename to crates/ide/src/completion/completion_item.rs diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ide/src/completion/patterns.rs similarity index 100% rename from crates/ra_ide/src/completion/patterns.rs rename to crates/ide/src/completion/patterns.rs diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ide/src/completion/presentation.rs similarity index 100% rename from crates/ra_ide/src/completion/presentation.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/completion/test_utils.rs rename to crates/ide/src/completion/test_utils.rs diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs similarity index 100% rename from crates/ra_ide/src/diagnostics.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs rename to crates/ide/src/diagnostics/diagnostics_with_fix.rs diff --git a/crates/ra_ide/src/display.rs b/crates/ide/src/display.rs similarity index 100% rename from crates/ra_ide/src/display.rs rename to crates/ide/src/display.rs diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs similarity index 100% rename from crates/ra_ide/src/display/navigation_target.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/display/short_label.rs rename to crates/ide/src/display/short_label.rs diff --git a/crates/ra_ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs similarity index 100% rename from crates/ra_ide/src/expand_macro.rs rename to crates/ide/src/expand_macro.rs diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ide/src/extend_selection.rs similarity index 100% rename from crates/ra_ide/src/extend_selection.rs rename to crates/ide/src/extend_selection.rs diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ide/src/file_structure.rs similarity index 100% rename from crates/ra_ide/src/file_structure.rs rename to crates/ide/src/file_structure.rs diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ide/src/folding_ranges.rs similarity index 100% rename from crates/ra_ide/src/folding_ranges.rs rename to crates/ide/src/folding_ranges.rs diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs similarity index 100% rename from crates/ra_ide/src/goto_definition.rs rename to crates/ide/src/goto_definition.rs diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs similarity index 100% rename from crates/ra_ide/src/goto_implementation.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/goto_type_definition.rs rename to crates/ide/src/goto_type_definition.rs diff --git a/crates/ra_ide/src/hover.rs b/crates/ide/src/hover.rs similarity index 100% rename from crates/ra_ide/src/hover.rs rename to crates/ide/src/hover.rs diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs similarity index 100% rename from crates/ra_ide/src/inlay_hints.rs rename to crates/ide/src/inlay_hints.rs diff --git a/crates/ra_ide/src/join_lines.rs b/crates/ide/src/join_lines.rs similarity index 100% rename from crates/ra_ide/src/join_lines.rs rename to crates/ide/src/join_lines.rs diff --git a/crates/ra_ide/src/lib.rs b/crates/ide/src/lib.rs similarity index 99% rename from crates/ra_ide/src/lib.rs rename to crates/ide/src/lib.rs index 4321a6b74323..eb6389529706 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -1,4 +1,4 @@ -//! ra_ide crate provides "ide-centric" APIs for the rust-analyzer. That is, +//! ide crate provides "ide-centric" APIs for the rust-analyzer. That is, //! it generally operates with files and text ranges, and returns results as //! Strings, suitable for displaying to the human. //! diff --git a/crates/ra_ide/src/markup.rs b/crates/ide/src/markup.rs similarity index 100% rename from crates/ra_ide/src/markup.rs rename to crates/ide/src/markup.rs diff --git a/crates/ra_ide/src/matching_brace.rs b/crates/ide/src/matching_brace.rs similarity index 100% rename from crates/ra_ide/src/matching_brace.rs rename to crates/ide/src/matching_brace.rs diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ide/src/mock_analysis.rs similarity index 100% rename from crates/ra_ide/src/mock_analysis.rs rename to crates/ide/src/mock_analysis.rs diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ide/src/parent_module.rs similarity index 100% rename from crates/ra_ide/src/parent_module.rs rename to crates/ide/src/parent_module.rs diff --git a/crates/ra_ide/src/prime_caches.rs b/crates/ide/src/prime_caches.rs similarity index 100% rename from crates/ra_ide/src/prime_caches.rs rename to crates/ide/src/prime_caches.rs diff --git a/crates/ra_ide/src/references.rs b/crates/ide/src/references.rs similarity index 100% rename from crates/ra_ide/src/references.rs rename to crates/ide/src/references.rs diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ide/src/references/rename.rs similarity index 100% rename from crates/ra_ide/src/references/rename.rs rename to crates/ide/src/references/rename.rs diff --git a/crates/ra_ide/src/runnables.rs b/crates/ide/src/runnables.rs similarity index 100% rename from crates/ra_ide/src/runnables.rs rename to crates/ide/src/runnables.rs diff --git a/crates/ra_ide/src/status.rs b/crates/ide/src/status.rs similarity index 100% rename from crates/ra_ide/src/status.rs rename to crates/ide/src/status.rs diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs similarity index 100% rename from crates/ra_ide/src/syntax_highlighting.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/syntax_highlighting/html.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/syntax_highlighting/injection.rs rename to 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 similarity index 100% rename from crates/ra_ide/src/syntax_highlighting/tags.rs rename to 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 similarity index 94% rename from crates/ra_ide/src/syntax_highlighting/tests.rs rename to crates/ide/src/syntax_highlighting/tests.rs index 594f61e85b7c..94f37d773f77 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs @@ -105,7 +105,7 @@ impl Option { } "# .trim(), - expect_file!["crates/ra_ide/test_data/highlighting.html"], + expect_file!["crates/ide/test_data/highlighting.html"], false, ); } @@ -128,7 +128,7 @@ fn bar() { } "# .trim(), - expect_file!["crates/ra_ide/test_data/rainbow_highlighting.html"], + expect_file!["crates/ide/test_data/rainbow_highlighting.html"], true, ); } @@ -181,7 +181,7 @@ fn main() { ); }"## .trim(), - expect_file!["crates/ra_ide/test_data/highlight_injection.html"], + expect_file!["crates/ide/test_data/highlight_injection.html"], false, ); } @@ -264,7 +264,7 @@ fn main() { println!("{ничоси}", ничоси = 92); }"# .trim(), - expect_file!["crates/ra_ide/test_data/highlight_strings.html"], + expect_file!["crates/ide/test_data/highlight_strings.html"], false, ); } @@ -337,7 +337,7 @@ fn main() { } "# .trim(), - expect_file!["crates/ra_ide/test_data/highlight_unsafe.html"], + expect_file!["crates/ide/test_data/highlight_unsafe.html"], false, ); } @@ -413,7 +413,7 @@ macro_rules! noop { } "# .trim(), - expect_file!["crates/ra_ide/test_data/highlight_doctest.html"], + expect_file!["crates/ide/test_data/highlight_doctest.html"], false, ); } @@ -430,7 +430,7 @@ fn test_extern_crate() { //- /alloc/lib.rs pub struct A "#, - expect_file!["crates/ra_ide/test_data/highlight_extern_crate.html"], + expect_file!["crates/ide/test_data/highlight_extern_crate.html"], false, ); } diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs similarity index 100% rename from crates/ra_ide/src/syntax_tree.rs rename to crates/ide/src/syntax_tree.rs diff --git a/crates/ra_ide/src/typing.rs b/crates/ide/src/typing.rs similarity index 100% rename from crates/ra_ide/src/typing.rs rename to crates/ide/src/typing.rs diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs similarity index 100% rename from crates/ra_ide/src/typing/on_enter.rs rename to 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 similarity index 100% rename from crates/ra_ide/test_data/highlight_doctest.html rename to 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 similarity index 100% rename from crates/ra_ide/test_data/highlight_extern_crate.html rename to 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 similarity index 100% rename from crates/ra_ide/test_data/highlight_injection.html rename to 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 similarity index 100% rename from crates/ra_ide/test_data/highlight_strings.html rename to 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 similarity index 100% rename from crates/ra_ide/test_data/highlight_unsafe.html rename to crates/ide/test_data/highlight_unsafe.html diff --git a/crates/ra_ide/test_data/highlighting.html b/crates/ide/test_data/highlighting.html similarity index 100% rename from crates/ra_ide/test_data/highlighting.html rename to 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 similarity index 100% rename from crates/ra_ide/test_data/rainbow_highlighting.html rename to crates/ide/test_data/rainbow_highlighting.html diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml index 885212162f3b..692fb64153bb 100644 --- a/crates/ide_db/Cargo.toml +++ b/crates/ide_db/Cargo.toml @@ -25,6 +25,6 @@ text_edit = { path = "../text_edit" } base_db = { path = "../base_db" } profile = { path = "../profile" } test_utils = { path = "../test_utils" } -# ra_ide should depend only on the top-level `hir` package. if you need +# ide should depend only on the top-level `hir` package. if you need # something from some `hir_xxx` subpackage, reexport the API via `hir`. hir = { path = "../hir" } diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index 7b5d6ac491bb..0d0affc27357 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -243,7 +243,7 @@ impl NameRefClass { } // Note: we don't have unit-tests for this rather important function. -// It is primarily exercised via goto definition tests in `ra_ide`. +// It is primarily exercised via goto definition tests in `ide`. pub fn classify_name_ref( sema: &Semantics, name_ref: &ast::NameRef, diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml index cbe2c26e20f6..5ac18d63b350 100644 --- a/crates/paths/Cargo.toml +++ b/crates/paths/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "paths" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2018" -license = "MIT OR Apache-2.0" [lib] doctest = false diff --git a/crates/proc_macro_api/Cargo.toml b/crates/proc_macro_api/Cargo.toml index c1abb562774c..a3a4c1103332 100644 --- a/crates/proc_macro_api/Cargo.toml +++ b/crates/proc_macro_api/Cargo.toml @@ -1,10 +1,9 @@ [package] -edition = "2018" name = "proc_macro_api" -version = "0.1.0" -authors = ["rust-analyzer developers"] -publish = false +version = "0.0.0" license = "MIT OR Apache-2.0" +authors = ["rust-analyzer developers"] +edition = "2018" [lib] doctest = false diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 749cf648c6f7..c7c1eda0fda4 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2018" name = "rust-analyzer" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] autobins = false -license = "MIT OR Apache-2.0" +edition = "2018" [lib] doctest = false @@ -30,12 +30,11 @@ serde_json = "1.0.48" threadpool = "1.7.1" rayon = "1.3.1" mimalloc = { version = "0.1.19", default-features = false, optional = true } +lsp-server = "0.3.3" stdx = { path = "../stdx" } - -lsp-server = "0.3.3" flycheck = { path = "../flycheck" } -ra_ide = { path = "../ra_ide" } +ide = { path = "../ide" } profile = { path = "../profile" } project_model = { path = "../project_model" } syntax = { path = "../syntax" } diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index 5ba30dbad635..3041915e1866 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs @@ -1,8 +1,8 @@ //! See `CargoTargetSpec` use cfg::CfgExpr; +use ide::{FileId, RunnableKind, TestId}; use project_model::{self, TargetKind}; -use ra_ide::{FileId, RunnableKind, TestId}; use vfs::AbsPathBuf; use crate::{global_state::GlobalStateSnapshot, Result}; diff --git a/crates/rust-analyzer/src/cli.rs b/crates/rust-analyzer/src/cli.rs index b237a94d113a..6966ee576ffc 100644 --- a/crates/rust-analyzer/src/cli.rs +++ b/crates/rust-analyzer/src/cli.rs @@ -10,7 +10,7 @@ mod ssr; use std::io::Read; use anyhow::Result; -use ra_ide::Analysis; +use ide::Analysis; use syntax::{AstNode, SourceFile}; pub use self::{ diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index b20a1675e6d3..0f614f9e0c5e 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::{ salsa::{Database, Durability}, FileId, }; -use ra_ide::{Analysis, AnalysisChange, AnalysisHost, CompletionConfig, FilePosition, LineCol}; +use ide::{Analysis, AnalysisChange, AnalysisHost, CompletionConfig, FilePosition, LineCol}; use vfs::AbsPathBuf; use crate::{ diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs index 56403cabe468..3371c4fd3019 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; use base_db::SourceDatabaseExt; use hir::Crate; -use ra_ide::Severity; +use ide::Severity; use crate::cli::{load_cargo::load_cargo, Result}; diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index 54273480327d..c47cf6ef3e4a 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}; use anyhow::Result; use base_db::CrateGraph; use crossbeam_channel::{unbounded, Receiver}; +use ide::{AnalysisChange, AnalysisHost}; use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; -use ra_ide::{AnalysisChange, AnalysisHost}; use vfs::{loader::Handle, AbsPath, AbsPathBuf}; use crate::reload::{ProjectFolders, SourceRootConfig}; diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index bfc84147c369..33fb5e9c2253 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -10,9 +10,9 @@ use std::{ffi::OsString, path::PathBuf}; use flycheck::FlycheckConfig; +use ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; use lsp_types::ClientCapabilities; use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; -use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; use serde::Deserialize; use vfs::AbsPathBuf; diff --git a/crates/rust-analyzer/src/diagnostics.rs b/crates/rust-analyzer/src/diagnostics.rs index d24c55cee6ec..108df3eb048b 100644 --- a/crates/rust-analyzer/src/diagnostics.rs +++ b/crates/rust-analyzer/src/diagnostics.rs @@ -3,7 +3,7 @@ pub(crate) mod to_proto; use std::{mem, sync::Arc}; -use ra_ide::FileId; +use ide::FileId; use rustc_hash::{FxHashMap, FxHashSet}; use crate::lsp_ext; diff --git a/crates/rust-analyzer/src/from_proto.rs b/crates/rust-analyzer/src/from_proto.rs index 945a353dd50d..5b9f52993dd6 100644 --- a/crates/rust-analyzer/src/from_proto.rs +++ b/crates/rust-analyzer/src/from_proto.rs @@ -2,7 +2,7 @@ use std::convert::TryFrom; use base_db::{FileId, FilePosition, FileRange}; -use ra_ide::{AssistKind, LineCol, LineIndex}; +use ide::{AssistKind, LineCol, LineIndex}; use syntax::{TextRange, TextSize}; use vfs::AbsPathBuf; diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index f04a0a59fd8a..212f98a3005c 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}; use base_db::{CrateId, VfsPath}; use crossbeam_channel::{unbounded, Receiver, Sender}; use flycheck::FlycheckHandle; +use ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; use lsp_types::{SemanticTokens, Url}; use parking_lot::{Mutex, RwLock}; use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; -use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; use rustc_hash::FxHashMap; use crate::{ diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 4b5ca7eecf35..74f73655a4e6 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -1,12 +1,16 @@ //! This module is responsible for implementing handlers for Language Server //! Protocol. The majority of requests are fulfilled by calling into the -//! `ra_ide` crate. +//! `ide` crate. use std::{ io::Write as _, process::{self, Stdio}, }; +use ide::{ + FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, + RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, +}; use lsp_server::ErrorCode; use lsp_types::{ CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, @@ -19,10 +23,6 @@ use lsp_types::{ TextDocumentIdentifier, Url, WorkspaceEdit, }; use project_model::TargetKind; -use ra_ide::{ - FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, - RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, -}; use serde::{Deserialize, Serialize}; use serde_json::to_value; use stdx::{format_to, split_once}; @@ -212,7 +212,7 @@ pub(crate) fn handle_on_type_formatting( let line_index = snap.analysis.file_line_index(position.file_id)?; let line_endings = snap.file_line_endings(position.file_id); - // in `ra_ide`, the `on_type` invariant is that + // in `ide`, the `on_type` invariant is that // `text.char_at(position) == typed_char`. position.offset -= TextSize::of('.'); 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 8d2e76cc2409..87f72b497467 100644 --- a/crates/rust-analyzer/src/lib.rs +++ b/crates/rust-analyzer/src/lib.rs @@ -1,6 +1,6 @@ //! Implementation of the LSP for rust-analyzer. //! -//! This crate takes Rust-specific analysis results from ra_ide and translates +//! This crate takes Rust-specific analysis results from ide and translates //! into LSP types. //! //! It also is the root of all state. `world` module defines the bulk of the @@ -41,7 +41,7 @@ use serde::de::DeserializeOwned; pub type Result> = std::result::Result; pub use crate::{caps::server_capabilities, main_loop::main_loop}; -use ra_ide::AnalysisHost; +use ide::AnalysisHost; use std::fmt; use vfs::Vfs; diff --git a/crates/rust-analyzer/src/lsp_utils.rs b/crates/rust-analyzer/src/lsp_utils.rs index 17d1550cddfd..85c661571483 100644 --- a/crates/rust-analyzer/src/lsp_utils.rs +++ b/crates/rust-analyzer/src/lsp_utils.rs @@ -2,8 +2,8 @@ use std::{error::Error, ops::Range}; use base_db::Canceled; +use ide::LineIndex; use lsp_server::Notification; -use ra_ide::LineIndex; use crate::{from_proto, global_state::GlobalState}; diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 5726820f9176..66e04653a31a 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -7,9 +7,9 @@ use std::{ use base_db::VfsPath; use crossbeam_channel::{select, Receiver}; +use ide::{Canceled, FileId}; use lsp_server::{Connection, Notification, Request, Response}; use lsp_types::notification::Notification as _; -use ra_ide::{Canceled, FileId}; use crate::{ config::Config, diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index fd133e312430..a2cfb4e0d5ca 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -3,8 +3,8 @@ use std::{mem, sync::Arc}; use base_db::{CrateGraph, SourceRoot, VfsPath}; use flycheck::FlycheckHandle; +use ide::AnalysisChange; use project_model::{ProcMacroClient, ProjectWorkspace}; -use ra_ide::AnalysisChange; use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; use crate::{ diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 93a4b1f27d4d..8a2cfa2aee1a 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -5,13 +5,13 @@ use std::{ }; use base_db::{FileId, FileRange}; -use itertools::Itertools; -use ra_ide::{ +use ide::{ Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, HighlightedRange, Indel, InlayHint, InlayKind, InsertTextFormat, LineIndex, Markup, NavigationTarget, ReferenceAccess, ResolvedAssist, Runnable, Severity, SourceChange, SourceFileEdit, TextEdit, }; +use itertools::Itertools; use syntax::{SyntaxKind, TextRange, TextSize}; use crate::{ @@ -761,7 +761,7 @@ pub(crate) fn markup_content(markup: Markup) -> lsp_types::MarkupContent { #[cfg(test)] mod tests { - use ra_ide::Analysis; + use ide::Analysis; use super::*; diff --git a/crates/ssr/Cargo.toml b/crates/ssr/Cargo.toml index cd05eeecc89d..56c1f776187e 100644 --- a/crates/ssr/Cargo.toml +++ b/crates/ssr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssr" -version = "0.1.0" +version = "0.0.0" description = "Structural search and replace of Rust code" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-analyzer/rust-analyzer" diff --git a/crates/stdx/Cargo.toml b/crates/stdx/Cargo.toml index 4c0b85861728..b186b46f2984 100644 --- a/crates/stdx/Cargo.toml +++ b/crates/stdx/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "stdx" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2018" -license = "MIT OR Apache-2.0" [lib] doctest = false diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index e719f4f7c1a4..45e5fb97f7a2 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -1,9 +1,9 @@ [package] -edition = "2018" name = "test_utils" -version = "0.1.0" -authors = ["rust-analyzer developers"] +version = "0.0.0" license = "MIT OR Apache-2.0" +authors = ["rust-analyzer developers"] +edition = "2018" [lib] doctest = false @@ -14,4 +14,5 @@ difference = "2.0.0" text-size = "1.0.0" serde_json = "1.0.48" rustc-hash = "1.1.0" + stdx = { path = "../stdx" } diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index fce7bae3ad81..c1e53f4b150e 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "vfs-notify" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2018" -license = "MIT OR Apache-2.0" [lib] doctest = false diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml index b74cdb7ffa07..9ae8f19b6f90 100644 --- a/crates/vfs/Cargo.toml +++ b/crates/vfs/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "vfs" -version = "0.1.0" +version = "0.0.0" +license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2018" -license = "MIT OR Apache-2.0" [lib] doctest = false diff --git a/docs/dev/README.md b/docs/dev/README.md index 04bebbfca5c9..ad18217f177f 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -14,7 +14,7 @@ To learn more about how rust-analyzer works, see We also publish rustdoc docs to pages: -https://rust-analyzer.github.io/rust-analyzer/ra_ide/ +https://rust-analyzer.github.io/rust-analyzer/ide/ Various organizational and process issues are discussed in this document. @@ -159,7 +159,7 @@ IDE should use only types from `hir`, and should not depend on the underling com ## IDE API -The main IDE crate (`ra_ide`) uses "Plain Old Data" for the API. +The main IDE crate (`ide`) uses "Plain Old Data" for the API. Rather than talking in definitions and references, it talks in Strings and textual offsets. 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. The results are 100% Rust specific though. diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 917f05c81266..6f1377f2f0c5 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -118,7 +118,7 @@ directly query the database. The top-level `hir` façade crate wraps ids into a more OO-flavored API. -### `crates/ra_ide` +### `crates/ide` A stateful library for analyzing many Rust files as they change. `AnalysisHost` 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 ### `crates/rust-analyzer` -An LSP implementation which wraps `ra_ide` into a language server protocol. +An LSP implementation which wraps `ide` into a language server protocol. ### `ra_vfs` -Although `hir` and `ra_ide` don't do any IO, we need to be able to read +Although `hir` and `ide` don't do any IO, we need to be able to read files from disk at the end of the day. This is what `ra_vfs` does. It also manages overlays: "dirty" files in the editor, whose "true" contents is 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: in a statically typed language, it's hard to make an error in the protocol itself if messages are themselves typed. -The middle, and most important, boundary is `ra_ide`. Unlike +The middle, and most important, boundary is `ide`. Unlike `rust-analyzer`, which exposes API, `ide` uses Rust API and is intended to use by various tools. Typical test creates an `AnalysisHost`, calls some `Analysis` functions and compares the results against expectation. diff --git a/docs/dev/guide.md b/docs/dev/guide.md index 29d84bf3f6a4..b5a5d7c9350f 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, traits, etc. The "typed" API with Rust specific types is slightly lower in the stack, we'll talk about it later. -[`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L265-L284 -[`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L291-L478 +[`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L265-L284 +[`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L291-L478 The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply 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 "transaction", so it suffices to study its methods to understand all of the input data. -[`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L119-L167 +[`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L119-L167 The `(add|change|remove)_file` methods control the set of the input files, where 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 `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa database. -[`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/db.rs#L88-L134 +[`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/db.rs#L88-L134 Salsa input queries are defined in [`FilesDatabase`] (which is a part of `RootDatabase`). They closely mirror the familiar `AnalysisChange` structure: @@ -565,11 +565,11 @@ the type to completion. [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 [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps -[ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L439-L444 -[completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L46-L62 -[`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L14-L37 -["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L72-L75 -[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 -[semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L123 -[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 -[`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/complete_dot.rs#L6-L22 +[ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L439-L444 +[completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion.rs#L46-L62 +[`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L14-L37 +["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L72-L75 +[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 +[semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion/completion_context.rs#L123 +[series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/completion.rs#L52-L59 +[`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 97a11a01eeb1..76895aeca025 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -194,7 +194,7 @@ impl TidyDocs { let poorly_documented = [ "hir", "hir_expand", - "ra_ide", + "ide", "mbe", "parser", "profile", From 6bc2633c90cedad057c5201d1ab7f67b57247004 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:58:35 +0200 Subject: [PATCH 2/2] Align parser names with grammar --- crates/parser/src/grammar.rs | 16 ++--- crates/parser/src/grammar/attributes.rs | 10 +-- crates/parser/src/grammar/expressions.rs | 14 ++-- crates/parser/src/grammar/expressions/atom.rs | 20 +++--- crates/parser/src/grammar/items.rs | 54 +++++++------- crates/parser/src/grammar/items/adt.rs | 34 ++++----- crates/parser/src/grammar/items/consts.rs | 4 +- crates/parser/src/grammar/items/traits.rs | 38 +++------- crates/parser/src/grammar/items/use_item.rs | 4 +- crates/parser/src/grammar/params.rs | 12 ++-- crates/parser/src/grammar/paths.rs | 6 +- crates/parser/src/grammar/patterns.rs | 20 +++--- crates/parser/src/grammar/type_args.rs | 6 +- crates/parser/src/grammar/type_params.rs | 12 ++-- crates/parser/src/grammar/types.rs | 20 +++--- .../inline/ok/0001_trait_item_list.rast | 71 ------------------- .../parser/inline/ok/0001_trait_item_list.rs | 6 -- 17 files changed, 124 insertions(+), 223 deletions(-) delete mode 100644 crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast delete mode 100644 crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 9dbd2ebc445d..562e92252b2a 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -142,19 +142,19 @@ pub(crate) fn reparser( ) -> Option { let res = match node { BLOCK_EXPR => expressions::block_expr, - RECORD_FIELD_LIST => items::record_field_def_list, - RECORD_EXPR_FIELD_LIST => items::record_field_list, - VARIANT_LIST => items::enum_variant_list, + RECORD_FIELD_LIST => items::record_field_list, + RECORD_EXPR_FIELD_LIST => items::record_expr_field_list, + VARIANT_LIST => items::variant_list, MATCH_ARM_LIST => items::match_arm_list, USE_TREE_LIST => items::use_tree_list, EXTERN_ITEM_LIST => items::extern_item_list, TOKEN_TREE if first_child? == T!['{'] => items::token_tree, ASSOC_ITEM_LIST => match parent? { - IMPL => items::impl_item_list, - TRAIT => items::trait_item_list, + IMPL => items::assoc_item_list, + TRAIT => items::assoc_item_list, _ => return None, }, - ITEM_LIST => items::mod_item_list, + ITEM_LIST => items::item_list, _ => return None, }; Some(res) @@ -217,7 +217,7 @@ fn opt_visibility(p: &mut Parser) -> bool { true } -fn opt_alias(p: &mut Parser) { +fn opt_rename(p: &mut Parser) { if p.at(T![as]) { let m = p.start(); p.bump(T![as]); @@ -239,7 +239,7 @@ fn abi(p: &mut Parser) { abi.complete(p, ABI); } -fn opt_fn_ret_type(p: &mut Parser) -> bool { +fn opt_ret_type(p: &mut Parser) -> bool { if p.at(T![->]) { let m = p.start(); p.bump(T![->]); diff --git a/crates/parser/src/grammar/attributes.rs b/crates/parser/src/grammar/attributes.rs index f3158ade300b..dab0f62c3caa 100644 --- a/crates/parser/src/grammar/attributes.rs +++ b/crates/parser/src/grammar/attributes.rs @@ -2,19 +2,19 @@ use super::*; -pub(super) fn inner_attributes(p: &mut Parser) { +pub(super) fn inner_attrs(p: &mut Parser) { while p.at(T![#]) && p.nth(1) == T![!] { - attribute(p, true) + attr(p, true) } } -pub(super) fn outer_attributes(p: &mut Parser) { +pub(super) fn outer_attrs(p: &mut Parser) { while p.at(T![#]) { - attribute(p, false) + attr(p, false) } } -fn attribute(p: &mut Parser, inner: bool) { +fn attr(p: &mut Parser, inner: bool) { let attr = p.start(); assert!(p.at(T![#])); p.bump(T![#]); diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 3291e3f1469d..e72929f8ccda 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, BlockLike) { pub(super) fn expr_with_attrs(p: &mut Parser) -> bool { let m = p.start(); let has_attrs = p.at(T![#]); - attributes::outer_attributes(p); + attributes::outer_attrs(p); let (cm, _block_like) = expr(p); let success = cm.is_some(); @@ -64,7 +64,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) { // #[D] return (); // } let has_attrs = p.at(T![#]); - attributes::outer_attributes(p); + attributes::outer_attrs(p); if p.at(T![let]) { let_stmt(p, m, with_semi); @@ -175,7 +175,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) { pub(super) fn expr_block_contents(p: &mut Parser) { // This is checked by a validator - attributes::inner_attributes(p); + attributes::inner_attrs(p); while !p.at(EOF) && !p.at(T!['}']) { // test nocontentexpr @@ -489,7 +489,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { let m = lhs.precede(p); p.bump_any(); name_ref(p); - type_args::opt_type_arg_list(p, true); + type_args::opt_generic_arg_list(p, true); if p.at(T!['(']) { arg_list(p); } @@ -585,7 +585,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { paths::expr_path(p); match p.current() { T!['{'] if !r.forbid_structs => { - record_field_list(p); + record_expr_field_list(p); (m.complete(p, RECORD_EXPR), BlockLike::NotBlock) } T![!] if !p.at(T![!=]) => { @@ -603,7 +603,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { // S { x, y: 32, ..Default::default() }; // TupleStruct { 0: 1 }; // } -pub(crate) fn record_field_list(p: &mut Parser) { +pub(crate) fn record_expr_field_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -613,7 +613,7 @@ pub(crate) fn record_field_list(p: &mut Parser) { // fn main() { // S { #[cfg(test)] field: 1 } // } - attributes::outer_attributes(p); + attributes::outer_attrs(p); match p.current() { IDENT | INT_NUMBER => { diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 0b01d3bc6464..ba6dd2fbcc46 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 T!['('] => tuple_expr(p), T!['['] => array_expr(p), L_DOLLAR => meta_var_expr(p), - T![|] => lambda_expr(p), - T![move] if la == T![|] => lambda_expr(p), - T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => lambda_expr(p), + T![|] => closure_expr(p), + T![move] if la == T![|] => closure_expr(p), + T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p), T![if] => if_expr(p), T![loop] => loop_expr(p, None), @@ -228,7 +228,7 @@ fn array_expr(p: &mut Parser) -> CompletedMarker { // move || {}; // async move || {}; // } -fn lambda_expr(p: &mut Parser) -> CompletedMarker { +fn closure_expr(p: &mut Parser) -> CompletedMarker { assert!( p.at(T![|]) || (p.at(T![move]) && p.nth(1) == T![|]) @@ -239,7 +239,7 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker { p.eat(T![async]); p.eat(T![move]); params::param_list_closure(p); - if opt_fn_ret_type(p) { + if opt_ret_type(p) { // test lambda_ret_block // fn main() { || -> i32 { 92 }(); } block_expr(p); @@ -265,7 +265,7 @@ fn if_expr(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![if])); let m = p.start(); p.bump(T![if]); - cond(p); + condition(p); block_expr(p); if p.at(T![else]) { p.bump(T![else]); @@ -314,7 +314,7 @@ fn while_expr(p: &mut Parser, m: Option) -> CompletedMarker { assert!(p.at(T![while])); let m = m.unwrap_or_else(|| p.start()); p.bump(T![while]); - cond(p); + condition(p); block_expr(p); m.complete(p, WHILE_EXPR) } @@ -342,7 +342,7 @@ fn for_expr(p: &mut Parser, m: Option) -> CompletedMarker { // while let Some(_) | Some(_) = None {} // while let | Some(_) = None {} // } -fn cond(p: &mut Parser) { +fn condition(p: &mut Parser) { let m = p.start(); if p.eat(T![let]) { patterns::pattern_top(p); @@ -386,7 +386,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) { // _ => (), // } // } - attributes::inner_attributes(p); + attributes::inner_attrs(p); while !p.at(EOF) && !p.at(T!['}']) { if p.at(T!['{']) { @@ -437,7 +437,7 @@ fn match_arm(p: &mut Parser) -> BlockLike { // _ => (), // } // } - attributes::outer_attributes(p); + attributes::outer_attrs(p); patterns::pattern_top_r(p, TokenSet::EMPTY); if p.at(T![if]) { diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index d091b0fbb291..b2f7cc21f681 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -6,9 +6,9 @@ mod traits; mod use_item; pub(crate) use self::{ - adt::{enum_variant_list, record_field_def_list}, - expressions::{match_arm_list, record_field_list}, - traits::{impl_item_list, trait_item_list}, + adt::{record_field_list, variant_list}, + expressions::{match_arm_list, record_expr_field_list}, + traits::assoc_item_list, use_item::use_tree_list, }; use super::*; @@ -20,7 +20,7 @@ use super::*; // super::baz! {} // struct S; pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { - attributes::inner_attributes(p); + attributes::inner_attrs(p); while !(stop_on_r_curly && p.at(T!['}']) || p.at(EOF)) { item_or_macro(p, stop_on_r_curly) } @@ -33,7 +33,7 @@ pub(super) const ITEM_RECOVERY_SET: TokenSet = token_set![ pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) { let m = p.start(); - attributes::outer_attributes(p); + attributes::outer_attrs(p); let m = match maybe_item(p, m) { Ok(()) => { if p.at(T![;]) { @@ -144,30 +144,30 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker) -> Result<(), Marker> { // test fn // fn foo() {} T![fn] => { - fn_def(p); + fn_(p); m.complete(p, FN); } // test trait // trait T {} T![trait] => { - traits::trait_def(p); + traits::trait_(p); m.complete(p, TRAIT); } T![const] => { - consts::const_def(p, m); + consts::konst(p, m); } // test impl // impl T for S {} T![impl] => { - traits::impl_def(p); + traits::impl_(p); m.complete(p, IMPL); } T![type] => { - type_def(p, m); + type_alias(p, m); } _ => { if !has_visibility && !has_mods { @@ -190,9 +190,9 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { match p.current() { // test extern_crate // extern crate foo; - T![extern] if la == T![crate] => extern_crate_item(p, m), + T![extern] if la == T![crate] => extern_crate(p, m), T![type] => { - type_def(p, m); + type_alias(p, m); } T![mod] => mod_item(p, m), T![struct] => { @@ -205,7 +205,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { // a: i32, // b: f32, // } - adt::struct_def(p, m); + adt::strukt(p, m); } // test pub_macro_def // pub macro m($:ident) {} @@ -219,12 +219,12 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { // a: i32, // b: f32, // } - adt::union_def(p, m); + adt::union(p, m); } - T![enum] => adt::enum_def(p, m), - T![use] => use_item::use_item(p, m), - T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::const_def(p, m), - T![static] => consts::static_def(p, m), + T![enum] => adt::enum_(p, m), + T![use] => use_item::use_(p, m), + T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::konst(p, m), + T![static] => consts::static_(p, m), // test extern_block // extern {} T![extern] @@ -239,7 +239,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { Ok(()) } -fn extern_crate_item(p: &mut Parser, m: Marker) { +fn extern_crate(p: &mut Parser, m: Marker) { assert!(p.at(T![extern])); p.bump(T![extern]); assert!(p.at(T![crate])); @@ -251,7 +251,7 @@ fn extern_crate_item(p: &mut Parser, m: Marker) { name_ref(p); } - opt_alias(p); + opt_rename(p); p.expect(T![;]); m.complete(p, EXTERN_CRATE); } @@ -265,14 +265,14 @@ pub(crate) fn extern_item_list(p: &mut Parser) { m.complete(p, EXTERN_ITEM_LIST); } -fn fn_def(p: &mut Parser) { +fn fn_(p: &mut Parser) { assert!(p.at(T![fn])); p.bump(T![fn]); name_r(p, ITEM_RECOVERY_SET); // test function_type_params // fn foo(){} - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); if p.at(T!['(']) { params::param_list_fn_def(p); @@ -282,7 +282,7 @@ fn fn_def(p: &mut Parser) { // test function_ret_type // fn foo() {} // fn bar() -> () {} - opt_fn_ret_type(p); + opt_ret_type(p); // test function_where_clause // fn foo() where T: Copy {} @@ -299,7 +299,7 @@ fn fn_def(p: &mut Parser) { // test type_item // type Foo = Bar; -fn type_def(p: &mut Parser, m: Marker) { +fn type_alias(p: &mut Parser, m: Marker) { assert!(p.at(T![type])); p.bump(T![type]); @@ -307,7 +307,7 @@ fn type_def(p: &mut Parser, m: Marker) { // test type_item_type_params // type Result = (); - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); if p.at(T![:]) { type_params::bounds(p); @@ -329,14 +329,14 @@ pub(crate) fn mod_item(p: &mut Parser, m: Marker) { name(p); if p.at(T!['{']) { - mod_item_list(p); + item_list(p); } else if !p.eat(T![;]) { p.error("expected `;` or `{`"); } m.complete(p, MODULE); } -pub(crate) fn mod_item_list(p: &mut Parser) { +pub(crate) fn item_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); diff --git a/crates/parser/src/grammar/items/adt.rs b/crates/parser/src/grammar/items/adt.rs index addfb59d4b1a..67c0c5697071 100644 --- a/crates/parser/src/grammar/items/adt.rs +++ b/crates/parser/src/grammar/items/adt.rs @@ -2,13 +2,13 @@ use super::*; -pub(super) fn struct_def(p: &mut Parser, m: Marker) { +pub(super) fn strukt(p: &mut Parser, m: Marker) { assert!(p.at(T![struct])); p.bump(T![struct]); struct_or_union(p, m, T![struct], STRUCT); } -pub(super) fn union_def(p: &mut Parser, m: Marker) { +pub(super) fn union(p: &mut Parser, m: Marker) { assert!(p.at_contextual_kw("union")); p.bump_remap(T![union]); struct_or_union(p, m, T![union], UNION); @@ -16,7 +16,7 @@ pub(super) fn union_def(p: &mut Parser, m: Marker) { fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { name_r(p, ITEM_RECOVERY_SET); - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); match p.current() { T![where] => { type_params::opt_where_clause(p); @@ -24,7 +24,7 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { T![;] => { p.bump(T![;]); } - T!['{'] => record_field_def_list(p), + T!['{'] => record_field_list(p), _ => { //FIXME: special case `(` error message p.error("expected `;` or `{`"); @@ -34,9 +34,9 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { T![;] if kw == T![struct] => { p.bump(T![;]); } - T!['{'] => record_field_def_list(p), + T!['{'] => record_field_list(p), T!['('] if kw == T![struct] => { - tuple_field_def_list(p); + tuple_field_list(p); // test tuple_struct_where // struct Test(T) where T: Clone; // struct Test(T); @@ -53,21 +53,21 @@ fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { m.complete(p, def); } -pub(super) fn enum_def(p: &mut Parser, m: Marker) { +pub(super) fn enum_(p: &mut Parser, m: Marker) { assert!(p.at(T![enum])); p.bump(T![enum]); name_r(p, ITEM_RECOVERY_SET); - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); type_params::opt_where_clause(p); if p.at(T!['{']) { - enum_variant_list(p); + variant_list(p); } else { p.error("expected `{`") } m.complete(p, ENUM); } -pub(crate) fn enum_variant_list(p: &mut Parser) { +pub(crate) fn variant_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -77,12 +77,12 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { continue; } let var = p.start(); - attributes::outer_attributes(p); + attributes::outer_attrs(p); if p.at(IDENT) { name(p); match p.current() { - T!['{'] => record_field_def_list(p), - T!['('] => tuple_field_def_list(p), + T!['{'] => record_field_list(p), + T!['('] => tuple_field_list(p), _ => (), } @@ -104,7 +104,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { m.complete(p, VARIANT_LIST); } -pub(crate) fn record_field_def_list(p: &mut Parser) { +pub(crate) fn record_field_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -128,7 +128,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { // #[serde(with = "url_serde")] // pub uri: Uri, // } - attributes::outer_attributes(p); + attributes::outer_attrs(p); opt_visibility(p); if p.at(IDENT) { name(p); @@ -142,7 +142,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) { } } -fn tuple_field_def_list(p: &mut Parser) { +fn tuple_field_list(p: &mut Parser) { assert!(p.at(T!['('])); let m = p.start(); if !p.expect(T!['(']) { @@ -159,7 +159,7 @@ fn tuple_field_def_list(p: &mut Parser) { // enum S { // Uri(#[serde(with = "url_serde")] Uri), // } - attributes::outer_attributes(p); + attributes::outer_attrs(p); opt_visibility(p); if !p.at_ts(types::TYPE_FIRST) { p.error("expected a type"); diff --git a/crates/parser/src/grammar/items/consts.rs b/crates/parser/src/grammar/items/consts.rs index 35ad766dcee8..eb7d1f8281de 100644 --- a/crates/parser/src/grammar/items/consts.rs +++ b/crates/parser/src/grammar/items/consts.rs @@ -2,11 +2,11 @@ use super::*; -pub(super) fn static_def(p: &mut Parser, m: Marker) { +pub(super) fn static_(p: &mut Parser, m: Marker) { const_or_static(p, m, T![static], STATIC) } -pub(super) fn const_def(p: &mut Parser, m: Marker) { +pub(super) fn konst(p: &mut Parser, m: Marker) { const_or_static(p, m, T![const], CONST) } diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index 751ce65f2dc9..8394020dafae 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs @@ -5,11 +5,11 @@ use super::*; // test trait_item // trait T: Hash + Clone where U: Copy {} // trait X: Hash + Clone where U: Copy {} -pub(super) fn trait_def(p: &mut Parser) { +pub(super) fn trait_(p: &mut Parser) { assert!(p.at(T![trait])); p.bump(T![trait]); name_r(p, ITEM_RECOVERY_SET); - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); // test trait_alias // trait Z = T; // trait Z = T where U: Copy; @@ -25,41 +25,19 @@ pub(super) fn trait_def(p: &mut Parser) { } type_params::opt_where_clause(p); if p.at(T!['{']) { - trait_item_list(p); + assoc_item_list(p); } else { p.error("expected `{`"); } } -// test trait_item_list -// impl F { -// type A: Clone; -// const B: i32; -// fn foo() {} -// fn bar(&self); -// } -pub(crate) fn trait_item_list(p: &mut Parser) { - assert!(p.at(T!['{'])); - let m = p.start(); - p.bump(T!['{']); - while !p.at(EOF) && !p.at(T!['}']) { - if p.at(T!['{']) { - error_block(p, "expected an item"); - continue; - } - item_or_macro(p, true); - } - p.expect(T!['}']); - m.complete(p, ASSOC_ITEM_LIST); -} - // test impl_def // impl Foo {} -pub(super) fn impl_def(p: &mut Parser) { +pub(super) fn impl_(p: &mut Parser) { assert!(p.at(T![impl])); p.bump(T![impl]); if choose_type_params_over_qpath(p) { - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); } // FIXME: never type @@ -74,7 +52,7 @@ pub(super) fn impl_def(p: &mut Parser) { } type_params::opt_where_clause(p); if p.at(T!['{']) { - impl_item_list(p); + assoc_item_list(p); } else { p.error("expected `{`"); } @@ -87,7 +65,7 @@ pub(super) fn impl_def(p: &mut Parser) { // fn foo() {} // fn bar(&self) {} // } -pub(crate) fn impl_item_list(p: &mut Parser) { +pub(crate) fn assoc_item_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -97,7 +75,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) { // //! This is a doc comment // #![doc("This is also a doc comment")] // } - attributes::inner_attributes(p); + attributes::inner_attrs(p); while !p.at(EOF) && !p.at(T!['}']) { 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 8e836a77e1d4..20e6a13cf96d 100644 --- a/crates/parser/src/grammar/items/use_item.rs +++ b/crates/parser/src/grammar/items/use_item.rs @@ -2,7 +2,7 @@ use super::*; -pub(super) fn use_item(p: &mut Parser, m: Marker) { +pub(super) fn use_(p: &mut Parser, m: Marker) { assert!(p.at(T![use])); p.bump(T![use]); use_tree(p, true); @@ -80,7 +80,7 @@ fn use_tree(p: &mut Parser, top_level: bool) { // running::out::of::synonyms::for_::different::* // }; // use Trait as _; - opt_alias(p); + opt_rename(p); } T![:] if p.at(T![::]) => { p.bump(T![::]); diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs index f0da173cc17a..a665ffc133c9 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) { if let FnDef = flavor { // test self_param_outer_attr // fn f(#[must_use] self) {} - attributes::outer_attributes(p); + attributes::outer_attrs(p); opt_self_param(p); } while !p.at(EOF) && !p.at(ket) { // test param_outer_arg // fn f(#[attr1] pat: Type) {} - attributes::outer_attributes(p); + attributes::outer_attrs(p); - if !p.at_ts(VALUE_PARAMETER_FIRST) { + if !p.at_ts(PARAM_FIRST) { p.error("expected value parameter"); break; } - let param = value_parameter(p, flavor); + let param = param(p, flavor); if !p.at(ket) { p.expect(T![,]); } @@ -73,11 +73,11 @@ fn list_(p: &mut Parser, flavor: Flavor) { m.complete(p, PARAM_LIST); } -const VALUE_PARAMETER_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST); +const PARAM_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST); struct Variadic(bool); -fn value_parameter(p: &mut Parser, flavor: Flavor) -> Variadic { +fn param(p: &mut Parser, flavor: Flavor) -> Variadic { let mut res = Variadic(false); let m = p.start(); match flavor { diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs index b503af1dc945..52562afa41c7 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) { // type F = Box ()>; if p.at(T!['(']) { params::param_list_fn_trait(p); - opt_fn_ret_type(p); + opt_ret_type(p); } else { - type_args::opt_type_arg_list(p, false) + type_args::opt_generic_arg_list(p, false) } } - Mode::Expr => type_args::opt_type_arg_list(p, true), + Mode::Expr => type_args::opt_generic_arg_list(p, true), } } diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs index 716bdc978402..07b1d6dd53c4 100644 --- a/crates/parser/src/grammar/patterns.rs +++ b/crates/parser/src/grammar/patterns.rs @@ -79,13 +79,13 @@ const PAT_RECOVERY_SET: TokenSet = fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option { let m = match p.nth(0) { T![box] => box_pat(p), - T![ref] | T![mut] => bind_pat(p, true), + T![ref] | T![mut] => ident_pat(p, true), IDENT => match p.nth(1) { // Checks the token after an IDENT to see if a pattern is a path (Struct { .. }) or macro // (T![x]). T!['('] | T!['{'] | T![!] => path_or_macro_pat(p), T![:] if p.nth_at(1, T![::]) => path_or_macro_pat(p), - _ => bind_pat(p, true), + _ => ident_pat(p, true), }, // test type_path_in_pattern @@ -93,8 +93,8 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option { _ if paths::is_path_start(p) => path_or_macro_pat(p), _ if is_literal_pat_start(p) => literal_pat(p), - T![.] if p.at(T![..]) => dot_dot_pat(p), - T![_] => placeholder_pat(p), + T![.] if p.at(T![..]) => rest_pat(p), + T![_] => wildcard_pat(p), T![&] => ref_pat(p), T!['('] => tuple_pat(p), T!['['] => slice_pat(p), @@ -149,7 +149,7 @@ fn path_or_macro_pat(p: &mut Parser) -> CompletedMarker { TUPLE_STRUCT_PAT } T!['{'] => { - record_field_pat_list(p); + record_pat_field_list(p); RECORD_PAT } // test marco_pat @@ -186,7 +186,7 @@ fn tuple_pat_fields(p: &mut Parser) { // let S { h: _, ..} = (); // let S { h: _, } = (); // } -fn record_field_pat_list(p: &mut Parser) { +fn record_pat_field_list(p: &mut Parser) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -214,7 +214,7 @@ fn record_field_pat_list(p: &mut Parser) { box_pat(p); } _ => { - bind_pat(p, false); + ident_pat(p, false); } } m.complete(p, RECORD_PAT_FIELD); @@ -230,7 +230,7 @@ fn record_field_pat_list(p: &mut Parser) { // test placeholder_pat // fn main() { let _ = (); } -fn placeholder_pat(p: &mut Parser) -> CompletedMarker { +fn wildcard_pat(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![_])); let m = p.start(); p.bump(T![_]); @@ -263,7 +263,7 @@ fn placeholder_pat(p: &mut Parser) -> CompletedMarker { // let [head, .., mid, tail @ ..] = (); // let [head, .., mid, .., cons] = (); // } -fn dot_dot_pat(p: &mut Parser) -> CompletedMarker { +fn rest_pat(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![..])); let m = p.start(); p.bump(T![..]); @@ -353,7 +353,7 @@ fn pat_list(p: &mut Parser, ket: SyntaxKind) { // let e @ _ = (); // let ref mut f @ g @ _ = (); // } -fn bind_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { +fn ident_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { let m = p.start(); p.eat(T![ref]); p.eat(T![mut]); diff --git a/crates/parser/src/grammar/type_args.rs b/crates/parser/src/grammar/type_args.rs index aef7cd6fbb2d..f2d34a749955 100644 --- a/crates/parser/src/grammar/type_args.rs +++ b/crates/parser/src/grammar/type_args.rs @@ -2,7 +2,7 @@ use super::*; -pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { +pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) { let m; if p.at(T![::]) && p.nth(2) == T![<] { m = p.start(); @@ -16,7 +16,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { } while !p.at(EOF) && !p.at(T![>]) { - type_arg(p); + generic_arg(p); if !p.at(T![>]) && !p.expect(T![,]) { break; } @@ -27,7 +27,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { // test type_arg // type A = B<'static, i32, 1, { 2 }, Item=u64>; -fn type_arg(p: &mut Parser) { +fn generic_arg(p: &mut Parser) { let m = p.start(); match p.current() { LIFETIME => { diff --git a/crates/parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs index 90dabb4c0f10..bc7d8d7244a3 100644 --- a/crates/parser/src/grammar/type_params.rs +++ b/crates/parser/src/grammar/type_params.rs @@ -2,14 +2,14 @@ use super::*; -pub(super) fn opt_type_param_list(p: &mut Parser) { +pub(super) fn opt_generic_param_list(p: &mut Parser) { if !p.at(T![<]) { return; } - type_param_list(p); + generic_param_list(p); } -fn type_param_list(p: &mut Parser) { +fn generic_param_list(p: &mut Parser) { assert!(p.at(T![<])); let m = p.start(); p.bump(T![<]); @@ -20,12 +20,12 @@ fn type_param_list(p: &mut Parser) { // test generic_lifetime_type_attribute // fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { // } - attributes::outer_attributes(p); + attributes::outer_attrs(p); match p.current() { LIFETIME => lifetime_param(p, m), IDENT => type_param(p, m), - CONST_KW => type_const_param(p, m), + CONST_KW => const_param(p, m), _ => { m.abandon(p); p.err_and_bump("expected type parameter") @@ -65,7 +65,7 @@ fn type_param(p: &mut Parser, m: Marker) { // test const_param // struct S; -fn type_const_param(p: &mut Parser, m: Marker) { +fn const_param(p: &mut Parser, m: Marker) { assert!(p.at(CONST_KW)); p.bump(T![const]); name(p); diff --git a/crates/parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs index 0aa173a52b2f..c876545f441d 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) { match p.current() { T!['('] => paren_or_tuple_type(p), T![!] => never_type(p), - T![*] => pointer_type(p), + T![*] => ptr_type(p), T!['['] => array_or_slice_type(p), - T![&] => reference_type(p), - T![_] => placeholder_type(p), - T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), + T![&] => ref_type(p), + T![_] => infer_type(p), + T![fn] | T![unsafe] | T![extern] => fn_ptr_type(p), T![for] => for_type(p), T![impl] => impl_trait_type(p), T![dyn] => dyn_trait_type(p), @@ -96,7 +96,7 @@ fn never_type(p: &mut Parser) { m.complete(p, NEVER_TYPE); } -fn pointer_type(p: &mut Parser) { +fn ptr_type(p: &mut Parser) { assert!(p.at(T![*])); let m = p.start(); p.bump(T![*]); @@ -156,7 +156,7 @@ fn array_or_slice_type(p: &mut Parser) { // type A = &(); // type B = &'static (); // type C = &mut (); -fn reference_type(p: &mut Parser) { +fn ref_type(p: &mut Parser) { assert!(p.at(T![&])); let m = p.start(); p.bump(T![&]); @@ -168,7 +168,7 @@ fn reference_type(p: &mut Parser) { // test placeholder_type // type Placeholder = _; -fn placeholder_type(p: &mut Parser) { +fn infer_type(p: &mut Parser) { assert!(p.at(T![_])); let m = p.start(); p.bump(T![_]); @@ -180,7 +180,7 @@ fn placeholder_type(p: &mut Parser) { // type B = unsafe fn(); // type C = unsafe extern "C" fn(); // type D = extern "C" fn ( u8 , ... ) -> u8; -fn fn_pointer_type(p: &mut Parser) { +fn fn_ptr_type(p: &mut Parser) { let m = p.start(); p.eat(T![unsafe]); if p.at(T![extern]) { @@ -200,7 +200,7 @@ fn fn_pointer_type(p: &mut Parser) { } // test fn_pointer_type_with_ret // type F = fn() -> (); - opt_fn_ret_type(p); + opt_ret_type(p); m.complete(p, FN_PTR_TYPE); } @@ -208,7 +208,7 @@ pub(super) fn for_binder(p: &mut Parser) { assert!(p.at(T![for])); p.bump(T![for]); if p.at(T![<]) { - type_params::opt_type_param_list(p); + type_params::opt_generic_param_list(p); } else { p.error("expected `<`"); } 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 c7289e4008ad..000000000000 --- a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ /dev/null @@ -1,71 +0,0 @@ -SOURCE_FILE@0..83 - IMPL@0..82 - IMPL_KW@0..4 "impl" - WHITESPACE@4..5 " " - PATH_TYPE@5..6 - PATH@5..6 - PATH_SEGMENT@5..6 - NAME_REF@5..6 - IDENT@5..6 "F" - WHITESPACE@6..7 " " - ASSOC_ITEM_LIST@7..82 - L_CURLY@7..8 "{" - WHITESPACE@8..13 "\n " - TYPE_ALIAS@13..27 - TYPE_KW@13..17 "type" - WHITESPACE@17..18 " " - NAME@18..19 - IDENT@18..19 "A" - COLON@19..20 ":" - WHITESPACE@20..21 " " - TYPE_BOUND_LIST@21..26 - TYPE_BOUND@21..26 - PATH_TYPE@21..26 - PATH@21..26 - PATH_SEGMENT@21..26 - NAME_REF@21..26 - IDENT@21..26 "Clone" - SEMICOLON@26..27 ";" - WHITESPACE@27..32 "\n " - CONST@32..45 - CONST_KW@32..37 "const" - WHITESPACE@37..38 " " - NAME@38..39 - IDENT@38..39 "B" - COLON@39..40 ":" - WHITESPACE@40..41 " " - PATH_TYPE@41..44 - PATH@41..44 - PATH_SEGMENT@41..44 - NAME_REF@41..44 - IDENT@41..44 "i32" - SEMICOLON@44..45 ";" - WHITESPACE@45..50 "\n " - FN@50..61 - FN_KW@50..52 "fn" - WHITESPACE@52..53 " " - NAME@53..56 - IDENT@53..56 "foo" - PARAM_LIST@56..58 - L_PAREN@56..57 "(" - R_PAREN@57..58 ")" - WHITESPACE@58..59 " " - BLOCK_EXPR@59..61 - L_CURLY@59..60 "{" - R_CURLY@60..61 "}" - WHITESPACE@61..66 "\n " - FN@66..80 - FN_KW@66..68 "fn" - WHITESPACE@68..69 " " - NAME@69..72 - IDENT@69..72 "bar" - PARAM_LIST@72..79 - L_PAREN@72..73 "(" - SELF_PARAM@73..78 - AMP@73..74 "&" - SELF_KW@74..78 "self" - R_PAREN@78..79 ")" - SEMICOLON@79..80 ";" - WHITESPACE@80..81 "\n" - R_CURLY@81..82 "}" - WHITESPACE@82..83 "\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 a5ec3239f8fe..000000000000 --- a/crates/syntax/test_data/parser/inline/ok/0001_trait_item_list.rs +++ /dev/null @@ -1,6 +0,0 @@ -impl F { - type A: Clone; - const B: i32; - fn foo() {} - fn bar(&self); -}