| /third_party/rust/rust/src/tools/rust-analyzer/ |
| D | Cargo.toml | 3 exclude = ["crates/proc-macro-test/imp"] 7 rust-version = "1.66" 9 license = "MIT OR Apache-2.0" 10 authors = ["rust-analyzer team"] 19 rowan.opt-level = 3 20 rustc-hash.opt-level = 3 21 smol_str.opt-level = 3 22 text-size.opt-level = 3 24 miniz_oxide.opt-level = 3 31 [patch.'crates-io'] [all …]
|
| D | Cargo.lock | 8 source = "registry+https://github.com/rust-lang/crates.io-index" 17 source = "registry+https://github.com/rust-lang/crates.io-index" 21 name = "always-assert" 23 source = "registry+https://github.com/rust-lang/crates.io-index" 32 source = "registry+https://github.com/rust-lang/crates.io-index" 37 version = "1.0.0-beta.2" 38 source = "registry+https://github.com/rust-lang/crates.io-index" 44 source = "registry+https://github.com/rust-lang/crates.io-index" 50 source = "registry+https://github.com/rust-lang/crates.io-index" 56 source = "registry+https://github.com/rust-lang/crates.io-index" [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/.github/workflows/ |
| D | autopublish.yaml | 6 # - cron: "0 0 * * *" # midnight UTC 10 - release 15 runs-on: ubuntu-latest 17 - name: Checkout repository 20 fetch-depth: 0 22 - name: Install Rust toolchain 23 run: rustup update --no-self-update stable 25 - name: Install cargo-workspaces 26 run: cargo install cargo-workspaces 28 - name: Publish Crates [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide/ |
| D | Cargo.toml | 2 name = "ide" 9 rust-version.workspace = true 15 cov-mark = "2.0.0-pre.1" 16 crossbeam-channel = "0.5.5" 21 pulldown-cmark-to-cmark = "10.0.4" 22 pulldown-cmark = { version = "0.9.1", default-features = false } 27 nohash-hasher.workspace = true 31 ide-assists.workspace = true 32 ide-completion.workspace = true 33 ide-db.workspace = true [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-completion/ |
| D | Cargo.toml | 2 name = "ide-completion" 9 rust-version.workspace = true 15 cov-mark = "2.0.0-pre.1" 23 base-db.workspace = true 24 ide-db.workspace = true 28 text-edit.workspace = true 29 # completions crate should depend only on the top-level `hir` package. if you need 30 # something from some `hir-xxx` subpackage, reexport the API via `hir`. 33 [dev-dependencies] 34 expect-test = "1.4.0" [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-db/src/ |
| D | helpers.rs | 1 //! Random assortment of ide helpers for high-level ide features that don't fit in any other module. 14 pub fn item_name(db: &RootDatabase, item: ItemInNs) -> Option<Name> { in item_name() 16 ItemInNs::Types(module_def_id) => module_def_id.name(db), in item_name() 17 ItemInNs::Values(module_def_id) => module_def_id.name(db), in item_name() 18 ItemInNs::Macros(macro_def_id) => Some(macro_def_id.name(db)), in item_name() 25 f: impl Fn(SyntaxKind) -> usize, in pick_best_token() 26 ) -> Option<SyntaxToken> { in pick_best_token() 29 pub fn pick_token<T: AstToken>(mut tokens: TokenAtOffset<SyntaxToken>) -> Option<T> { in pick_token() 34 pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path { in mod_path_to_ast() 63 let db = sema.db; in visit_file_defs() localVariable [all …]
|
| D | apply_change.rs | 1 //! Applies changes to the IDE state transactionally. 45 // Clears rust-analyzer's internal database and prints memory usage statistics. 50 // | VS Code | **rust-analyzer: Memory Usage (Clears Database)** 52 …// image::https://user-images.githubusercontent.com/48062697/113065592-08559f00-91b1-11eb-8c96-64b… 53 pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes, usize)> { in per_query_memory_usage() 56 fn collect_query_count<'q, Q>(table: &QueryTable<'q, Q>) -> usize in per_query_memory_usage() 64 fn from_iter<T>(iter: T) -> EntryCounter in per_query_memory_usage() 83 acc.push((name, before - after, count)); in per_query_memory_usage() 99 hir::db::AstIdMapQuery in per_query_memory_usage() 100 hir::db::ParseMacroExpansionQuery in per_query_memory_usage() [all …]
|
| D | famous_defs.rs | 8 /// Helps with finding well-know things inside the standard library. This is 10 /// want to make sure that IDE specific paths don't become interesting inside 13 /// Note that, by default, rust-analyzer tests **do not** include core or std 19 /// //- minicore: iterator, ord, derive 25 pub fn std(&self) -> Option<Crate> { in std() 29 pub fn core(&self) -> Option<Crate> { in core() 33 pub fn alloc(&self) -> Option<Crate> { in alloc() 37 pub fn test(&self) -> Option<Crate> { in test() 41 pub fn proc_macro(&self) -> Option<Crate> { in proc_macro() 45 pub fn core_cmp_Ord(&self) -> Option<Trait> { in core_cmp_Ord() [all …]
|
| D | lib.rs | 1 //! This crate defines the core datastructure representing IDE state -- `RootDatabase`. 51 use hir::db::{DefDatabase, ExpandDatabase, HirDatabase}; 59 /// `base_db` is normally also needed in places where `ide_db` is used, so this re-export is for co… 69 hir::db::ExpandDatabaseStorage, 70 hir::db::DefDatabaseStorage, 71 hir::db::HirDatabaseStorage, 72 hir::db::InternDatabaseStorage, 78 // `&RootDatabase -> &dyn OtherDatabase` cast will instantiate its drop glue in the vtable, 91 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() 97 fn upcast(&self) -> &(dyn ExpandDatabase + 'static) { in upcast() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-db/ |
| D | Cargo.toml | 2 name = "ide-db" 9 rust-version.workspace = true 15 cov-mark = "2.0.0-pre.1" 18 fst = { version = "0.4.7", default-features = false } 19 rustc-hash = "1.1.0" 27 nohash-hasher.workspace = true 30 base-db.workspace = true 36 text-edit.workspace = true 37 # ide should depend only on the top-level `hir` package. if you need 38 # something from some `hir-xxx` subpackage, reexport the API via `hir`. [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/rust-analyzer/tests/slow-tests/ |
| D | tidy.rs | 8 #[cfg(not(feature = "in-rust-tree"))] 11 #[cfg(not(feature = "in-rust-tree"))] 17 let out = cmd!(sh, "rustup run stable rustfmt --version").read().unwrap(); in check_code_formatting() 21 Please run `rustup component add rustfmt --toolchain stable` to install it.", in check_code_formatting() 25 let res = cmd!(sh, "rustup run stable cargo fmt -- --check").run(); in check_code_formatting() 38 .read_file(sourcegen::project_root().join("crates/rust-analyzer/src/lsp_ext.rs")) in check_lsp_extensions_docs() 45 sh.read_file(sourcegen::project_root().join("docs/dev/lsp-extensions.md")).unwrap(); in check_lsp_extensions_docs() 57 lsp_ext.rs was changed without touching lsp-extensions.md. in check_lsp_extensions_docs() 62 Please adjust docs/dev/lsp-extensions.md. in check_lsp_extensions_docs() 121 Some(s) if s.contains("dev-dependencies") => { in check_cargo_toml() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-assists/ |
| D | Cargo.toml | 2 name = "ide-assists" 9 rust-version.workspace = true 15 cov-mark = "2.0.0-pre.1" 24 text-edit.workspace = true 26 ide-db.workspace = true 29 [dev-dependencies] 30 expect-test = "1.4.0" 33 test-utils.workspace = true 37 in-rust-tree = []
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/hir-expand/src/ |
| D | builtin_attr_macro.rs | 3 use crate::{db::ExpandDatabase, name, tt, ExpandResult, MacroCallId, MacroCallKind}; 15 db: &dyn ExpandDatabase, 18 ) -> ExpandResult<tt::Subtree> { 22 expander(db, id, tt) 25 fn find_by_name(name: &name::Name) -> Option<Self> { 37 pub fn is_derive(self) -> bool { in is_derive() 40 pub fn is_test(self) -> bool { in is_test() 43 pub fn is_bench(self) -> bool { in is_bench() 58 pub fn find_builtin_attr(ident: &name::Name) -> Option<BuiltinAttrExpander> { in find_builtin_attr() 66 ) -> ExpandResult<tt::Subtree> { in dummy_attr_expand() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-ssr/ |
| D | Cargo.toml | 2 name = "ide-ssr" 5 repository = "https://github.com/rust-lang/rust-analyzer" 10 rust-version.workspace = true 16 cov-mark = "2.0.0-pre.1" 19 nohash-hasher.workspace = true 23 ide-db.workspace = true 27 text-edit.workspace = true 29 [dev-dependencies] 30 expect-test = "1.4.0" 33 test-utils.workspace = true
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-diagnostics/ |
| D | Cargo.toml | 2 name = "ide-diagnostics" 9 rust-version.workspace = true 15 cov-mark = "2.0.0-pre.1" 24 text-edit.workspace = true 27 ide-db.workspace = true 29 [dev-dependencies] 30 expect-test = "1.4.0" 33 test-utils.workspace = true 37 in-rust-tree = []
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/rust-analyzer/ |
| D | Cargo.toml | 2 name = "rust-analyzer" 4 homepage = "https://github.com/rust-analyzer/rust-analyzer" 6 documentation = "https://rust-analyzer.github.io/manual.html" 12 rust-version.workspace = true 18 name = "rust-analyzer" 23 crossbeam-channel = "0.5.5" 27 lsp-types = { version = "=0.94", features = ["proposed"] } 31 rustc-hash = "1.1.0" 36 mimalloc = { version = "0.1.30", default-features = false, optional = true } 37 lsp-server = { version = "0.7.0", path = "../../lib/lsp-server" } [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/ |
| D | diagnostics.rs | 1 //! Analyze all modules in a project for diagnostics. Exits with a non-zero 7 use hir::{db::HirDatabase, Crate, Module}; 8 use ide::{AssistResolveStrategy, DiagnosticsConfig, Severity}; 17 pub fn run(self) -> anyhow::Result<()> { in run() 33 let db = host.raw_database(); in run() localVariable 39 let work = all_modules(db).into_iter().filter(|module| { in run() 40 let file_id = module.definition_source(db).file_id.original_file(db); in run() 41 let source_root = db.file_source_root(file_id); in run() 42 let source_root = db.source_root(source_root); in run() 47 let file_id = module.definition_source(db).file_id.original_file(db); in run() [all …]
|
| D | lsif.rs | 7 use ide::{ 30 struct Snap<DB>(DB); 31 impl<DB: ParallelDatabase> Clone for Snap<salsa::Snapshot<DB>> { 32 fn clone(&self) -> Snap<salsa::Snapshot<DB>> { in clone() argument 44 db: &'a RootDatabase, field 52 fn from(Id(x): Id) -> Self { in from() 58 fn new<'a>(analysis: &'a Analysis, db: &'a RootDatabase, vfs: &'a Vfs) -> LsifManager<'a> { in new() 66 db, in new() 71 fn add(&mut self, data: lsif::Element) -> Id { in add() 78 fn add_vertex(&mut self, vertex: lsif::Vertex) -> Id { in add_vertex() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide/src/ |
| D | lib.rs | 1 //! ide crate provides "ide-centric" APIs for the rust-analyzer. That is, 7 //! However, IDE specific bits of the analysis (most notably completion) happen 147 pub fn new(range: TextRange, info: T) -> RangeInfo<T> { in new() 155 db: RootDatabase, field 159 pub fn new(lru_capacity: Option<usize>) -> AnalysisHost { in new() 160 AnalysisHost { db: RootDatabase::new(lru_capacity) } in new() 164 self.db.update_parse_query_lru_capacity(lru_capacity); in update_lru_capacity() 168 self.db.update_lru_capacities(lru_capacities); in update_lru_capacities() 173 pub fn analysis(&self) -> Analysis { in analysis() 174 Analysis { db: self.db.snapshot() } in analysis() [all …]
|
| /third_party/rust/crates/static-assertions-rs/ |
| D | .gitignore | 6 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 8 # User-specific stuff: 13 # Sensitive or high-churn files: 27 cmake-build-debug/ 32 ## File-based project format: 35 ## Plugin-specific files: 40 # mpeltonen/sbt-idea plugin 44 atlassian-ide-plugin.xml 52 crashlytics-build.properties 56 # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/hir/src/semantics/ |
| D | source_to_def.rs | 4 //! heart of the IDE parts of rust-analyzer. 10 //! This problem is a part of more-or-less every IDE feature implemented. Every 11 //! IDE functionality (like goto to definition), conceptually starts with a 25 //! real or macro-expanded file the tree comes from. 48 …d414074a95a6a489c/src/Compilers/CSharp/Portable/Compilation/SyntaxTreeSemanticModel.cs#L1403-L1429> 63 …8c8994a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/… 72 //! One question is left though -- where does the recursion stops? This happens 77 //! Note that the logic in this module is somewhat fundamentally imprecise -- 79 //! injective mapping from syntax nodes to defs. This is not an edge case -- 81 //! library with `--cfg test` and a library without. [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/base-db/src/ |
| D | lib.rs | 1 //! base_db defines basic database traits. The concrete DB is defined by ide. 31 fn from_intern_id(v: $crate::salsa::InternId) -> Self { 34 fn as_intern_id(&self) -> $crate::salsa::InternId { 42 fn upcast(&self) -> &T; in upcast() 61 fn file_text(&self, file_id: FileId) -> Arc<str>; in file_text() 62 fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>; in resolve_path() 63 fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>>; in relevant_crates() 67 /// model. Everything else in rust-analyzer is derived from these queries. 72 fn parse(&self, file_id: FileId) -> Parse<ast::SourceFile>; in parse() 76 fn crate_graph(&self) -> Arc<CrateGraph>; in crate_graph() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/rust-analyzer/src/ |
| D | integrated_benchmarks.rs | 1 //! Fully integrated benchmarks for rust-analyzer, which load real cargo 9 //! Note that "rust-analyzer: Run" action does not allow running a single test 10 //! in release mode in VS Code. There's however "rust-analyzer: Copy Run Command Line" 11 //! which you can use to paste the command in terminal and add `--release` manually. 13 use ide::{CallableSnippets, Change, CompletionConfig, FilePosition, TextSize}; 31 // Load rust-analyzer itself. in integrated_highlighting_benchmark() 33 let file = "./crates/ide-db/src/apply_change.rs"; in integrated_highlighting_benchmark() 85 // Load rust-analyzer itself. in integrated_completion_benchmark() 120 patch(&mut text, "db.struct_data(self.id)", "sel;\ndb.struct_data(self.id)") in integrated_completion_benchmark() 195 fn patch(what: &mut String, from: &str, to: &str) -> usize { in patch()
|
| /third_party/rust/rust/src/tools/rust-analyzer/crates/ide-diagnostics/src/ |
| D | lib.rs | 6 //! user-authored source code. We are especially not in the position to offer 13 //! ad-hoc at the moment. Anyways, we get a bunch of ide-friendly diagnostic 17 //! internally -- so that we have all the info to make fixes. 20 //! rendering, optional fixes and tests. It's OK if some low-level compiler 23 //! There are also a couple of ad-hoc diagnostics implemented directly here, we 86 pub fn as_str(&self) -> &str { in as_str() 103 fn new(code: &'static str, message: impl Into<String>, range: TextRange) -> Diagnostic { in new() 116 fn experimental(mut self) -> Diagnostic { in experimental() 121 fn severity(mut self, severity: Severity) -> Diagnostic { in severity() 126 fn with_fixes(mut self, fixes: Option<Vec<Assist>>) -> Diagnostic { in with_fixes() [all …]
|
| /third_party/rust/rust/src/tools/rust-analyzer/docs/dev/ |
| D | architecture.md | 3 This document describes the high-level architecture of rust-analyzer. 9 See also these implementation-related blog posts: 11 * https://rust-analyzer.github.io/blog/2019/11/13/find-usages.html 12 * https://rust-analyzer.github.io/blog/2020/07/20/three-architectures-for-responsive-ide.html 13 * https://rust-analyzer.github.io/blog/2020/09/16/challeging-LR-parsing.html 14 * https://rust-analyzer.github.io/blog/2020/09/28/how-to-make-a-light-bulb.html 15 * https://rust-analyzer.github.io/blog/2020/10/24/introducing-ungrammar.html 17 …) and [another playlist](https://www.youtube.com/playlist?list=PL85XCvVPmGQho7MZkdW-wtPtuJcFpzycE). 22 ![](https://user-images.githubusercontent.com/4789492/107129398-0ab70f00-687a-11eb-9bfc-d4eb023aec0… 24 On the highest level, rust-analyzer is a thing which accepts input source code from the client and … [all …]
|