Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Jan 7, 2024
1 parent c5c45fe commit 95022ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions sway-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,7 @@ pub fn compile_to_ast(

// Check if we can re-use the data in the cache.
if is_parse_module_cache_up_to_date(engines, &path, include_tests) {
let mut entry = query_engine
.get_programs_cache_entry(&path)
.unwrap_or_else(|| panic!("unable to find entry in cache at path {:?}", &path));
let mut entry = query_engine.get_programs_cache_entry(&path).unwrap();
entry.programs.metrics.reused_modules += 1;

let (warnings, errors) = entry.handler_data;
Expand Down
1 change: 0 additions & 1 deletion sway-lsp/src/handlers/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub async fn handle_did_open_text_document(
// Otherwise, don't recompile the project when a new file in the project is opened
// as the workspace is already compiled.
if session.token_map().is_empty() {
// send_new_compilation_request(&state, session.clone(), &uri, None);
let _ = state
.cb_tx
.send(TaskMessage::CompilationContext(CompilationContext {
Expand Down
3 changes: 2 additions & 1 deletion sway-lsp/src/server_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use forc_pkg::PackageManifestFile;
use lsp_types::{Diagnostic, Url};
use parking_lot::RwLock;
use std::{
mem,
path::PathBuf,
sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -131,7 +132,7 @@ impl ServerState {
Some(retrigger_compilation.clone()),
) {
Ok(parse_result) => {
*session.engines.write() = engines_clone;
mem::swap(&mut *session.engines.write(), &mut engines_clone);
session.write_parse_result(parse_result);
*last_compilation_state.write() = LastCompilationState::Success;
}
Expand Down

0 comments on commit 95022ee

Please sign in to comment.