Commit Graph

376 Commits

Author SHA1 Message Date
Paolo Tranquilli
64d522e447 Rust: address review 2024-11-07 09:39:44 +01:00
Paolo Tranquilli
200715773f Rust: fix no_semantics_reason 2024-11-06 17:19:06 +01:00
Paolo Tranquilli
2987743e44 Rust: exclude uncompiled files from semantics and surface semanticless reason 2024-11-06 15:22:28 +01:00
Paolo Tranquilli
6848a22c65 Rust: fix semantic merge conflict about semantics 2024-11-04 10:04:40 +01:00
Paolo Tranquilli
bde517fcb1 Merge pull request #17849 from github/aibaars/single-semantics
Rust: try to speed things up a bit
2024-11-04 09:24:26 +01:00
Paolo Tranquilli
cee2ed0ec4 Rust: extract some resolved paths 2024-10-31 14:19:15 +01:00
Arthur Baars
0e511d640b Rust: avoid panics
If:
* the text for a file_id is not found (likely non-utf data in file)
* path does not appear in Vfs, in which case we fall back on loading the file from disk with no "semantics" available
2024-10-30 13:18:36 +01:00
Arthur Baars
c87f2c4eb1 Rust: remove unnecessary field 2024-10-28 18:56:20 +01:00
Arthur Baars
b6c26debef Rust: create single Semantics object for each workspace 2024-10-28 13:29:04 +01:00
Arthur Baars
57cdda3405 Rust: no longer reload files into the RootDatabase
Files were reloaded to handle cases were there was no content
for a file_id, causing a panic. Missing contents was caused by
files that did not contain valid UTF-8 data. These are skipped
by rust-analyzer when it is loading data into the RootDatabase.
2024-10-28 13:29:03 +01:00
Paolo Tranquilli
9c95a17882 Rust: add block ids to canonical paths, making them "extended" 2024-10-28 12:41:05 +01:00
Paolo Tranquilli
652e47177f Rust: format 2024-10-25 17:44:16 +02:00
Paolo Tranquilli
9789059e9f Rust: add more thourough canonical path testing 2024-10-25 16:58:05 +02:00
Paolo Tranquilli
194e0daa8c Rust: add canonical_path and crate_origin to Item 2024-10-25 16:58:04 +02:00
Paolo Tranquilli
a760b89895 Rust: small tweaks 2024-10-25 14:13:27 +02:00
Paolo Tranquilli
5230b7b041 Rust: reduce log spam and skip debug diagnostics in the DB 2024-10-25 13:47:13 +02:00
Arthur Baars
9dc5e2fa36 Merge pull request #17791 from github/aibaars/rust-format-templates
Rust: parse formatting templates
2024-10-25 12:42:35 +02:00
Paolo Tranquilli
41d0085918 Rust: address review 2024-10-24 17:54:18 +02:00
Arthur Baars
ca469f6d5c Rust: introduce PathExprBase class 2024-10-24 15:14:07 +02:00
Paolo Tranquilli
3f8d438851 Rust: move qltest to rust code, add options with cargo check 2024-10-24 12:55:23 +02:00
Paolo Tranquilli
248eb7f00c Merge branch 'main' into rust/callable-base 2024-10-15 11:03:11 +02:00
Arthur Baars
b4bb24aa43 Merge remote-tracking branch 'upstream/main' into aibaars/rust-macros 2024-10-11 13:33:50 +02:00
Arthur Baars
6ade2a8054 Rust: address comments 2024-10-11 13:11:12 +02:00
Tom Hvitved
8cc349e85f Rust: Run codegen 2024-10-11 12:01:16 +02:00
Paolo Tranquilli
f3bf347bd6 Merge branch 'main' into redsun82/codegen-annotate 2024-10-11 10:38:02 +02:00
Paolo Tranquilli
c66bd72620 Rust: rename to CallExprBase 2024-10-11 09:52:30 +02:00
Arthur Baars
f97a159163 Rust: clippy fixes 2024-10-10 15:53:16 +02:00
Arthur Baars
88e5ce3cf8 Rust: lower default verbosity to WARN 2024-10-10 15:53:15 +02:00
Arthur Baars
ca27785ace Rust: extract files on a per-project basis
This way we have only one "project" database in-memory at a time. This
should avoid running out of memory when analyzing large mono-repos.
2024-10-10 15:53:14 +02:00
Arthur Baars
db28f1b29e Rust: use macro to inject extraction functions for detached properties 2024-10-10 15:53:13 +02:00
Arthur Baars
8372a2e562 Rust: ensure error and token locations are valid
The locations are "clipped" to the ranges of the parent node of a token,
and the root node of the parse tree for errors.
2024-10-10 15:53:12 +02:00
Arthur Baars
58d2c71c20 Rust: load files from disk ourselves
This avoids problems with files containing invalid utf-8 data, which may cause
panic's like:
```
 thread 'main' panicked at external/rules_rust~~_crate~ql~~r~r__ra_ap_salsa-0.0.232/src/input.rs:91:32:
   no value set for CompressedFileTextQuery(FileId(2429))
   stack backtrace:
      0: rust_begin_unwind
                at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
      1: core::panicking::panic_fmt
                at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
      2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::fetch
      3: <DB as ra_ap_base_db::SourceDatabase>::compressed_file_text::__shim
      4: <ra_ap_base_db::FileTextQuery as salsa::plumbing::QueryFunction>::execute
      5: salsa::Cycle::catch
      6: salsa::derived_lru::slot::Slot<Q,MP>::execute
      7: salsa::derived_lru::slot::Slot<Q,MP>::read
      8: <salsa::derived_lru::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
      9: <DB as ra_ap_base_db::SourceDatabase>::file_text::__shim
     10: <DB as ra_ap_base_db::SourceDatabase>::file_text
     11: <ra_ap_base_db::ParseQuery as salsa::plumbing::QueryFunction>::execute
     12: salsa::Cycle::catch
     13: salsa::derived_lru::slot::Slot<Q,MP>::execute
     14: salsa::derived_lru::slot::Slot<Q,MP>::read
     15: <salsa::derived_lru::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
     16: <DB as ra_ap_base_db::SourceDatabase>::parse::__shim
     17: <DB as ra_ap_base_db::SourceDatabase>::parse
     18: ra_ap_hir::semantics::SemanticsImpl::parse
     19: single_arch_extractor::main
```
2024-10-10 15:53:11 +02:00
Arthur Baars
3e877ffaac Rust: do not fail on bad Cargo.toml files 2024-10-10 15:53:08 +02:00
Arthur Baars
ae19b2fd89 Rust: check that TextRanges are for the correct file 2024-10-10 15:53:07 +02:00
Arthur Baars
faa168993c Rust: reduce log output 2024-10-10 15:53:06 +02:00
Arthur Baars
0b3b95ab54 Rust: macro expansion 2024-10-10 15:19:47 +02:00
Arthur Baars
cad2b74137 Rust: integrate Rust Analyzer's Semantic module into extractor 2024-10-10 15:19:46 +02:00
Arthur Baars
6ede20cccc Rust: regenerate code 2024-10-10 15:19:45 +02:00
Arthur Baars
69f0e8bcf7 Rust: add MacroStmts and MacroItems 2024-10-10 15:19:43 +02:00
Arthur Baars
7986fc7036 Rust: avoid double '.' in trap extension 2024-10-10 15:19:42 +02:00
Paolo Tranquilli
89f43fb917 Rust: generate code 2024-10-10 14:37:40 +02:00
Arthur Baars
30034b4254 Rust: run 'bazel //rust/codegen' 2024-10-10 14:25:06 +02:00
Paolo Tranquilli
61c3aa6288 Rust: integrate rust code generation into //rust/codegen 2024-10-08 10:37:53 +02:00
Paolo Tranquilli
96dda8808c Rust: rename generate-schema -> ast-generator 2024-10-08 10:03:00 +02:00
Arthur Baars
ef3f730d32 Rust: extract comment tokens 2024-09-30 15:38:58 +02:00
Arthur Baars
fd459be165 Rust: add Comment to schema 2024-09-30 15:38:54 +02:00
Arthur Baars
5714811071 Rust: fix panic when the last character in a range is multi-byte 2024-09-24 19:26:02 +02:00
Arthur Baars
1953e4f971 Rust: handle UTF-8 decoding errors 2024-09-24 17:34:33 +02:00
Arthur Baars
37f264df74 Rust: correct line and column numbers in printed error messages 2024-09-24 17:34:32 +02:00
Arthur Baars
b04abc09f0 Rust: extract syntax errors 2024-09-24 17:34:26 +02:00