Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: exclude uncompiled files from semantics and surface semantic-less reason #17920

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rust: address review
Paolo Tranquilli committed Nov 7, 2024

Verified

This commit was signed with the committer’s verified signature.
chjj Christopher Jeffrey (JJ)
commit 64d522e4479dc1b9945453c42e88cb5d4d468b7d
5 changes: 4 additions & 1 deletion rust/extractor/src/rust_analyzer.rs
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ pub struct ParseResult<'a> {
pub errors: Vec<SyntaxError>,
pub semantics_info: Result<FileSemanticInformation<'a>, &'a str>,
}

impl<'a> RustAnalyzer<'a> {
pub fn load_workspace(
project: &ProjectManifest,
@@ -100,8 +101,10 @@ impl<'a> RustAnalyzer<'a> {
file_id,
path.to_string_lossy()
);
no_semantics_reason = "no text available for the file in the project";
} else {
no_semantics_reason = "file not found in project";
}
no_semantics_reason = "file not found in project";
}
RustAnalyzer::WithoutSemantics { reason } => {
no_semantics_reason = reason;