Skip to content

Commit

Permalink
Remove invalidate of priv_raw_file_content
Browse files Browse the repository at this point in the history
This is useless since starkware-libs/cairo#6799.
Physical files are not cached anyway, and `vfs` ones can not be modified by the client.

commit-id:f1173e60
  • Loading branch information
Draggu committed Dec 3, 2024
1 parent 6cfb32e commit d7e87af
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/server/routing/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use lsp_types::{
DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams,
DocumentFormattingParams, ExecuteCommandParams, GotoDefinitionParams, GotoDefinitionResponse,
Hover, HoverParams, SemanticTokensParams, SemanticTokensResult, TextDocumentContentChangeEvent,
TextDocumentPositionParams, TextEdit, Url,
TextDocumentPositionParams, TextEdit,
};
use serde_json::Value;
use tracing::error;
Expand Down Expand Up @@ -181,14 +181,6 @@ impl SyncNotificationHandler for DidChangeWatchedFiles {
requester: &mut Requester<'_>,
params: DidChangeWatchedFilesParams,
) -> LSPResult<()> {
// Invalidate changed cairo files.
for change in &params.changes {
if is_cairo_file_path(&change.uri) {
let Some(file) = state.db.file_for_url(&change.uri) else { continue };
PrivRawFileContentQuery.in_db_mut(state.db.as_files_group_mut()).invalidate(&file);
}
}

// Reload workspace if a config file has changed.
for change in params.changes {
let changed_file_path = change.uri.to_file_path().unwrap_or_default();
Expand Down Expand Up @@ -348,7 +340,3 @@ impl BackgroundDocumentRequestHandler for ExpandMacro {
Ok(ide::macros::expand::expand_macro(&snapshot.db, &params))
}
}

fn is_cairo_file_path(file_path: &Url) -> bool {
file_path.path().ends_with(".cairo")
}

0 comments on commit d7e87af

Please sign in to comment.