diff --git a/toolchains/solidity/core/crates/slither-server/src/main.rs b/toolchains/solidity/core/crates/slither-server/src/main.rs index 0a7cf4b9..bf78bd26 100644 --- a/toolchains/solidity/core/crates/slither-server/src/main.rs +++ b/toolchains/solidity/core/crates/slither-server/src/main.rs @@ -78,19 +78,18 @@ impl LanguageServer for Backend { ), ) .await; - self.check_slither_result(file.text_document.uri).await - } - - async fn did_change(&self, file: DidChangeTextDocumentParams) { - self.client - .log_message( - MessageType::INFO, - format!( - "Changed file '{}' for analyzing.", - file.text_document.uri.path() - ), - ) - .await; + if file.text_document.uri.path().ends_with(".t.sol") { + self.client + .log_message( + MessageType::INFO, + format!( + "File '{}' is a test solidity file, skipping analysis.", + file.text_document.uri.path() + ), + ) + .await; + return; + } self.check_slither_result(file.text_document.uri).await } @@ -104,6 +103,18 @@ impl LanguageServer for Backend { ), ) .await; + if file.text_document.uri.path().ends_with(".t.sol") { + self.client + .log_message( + MessageType::INFO, + format!( + "File '{}' is a test solidity file, skipping analysis.", + file.text_document.uri.path() + ), + ) + .await; + return; + } self.check_slither_result(file.text_document.uri).await } } diff --git a/toolchains/solidity/core/crates/slither-server/src/slither.rs b/toolchains/solidity/core/crates/slither-server/src/slither.rs index b3e6e8d4..f23586eb 100644 --- a/toolchains/solidity/core/crates/slither-server/src/slither.rs +++ b/toolchains/solidity/core/crates/slither-server/src/slither.rs @@ -35,6 +35,7 @@ pub fn exec_slither(filepath: &str) -> Result, SlitherError> { .arg("-") .output()?; if out.status.code() == Some(1) { + eprintln!("Unknown error occured: {:?}", out); return Err(SlitherError::Unknown); } if out.stdout.is_empty() {