From 757e593b253b4df7e6fc8bf15a4d4f34c9d484c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 27 Nov 2019 21:32:33 +0300 Subject: [PATCH] rename ra_ide_api -> ra_ide --- Cargo.lock | 8 +++---- README.md | 2 +- crates/ra_batch/Cargo.toml | 2 +- crates/ra_batch/src/lib.rs | 2 +- crates/ra_cli/Cargo.toml | 2 +- crates/ra_cli/src/analysis_bench.rs | 2 +- crates/ra_cli/src/main.rs | 2 +- crates/ra_db/src/lib.rs | 2 +- crates/{ra_ide_api => ra_ide}/Cargo.toml | 4 ++-- crates/{ra_ide_api => ra_ide}/src/assists.rs | 0 .../{ra_ide_api => ra_ide}/src/call_info.rs | 0 crates/{ra_ide_api => ra_ide}/src/change.rs | 0 .../{ra_ide_api => ra_ide}/src/completion.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_path.rs | 0 .../src/completion/complete_pattern.rs | 0 .../src/completion/complete_postfix.rs | 0 .../src/completion/complete_record_literal.rs | 0 .../src/completion/complete_record_pattern.rs | 0 .../src/completion/complete_scope.rs | 0 .../src/completion/complete_snippet.rs | 0 .../src/completion/completion_context.rs | 0 .../src/completion/completion_item.rs | 0 .../src/completion/presentation.rs | 0 crates/{ra_ide_api => ra_ide}/src/db.rs | 0 .../{ra_ide_api => ra_ide}/src/diagnostics.rs | 0 crates/{ra_ide_api => ra_ide}/src/display.rs | 0 .../src/display/function_signature.rs | 0 .../src/display/navigation_target.rs | 0 .../src/display/short_label.rs | 0 .../src/display/structure.rs | 0 crates/{ra_ide_api => ra_ide}/src/expand.rs | 0 .../src/expand_macro.rs | 0 .../src/extend_selection.rs | 0 .../src/feature_flags.rs | 0 .../src/folding_ranges.rs | 0 .../src/goto_definition.rs | 0 .../src/goto_type_definition.rs | 0 crates/{ra_ide_api => ra_ide}/src/hover.rs | 0 crates/{ra_ide_api => ra_ide}/src/impls.rs | 0 .../{ra_ide_api => ra_ide}/src/inlay_hints.rs | 0 .../{ra_ide_api => ra_ide}/src/join_lines.rs | 0 crates/{ra_ide_api => ra_ide}/src/lib.rs | 2 +- .../{ra_ide_api => ra_ide}/src/line_index.rs | 0 .../src/line_index_utils.rs | 0 crates/{ra_ide_api => ra_ide}/src/marks.rs | 0 .../src/matching_brace.rs | 0 .../src/mock_analysis.rs | 0 .../src/parent_module.rs | 0 .../{ra_ide_api => ra_ide}/src/references.rs | 0 .../src/references/classify.rs | 0 .../src/references/name_definition.rs | 0 .../src/references/rename.rs | 0 .../src/references/search_scope.rs | 0 .../{ra_ide_api => ra_ide}/src/runnables.rs | 0 .../src/snapshots/highlighting.html | 0 .../src/snapshots/rainbow_highlighting.html | 0 .../src/source_change.rs | 0 crates/{ra_ide_api => ra_ide}/src/status.rs | 0 .../src/symbol_index.rs | 0 .../src/syntax_highlighting.rs | 4 ++-- .../{ra_ide_api => ra_ide}/src/syntax_tree.rs | 0 .../{ra_ide_api => ra_ide}/src/test_utils.rs | 0 crates/{ra_ide_api => ra_ide}/src/typing.rs | 0 .../{ra_ide_api => ra_ide}/src/wasm_shims.rs | 0 crates/ra_lsp_server/Cargo.toml | 2 +- crates/ra_lsp_server/src/cargo_target_spec.rs | 2 +- crates/ra_lsp_server/src/conv.rs | 6 ++--- crates/ra_lsp_server/src/lib.rs | 2 +- crates/ra_lsp_server/src/main_loop.rs | 2 +- .../ra_lsp_server/src/main_loop/handlers.rs | 6 ++--- .../src/main_loop/subscriptions.rs | 2 +- crates/ra_lsp_server/src/world.rs | 2 +- docs/dev/README.md | 2 +- docs/dev/architecture.md | 12 +++++----- docs/dev/guide.md | 24 +++++++++---------- editors/code/src/utils/terminateProcess.sh | 0 xtask/tests/tidy-tests/docs.rs | 2 +- 81 files changed, 48 insertions(+), 48 deletions(-) rename crates/{ra_ide_api => ra_ide}/Cargo.toml (91%) rename crates/{ra_ide_api => ra_ide}/src/assists.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/call_info.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/change.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_dot.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_fn_param.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_keyword.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_macro_in_item_position.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_path.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_pattern.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_postfix.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_record_literal.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_record_pattern.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_scope.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/complete_snippet.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/completion_context.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/completion_item.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/completion/presentation.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/db.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/diagnostics.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/display.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/display/function_signature.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/display/navigation_target.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/display/short_label.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/display/structure.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/expand.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/expand_macro.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/extend_selection.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/feature_flags.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/folding_ranges.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/goto_definition.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/goto_type_definition.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/hover.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/impls.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/inlay_hints.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/join_lines.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/lib.rs (99%) rename crates/{ra_ide_api => ra_ide}/src/line_index.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/line_index_utils.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/marks.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/matching_brace.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/mock_analysis.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/parent_module.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/references.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/references/classify.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/references/name_definition.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/references/rename.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/references/search_scope.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/runnables.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/snapshots/highlighting.html (100%) rename crates/{ra_ide_api => ra_ide}/src/snapshots/rainbow_highlighting.html (100%) rename crates/{ra_ide_api => ra_ide}/src/source_change.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/status.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/symbol_index.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/syntax_highlighting.rs (98%) rename crates/{ra_ide_api => ra_ide}/src/syntax_tree.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/test_utils.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/typing.rs (100%) rename crates/{ra_ide_api => ra_ide}/src/wasm_shims.rs (100%) mode change 100755 => 100644 editors/code/src/utils/terminateProcess.sh diff --git a/Cargo.lock b/Cargo.lock index 0f7a45d6cb7..b0a0e841c83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -906,7 +906,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "ra_db 0.1.0", "ra_hir 0.1.0", - "ra_ide_api 0.1.0", + "ra_ide 0.1.0", "ra_project_model 0.1.0", "ra_vfs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "ra_vfs_glob 0.1.0", @@ -932,7 +932,7 @@ dependencies = [ "ra_batch 0.1.0", "ra_db 0.1.0", "ra_hir 0.1.0", - "ra_ide_api 0.1.0", + "ra_ide 0.1.0", "ra_prof 0.1.0", "ra_syntax 0.1.0", ] @@ -1027,7 +1027,7 @@ dependencies = [ ] [[package]] -name = "ra_ide_api" +name = "ra_ide" version = "0.1.0" dependencies = [ "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1065,7 +1065,7 @@ dependencies = [ "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ra_ide_api 0.1.0", + "ra_ide 0.1.0", "ra_prof 0.1.0", "ra_project_model 0.1.0", "ra_syntax 0.1.0", diff --git a/README.md b/README.md index ea1c25d7f12..74c971c0d3d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 ## Quick Links -* API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/ +* API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide/ ## License diff --git a/crates/ra_batch/Cargo.toml b/crates/ra_batch/Cargo.toml index 35626d77d2d..3bf351fe377 100644 --- a/crates/ra_batch/Cargo.toml +++ b/crates/ra_batch/Cargo.toml @@ -15,6 +15,6 @@ crossbeam-channel = "0.4.0" ra_vfs = "0.5.0" ra_vfs_glob = { path = "../ra_vfs_glob" } ra_db = { path = "../ra_db" } -ra_ide_api = { path = "../ra_ide_api" } +ra_ide = { path = "../ra_ide" } ra_hir = { path = "../ra_hir" } ra_project_model = { path = "../ra_project_model" } diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index cb389eb2612..2c9645c00a3 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -6,7 +6,7 @@ use rustc_hash::FxHashMap; use crossbeam_channel::{unbounded, Receiver}; use ra_db::{CrateGraph, FileId, SourceRootId}; -use ra_ide_api::{AnalysisChange, AnalysisHost, FeatureFlags}; +use ra_ide::{AnalysisChange, AnalysisHost, FeatureFlags}; use ra_project_model::{get_rustc_cfg_options, PackageRoot, ProjectWorkspace}; use ra_vfs::{RootEntry, Vfs, VfsChange, VfsTask, Watch}; use ra_vfs_glob::RustPackageFilterBuilder; diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml index 3bb47599792..c7e0d0f0f33 100644 --- a/crates/ra_cli/Cargo.toml +++ b/crates/ra_cli/Cargo.toml @@ -10,7 +10,7 @@ pico-args = "0.3.0" flexi_logger = "0.14.0" ra_syntax = { path = "../ra_syntax" } -ra_ide_api = { path = "../ra_ide_api" } +ra_ide = { path = "../ra_ide" } ra_batch = { path = "../ra_batch" } ra_hir = { path = "../ra_hir" } ra_db = { path = "../ra_db" } diff --git a/crates/ra_cli/src/analysis_bench.rs b/crates/ra_cli/src/analysis_bench.rs index 34105af57f3..5485a38ff27 100644 --- a/crates/ra_cli/src/analysis_bench.rs +++ b/crates/ra_cli/src/analysis_bench.rs @@ -10,7 +10,7 @@ use ra_db::{ salsa::{Database, Durability}, FileId, SourceDatabaseExt, }; -use ra_ide_api::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; +use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; use crate::Result; diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 08f35314770..fe847e61129 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -9,7 +9,7 @@ use std::{error::Error, fmt::Write, io::Read}; use flexi_logger::Logger; use pico_args::Arguments; -use ra_ide_api::{file_structure, Analysis}; +use ra_ide::{file_structure, Analysis}; use ra_prof::profile; use ra_syntax::{AstNode, SourceFile}; diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index e8852531bfb..21341b7697d 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -1,4 +1,4 @@ -//! ra_db defines basic database traits. The concrete DB is defined by ra_ide_api. +//! ra_db defines basic database traits. The concrete DB is defined by ra_ide. mod cancellation; mod input; pub mod fixture; diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide/Cargo.toml similarity index 91% rename from crates/ra_ide_api/Cargo.toml rename to crates/ra_ide/Cargo.toml index 15346f38812..e6383dd3528 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2018" -name = "ra_ide_api" +name = "ra_ide" version = "0.1.0" authors = ["rust-analyzer developers"] @@ -32,7 +32,7 @@ ra_prof = { path = "../ra_prof" } test_utils = { path = "../test_utils" } ra_assists = { path = "../ra_assists" } -# ra_ide_api should depend only on the top-level `hir` package. if you need +# ra_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 = "../ra_hir", package = "ra_hir" } diff --git a/crates/ra_ide_api/src/assists.rs b/crates/ra_ide/src/assists.rs similarity index 100% rename from crates/ra_ide_api/src/assists.rs rename to crates/ra_ide/src/assists.rs diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide/src/call_info.rs similarity index 100% rename from crates/ra_ide_api/src/call_info.rs rename to crates/ra_ide/src/call_info.rs diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide/src/change.rs similarity index 100% rename from crates/ra_ide_api/src/change.rs rename to crates/ra_ide/src/change.rs diff --git a/crates/ra_ide_api/src/completion.rs b/crates/ra_ide/src/completion.rs similarity index 100% rename from crates/ra_ide_api/src/completion.rs rename to crates/ra_ide/src/completion.rs diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_dot.rs rename to crates/ra_ide/src/completion/complete_dot.rs diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_fn_param.rs rename to crates/ra_ide/src/completion/complete_fn_param.rs diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_keyword.rs rename to crates/ra_ide/src/completion/complete_keyword.rs diff --git a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs rename to crates/ra_ide/src/completion/complete_macro_in_item_position.rs diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_path.rs rename to crates/ra_ide/src/completion/complete_path.rs diff --git a/crates/ra_ide_api/src/completion/complete_pattern.rs b/crates/ra_ide/src/completion/complete_pattern.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_pattern.rs rename to crates/ra_ide/src/completion/complete_pattern.rs diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_postfix.rs rename to crates/ra_ide/src/completion/complete_postfix.rs diff --git a/crates/ra_ide_api/src/completion/complete_record_literal.rs b/crates/ra_ide/src/completion/complete_record_literal.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_record_literal.rs rename to crates/ra_ide/src/completion/complete_record_literal.rs diff --git a/crates/ra_ide_api/src/completion/complete_record_pattern.rs b/crates/ra_ide/src/completion/complete_record_pattern.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_record_pattern.rs rename to crates/ra_ide/src/completion/complete_record_pattern.rs diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_scope.rs rename to crates/ra_ide/src/completion/complete_scope.rs diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs similarity index 100% rename from crates/ra_ide_api/src/completion/complete_snippet.rs rename to crates/ra_ide/src/completion/complete_snippet.rs diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs similarity index 100% rename from crates/ra_ide_api/src/completion/completion_context.rs rename to crates/ra_ide/src/completion/completion_context.rs diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide/src/completion/completion_item.rs similarity index 100% rename from crates/ra_ide_api/src/completion/completion_item.rs rename to crates/ra_ide/src/completion/completion_item.rs diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs similarity index 100% rename from crates/ra_ide_api/src/completion/presentation.rs rename to crates/ra_ide/src/completion/presentation.rs diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide/src/db.rs similarity index 100% rename from crates/ra_ide_api/src/db.rs rename to crates/ra_ide/src/db.rs diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs similarity index 100% rename from crates/ra_ide_api/src/diagnostics.rs rename to crates/ra_ide/src/diagnostics.rs diff --git a/crates/ra_ide_api/src/display.rs b/crates/ra_ide/src/display.rs similarity index 100% rename from crates/ra_ide_api/src/display.rs rename to crates/ra_ide/src/display.rs diff --git a/crates/ra_ide_api/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs similarity index 100% rename from crates/ra_ide_api/src/display/function_signature.rs rename to crates/ra_ide/src/display/function_signature.rs diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs similarity index 100% rename from crates/ra_ide_api/src/display/navigation_target.rs rename to crates/ra_ide/src/display/navigation_target.rs diff --git a/crates/ra_ide_api/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs similarity index 100% rename from crates/ra_ide_api/src/display/short_label.rs rename to crates/ra_ide/src/display/short_label.rs diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs similarity index 100% rename from crates/ra_ide_api/src/display/structure.rs rename to crates/ra_ide/src/display/structure.rs diff --git a/crates/ra_ide_api/src/expand.rs b/crates/ra_ide/src/expand.rs similarity index 100% rename from crates/ra_ide_api/src/expand.rs rename to crates/ra_ide/src/expand.rs diff --git a/crates/ra_ide_api/src/expand_macro.rs b/crates/ra_ide/src/expand_macro.rs similarity index 100% rename from crates/ra_ide_api/src/expand_macro.rs rename to crates/ra_ide/src/expand_macro.rs diff --git a/crates/ra_ide_api/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs similarity index 100% rename from crates/ra_ide_api/src/extend_selection.rs rename to crates/ra_ide/src/extend_selection.rs diff --git a/crates/ra_ide_api/src/feature_flags.rs b/crates/ra_ide/src/feature_flags.rs similarity index 100% rename from crates/ra_ide_api/src/feature_flags.rs rename to crates/ra_ide/src/feature_flags.rs diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs similarity index 100% rename from crates/ra_ide_api/src/folding_ranges.rs rename to crates/ra_ide/src/folding_ranges.rs diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs similarity index 100% rename from crates/ra_ide_api/src/goto_definition.rs rename to crates/ra_ide/src/goto_definition.rs diff --git a/crates/ra_ide_api/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs similarity index 100% rename from crates/ra_ide_api/src/goto_type_definition.rs rename to crates/ra_ide/src/goto_type_definition.rs diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide/src/hover.rs similarity index 100% rename from crates/ra_ide_api/src/hover.rs rename to crates/ra_ide/src/hover.rs diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide/src/impls.rs similarity index 100% rename from crates/ra_ide_api/src/impls.rs rename to crates/ra_ide/src/impls.rs diff --git a/crates/ra_ide_api/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs similarity index 100% rename from crates/ra_ide_api/src/inlay_hints.rs rename to crates/ra_ide/src/inlay_hints.rs diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide/src/join_lines.rs similarity index 100% rename from crates/ra_ide_api/src/join_lines.rs rename to crates/ra_ide/src/join_lines.rs diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide/src/lib.rs similarity index 99% rename from crates/ra_ide_api/src/lib.rs rename to crates/ra_ide/src/lib.rs index cb6c24eaa58..d1bff4a761e 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -1,4 +1,4 @@ -//! ra_ide_api crate provides "ide-centric" APIs for the rust-analyzer. That is, +//! ra_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_api/src/line_index.rs b/crates/ra_ide/src/line_index.rs similarity index 100% rename from crates/ra_ide_api/src/line_index.rs rename to crates/ra_ide/src/line_index.rs diff --git a/crates/ra_ide_api/src/line_index_utils.rs b/crates/ra_ide/src/line_index_utils.rs similarity index 100% rename from crates/ra_ide_api/src/line_index_utils.rs rename to crates/ra_ide/src/line_index_utils.rs diff --git a/crates/ra_ide_api/src/marks.rs b/crates/ra_ide/src/marks.rs similarity index 100% rename from crates/ra_ide_api/src/marks.rs rename to crates/ra_ide/src/marks.rs diff --git a/crates/ra_ide_api/src/matching_brace.rs b/crates/ra_ide/src/matching_brace.rs similarity index 100% rename from crates/ra_ide_api/src/matching_brace.rs rename to crates/ra_ide/src/matching_brace.rs diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs similarity index 100% rename from crates/ra_ide_api/src/mock_analysis.rs rename to crates/ra_ide/src/mock_analysis.rs diff --git a/crates/ra_ide_api/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs similarity index 100% rename from crates/ra_ide_api/src/parent_module.rs rename to crates/ra_ide/src/parent_module.rs diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide/src/references.rs similarity index 100% rename from crates/ra_ide_api/src/references.rs rename to crates/ra_ide/src/references.rs diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs similarity index 100% rename from crates/ra_ide_api/src/references/classify.rs rename to crates/ra_ide/src/references/classify.rs diff --git a/crates/ra_ide_api/src/references/name_definition.rs b/crates/ra_ide/src/references/name_definition.rs similarity index 100% rename from crates/ra_ide_api/src/references/name_definition.rs rename to crates/ra_ide/src/references/name_definition.rs diff --git a/crates/ra_ide_api/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs similarity index 100% rename from crates/ra_ide_api/src/references/rename.rs rename to crates/ra_ide/src/references/rename.rs diff --git a/crates/ra_ide_api/src/references/search_scope.rs b/crates/ra_ide/src/references/search_scope.rs similarity index 100% rename from crates/ra_ide_api/src/references/search_scope.rs rename to crates/ra_ide/src/references/search_scope.rs diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide/src/runnables.rs similarity index 100% rename from crates/ra_ide_api/src/runnables.rs rename to crates/ra_ide/src/runnables.rs diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html similarity index 100% rename from crates/ra_ide_api/src/snapshots/highlighting.html rename to crates/ra_ide/src/snapshots/highlighting.html diff --git a/crates/ra_ide_api/src/snapshots/rainbow_highlighting.html b/crates/ra_ide/src/snapshots/rainbow_highlighting.html similarity index 100% rename from crates/ra_ide_api/src/snapshots/rainbow_highlighting.html rename to crates/ra_ide/src/snapshots/rainbow_highlighting.html diff --git a/crates/ra_ide_api/src/source_change.rs b/crates/ra_ide/src/source_change.rs similarity index 100% rename from crates/ra_ide_api/src/source_change.rs rename to crates/ra_ide/src/source_change.rs diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide/src/status.rs similarity index 100% rename from crates/ra_ide_api/src/status.rs rename to crates/ra_ide/src/status.rs diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide/src/symbol_index.rs similarity index 100% rename from crates/ra_ide_api/src/symbol_index.rs rename to crates/ra_ide/src/symbol_index.rs diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs similarity index 98% rename from crates/ra_ide_api/src/syntax_highlighting.rs rename to crates/ra_ide/src/syntax_highlighting.rs index 10165a9bbc9..2c568a747e8 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -306,7 +306,7 @@ fn main() { "# .trim(), ); - let dst_file = project_dir().join("crates/ra_ide_api/src/snapshots/highlighting.html"); + let dst_file = project_dir().join("crates/ra_ide/src/snapshots/highlighting.html"); let actual_html = &analysis.highlight_as_html(file_id, false).unwrap(); let expected_html = &read_text(&dst_file); std::fs::write(dst_file, &actual_html).unwrap(); @@ -333,7 +333,7 @@ fn bar() { .trim(), ); let dst_file = - project_dir().join("crates/ra_ide_api/src/snapshots/rainbow_highlighting.html"); + project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); let expected_html = &read_text(&dst_file); std::fs::write(dst_file, &actual_html).unwrap(); diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs similarity index 100% rename from crates/ra_ide_api/src/syntax_tree.rs rename to crates/ra_ide/src/syntax_tree.rs diff --git a/crates/ra_ide_api/src/test_utils.rs b/crates/ra_ide/src/test_utils.rs similarity index 100% rename from crates/ra_ide_api/src/test_utils.rs rename to crates/ra_ide/src/test_utils.rs diff --git a/crates/ra_ide_api/src/typing.rs b/crates/ra_ide/src/typing.rs similarity index 100% rename from crates/ra_ide_api/src/typing.rs rename to crates/ra_ide/src/typing.rs diff --git a/crates/ra_ide_api/src/wasm_shims.rs b/crates/ra_ide/src/wasm_shims.rs similarity index 100% rename from crates/ra_ide_api/src/wasm_shims.rs rename to crates/ra_ide/src/wasm_shims.rs diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 58b9cfaa00b..21aef842ce6 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml @@ -22,7 +22,7 @@ jod-thread = "0.1.0" ra_vfs = "0.5.0" ra_syntax = { path = "../ra_syntax" } ra_text_edit = { path = "../ra_text_edit" } -ra_ide_api = { path = "../ra_ide_api" } +ra_ide = { path = "../ra_ide" } lsp-server = "0.3.0" ra_project_model = { path = "../ra_project_model" } ra_prof = { path = "../ra_prof" } diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/ra_lsp_server/src/cargo_target_spec.rs index d996b53de43..c4a9e71018f 100644 --- a/crates/ra_lsp_server/src/cargo_target_spec.rs +++ b/crates/ra_lsp_server/src/cargo_target_spec.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use ra_ide_api::{FileId, RunnableKind}; +use ra_ide::{FileId, RunnableKind}; use ra_project_model::{self, ProjectWorkspace, TargetKind}; use crate::{world::WorldSnapshot, Result}; diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 94ed619faec..b13093cfe65 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -6,7 +6,7 @@ use lsp_types::{ SymbolKind, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, WorkspaceEdit, }; -use ra_ide_api::{ +use ra_ide::{ translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, NavigationTarget, RangeInfo, Severity, SourceChange, SourceFileEdit, @@ -173,7 +173,7 @@ impl ConvWith<&LineIndex> for Range { } } -impl Conv for ra_ide_api::Documentation { +impl Conv for ra_ide::Documentation { type Output = lsp_types::Documentation; fn conv(self) -> Documentation { Documentation::MarkupContent(MarkupContent { @@ -183,7 +183,7 @@ impl Conv for ra_ide_api::Documentation { } } -impl Conv for ra_ide_api::FunctionSignature { +impl Conv for ra_ide::FunctionSignature { type Output = lsp_types::SignatureInformation; fn conv(self) -> Self::Output { use lsp_types::{ParameterInformation, ParameterLabel, SignatureInformation}; diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs index 9c36402b0b9..2ca149fd56b 100644 --- a/crates/ra_lsp_server/src/lib.rs +++ b/crates/ra_lsp_server/src/lib.rs @@ -1,6 +1,6 @@ //! Implementation of the LSP for rust-analyzer. //! -//! This crate takes Rust-specific analysis results from ra_ide_api and +//! This crate takes Rust-specific analysis results from ra_ide and //! translates into LSP types. //! //! It also is the root of all state. `world` module defines the bulk of the diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 0dc0aeee864..83845f1e006 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -9,7 +9,7 @@ use std::{error::Error, fmt, panic, path::PathBuf, sync::Arc, time::Instant}; use crossbeam_channel::{select, unbounded, RecvError, Sender}; use lsp_server::{Connection, ErrorCode, Message, Notification, Request, RequestId, Response}; use lsp_types::{ClientCapabilities, NumberOrString}; -use ra_ide_api::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; +use ra_ide::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; use ra_prof::profile; use ra_vfs::{VfsTask, Watch}; use relative_path::RelativePathBuf; diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index e552f2106de..c81fa7f679c 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -9,7 +9,7 @@ use lsp_types::{ Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, }; -use ra_ide_api::{ +use ra_ide::{ AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind, SearchScope, }; use ra_prof::profile; @@ -162,7 +162,7 @@ pub fn handle_on_type_formatting( let line_index = world.analysis().file_line_index(position.file_id)?; let line_endings = world.file_line_endings(position.file_id); - // in `ra_ide_api`, the `on_type` invariant is that + // in `ra_ide`, the `on_type` invariant is that // `text.char_at(position) == typed_char`. position.offset = position.offset - TextUnit::of_char('.'); let char_typed = params.ch.chars().next().unwrap_or('\0'); @@ -894,7 +894,7 @@ pub fn handle_inlay_hints( label: api_type.label.to_string(), range: api_type.range.conv_with(&line_index), kind: match api_type.kind { - ra_ide_api::InlayKind::TypeHint => InlayKind::TypeHint, + ra_ide::InlayKind::TypeHint => InlayKind::TypeHint, }, }) .collect()) diff --git a/crates/ra_lsp_server/src/main_loop/subscriptions.rs b/crates/ra_lsp_server/src/main_loop/subscriptions.rs index 3856263b0a9..609b2adcc99 100644 --- a/crates/ra_lsp_server/src/main_loop/subscriptions.rs +++ b/crates/ra_lsp_server/src/main_loop/subscriptions.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use ra_ide_api::FileId; +use ra_ide::FileId; use rustc_hash::FxHashSet; #[derive(Default, Debug)] diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index 9bdea70c745..927449b45da 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs @@ -9,7 +9,7 @@ use crossbeam_channel::{unbounded, Receiver}; use lsp_server::ErrorCode; use lsp_types::Url; use parking_lot::RwLock; -use ra_ide_api::{ +use ra_ide::{ Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, SourceRootId, }; diff --git a/docs/dev/README.md b/docs/dev/README.md index 0823ca09ab1..0f64d7e5f8c 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_api/ +https://rust-analyzer.github.io/rust-analyzer/ra_ide/ Various organizational and process issues are discussed in this document. diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 6fd396dee6e..629645757a1 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -106,7 +106,7 @@ guessing a HIR for a particular source position. Underneath, HIR works on top of salsa, using a `HirDatabase` trait. -### `crates/ra_ide_api` +### `crates/ra_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 @@ -124,11 +124,11 @@ offsets and strings as output. This works on top of rich code model powered by ### `crates/ra_lsp_server` -An LSP implementation which wraps `ra_ide_api` into a language server protocol. +An LSP implementation which wraps `ra_ide` into a language server protocol. ### `ra_vfs` -Although `hir` and `ra_ide_api` don't do any IO, we need to be able to read +Although `hir` and `ra_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 @@ -162,13 +162,13 @@ 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_api`. Unlike -`ra_lsp_server`, which exposes API, `ide_api` uses Rust API and is intended to +The middle, and most important, boundary is `ra_ide`. Unlike +`ra_lsp_server`, 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. The innermost and most elaborate boundary is `hir`. It has a much richer -vocabulary of types than `ide_api`, but the basic testing setup is the same: we +vocabulary of types than `ide`, but the basic testing setup is the same: we create a database, run some queries, assert result. For comparisons, we use [insta](https://github.com/mitsuhiko/insta/) library for diff --git a/docs/dev/guide.md b/docs/dev/guide.md index abbe4c15424..c163a74b31d 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/ra_ide/src/lib.rs#L265-L284 +[`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/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/ra_ide/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/ra_ide/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/ra_ide/src/lib.rs#L439-L444 +[completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion.rs#L46-L62 +[`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L14-L37 +["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/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/src/completion/completion_context.rs#L116-L120 +[semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/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/src/completion.rs#L52-L59 +[`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/complete_dot.rs#L6-L22 diff --git a/editors/code/src/utils/terminateProcess.sh b/editors/code/src/utils/terminateProcess.sh old mode 100755 new mode 100644 diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index e0653b460f2..8a005d6c4dc 100644 --- a/xtask/tests/tidy-tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs @@ -74,7 +74,7 @@ fn no_docs_comments() { "ra_db", "ra_hir", "ra_hir_expand", - "ra_ide_api", + "ra_ide", "ra_lsp_server", "ra_mbe", "ra_parser",