summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/project-model
AgeCommit message (Collapse)AuthorLines
2024-10-27Support `cfg(true)` and `cfg(false)`Chayim Refael Friedman-0/+41
As per RFC 3695.
2024-10-24internal: Improve proc-macro error msg for failed build scriptsLukas Wirth-10/+13
2024-10-23fix: Add missing cfg flags for `core` crateWilfred Hughes-3/+4
Some types in `core` are conditionally compiled based on `target_has_atomic` or `target_has_atomic_load_store` without an argument, for example `AtomicU64`. This is less noticeable in Cargo projects, where rust-analyzer adds the output `RUSTC_BOOTSTRAP=1 cargo rustc --print cfg` so it gets the full set of cfg flags. This fixes go-to-definition on `std::sync::atomic::AtomicU64` in non-cargo projects.
2024-10-18fix: Fix CI running analysis-stats incorrectly against the standard librariesLukas Wirth-3/+0
2024-10-12Fix panic when json project has relative buildfile pathsDavid Richey-1/+1
2024-09-30Gate `#[test]` expansion under `cfg(test)`.Chayim Refael Friedman-14/+26
This will mean users opting to not activate `cfg(test)` will lose IDE experience on them, which is quite unfortunate, but this is unavoidable if we want to avoid false positives on e.g. diagnostics. The real fix is to provide IDE experience even for cfg'ed out code, but this is out of scope for this PR.
2024-09-30Provide an config option to not set `cfg(test)`Chayim Refael Friedman-6/+22
2024-09-26Include buildfiles in vfsDavid Richey-0/+11
2024-09-25Pass all-targets for build scripts in more cli commandsLukas Wirth-1/+2
Without this, build scripts don't run for tests and as such any proc-macros in dev-deps fail to resolve
2024-09-11Remove crate graph deduplication logicLukas Wirth-19298/+1
2024-09-05fix: Updating settings should not clobber discovered projectsWilfred Hughes-0/+11
`linkedProjects` is owned by the user's configuration, so when users update this setting, `linkedProjects` is reset. This is problematic when `linkedProjects` also contains projects discovered with `discoverCommand`. The buggy behaviour occurred when: (1) The user configures `discoverCommand` and loads a Rust project. (2) The user changes any setting in VS Code, so rust-analyzer receives `workspace/didChangeConfiguration`. (3) `handle_did_change_configuration` ultimately calls `Client::apply_change_with_sink()`, which updates `config.user_config` and discards any items we added in `linkedProjects`. Instead, separate out `discovered_projects_from_filesystem` and `discovered_projects_from_command` from user configuration, so user settings cannot affect any type of discovered project. This fixes the subtle issue mentioned here: https://github.com/rust-lang/rust-analyzer/pull/17246#issuecomment-2185259122
2024-09-01minor: Downgrade cyclic deps error to warningLukas Wirth-1/+1
2024-08-28Fix cwd used for proc macro expansionLaurențiu Nicola-2/+2
2024-08-27Auto merge of #17973 - Veykril:proc-macro-curr-dir, r=Veykrilbors-4/+21
Expand proc-macros in workspace root, not package root Should fix https://github.com/rust-lang/rust-analyzer/issues/17748. The approach is generally not perfect though as rust-project.json projects don't benefit from this (still, nothing changes in that regard)
2024-08-27Expand proc-macros in workspace root, not package rootLukas Wirth-4/+21
2024-08-25Auto merge of #17956 - Veykril:metadata-err, r=Veykrilbors-40/+46
fix: Fix metadata retrying eating original errors
2024-08-25fix: Fix metadata retrying eating original errorsLukas Wirth-40/+46
2024-08-23Auto merge of #17857 - ChayimFriedman2:rust-project-cfg-group, r=Veykrilbors-4/+607
feat: Allow declaring cfg groups in rust-project.json, to help sharing common cfgs Closes #17815.
2024-08-19Improve documentation for `InvocationStrategy`Lukas Wirth-12/+14
2024-08-19chore(config): remove `invocationLocation` in favor of `invocationStrategy`Victor Song-25/+6
These flags were added to help rust-analyzer integrate with repos requiring non-Cargo invocations. The consensus is that having two independent settings are no longer needed. This change removes `invocationLocation` in favor of `invocationStrategy` and changes the internal representation of `InvocationStrategy::Once` to hold the workspace root.
2024-08-17feat: Make rust-analyzer work partially when missing an internet connectionLukas Wirth-17/+63
2024-08-12Allow declaring cfg groups in rust-project.json, to help sharing common cfgsChayim Refael Friedman-4/+607
2024-08-09minor: log error when sysroot can't be discoveredwinstxnhdw-4/+4
2024-08-08Split up flycheck moduleLukas Wirth-124/+123
2024-08-07Fix cargo config get env parsingLukas Wirth-4/+7
2024-08-07Remove unnecessary CfgFlag definition in project-modelLukas Wirth-319/+285
2024-08-07Allow rust-project.json to be hiddenAli Bektas-0/+6
2024-08-06Replace `[package.repository] = "…"` of published crates with ↵Vincent Esche-1/+1
`[package.repository.workspace] = true`
2024-08-06Add repository URL for published crates' missing `[package.repository]` fieldsVincent Esche-0/+1
2024-08-06Replace `"TBD"` with more helpful desciptions in published crates' ↵Vincent Esche-1/+1
`[package.description]` fields
2024-08-05Simplify FileDelegateLukas Wirth-5/+6
2024-08-05Auto merge of #17795 - Veykril:library-dep-loading, r=Veykrilbors-173/+147
feat: Load sysroot library via cargo metadata See https://github.com/rust-lang/rust/pull/128534, fixes https://github.com/rust-lang/rust-analyzer/issues/7637 Requires a toolchain from 176e54520 2024-08-04 or later to work.
2024-08-05feat: Load sysroot library via cargo metadataLukas Wirth-173/+147
2024-08-02internal: Remove AbsPathBuf::TryFrom impl that checks too many things at onceLukas Wirth-11/+10
2024-07-30Set tracing level to debug when `cargo config get env` failsAli Bektas-1/+1
2024-07-26Internal: Cleanup proc-macro error handlingLukas Wirth-3/+6
2024-07-25fix: Support new cargo config get env formatLukas Wirth-2/+14
2024-07-22Read rust-analyzer.toml files on startupAli Bektas-0/+13
2024-07-19Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykrilbors-4/+5
Edition aware parser Fixes https://github.com/rust-lang/rust-analyzer/issues/16324 by allowing us to properly thread through the edition to the parser
2024-07-18feature: move `linked_projects` discovery to the rust-analyzer serverDavid Barsky-10/+27
2024-07-18Encode edition within FileId in the hir layerLukas Wirth-4/+5
2024-07-16More symbol usageLukas Wirth-12/+13
2024-07-16Use symbol in cfgLukas Wirth-14/+20
2024-07-08Remove version check before using `--keep-going`mo8it-25/+7
2024-06-30Remove inline `rust_2018_idioms, unused_lifetimes` lint warn, Cargo.toml ↵Lukas Wirth-2/+0
already enforces this
2024-06-11feature: add build system info; runnables to `rust-project.json`Wilfred Hughes-6/+175
2024-06-09Register virtual workspace Cargo.toml files in the VFSLukas Wirth-0/+15
2024-06-06chore: Prefer tracing span shorthand macrosWilfred Hughes-5/+5
2024-05-30style: simplify string interpolationHamir Mahal-3/+2
2024-05-23Allow sysroots to only consist of the source root dirLukas Wirth-293/+236