Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Commit 97dbe7c

Browse files
merge: hotfix/linter-activation into dev
2 parents 4df85ae + 63abed8 commit 97dbe7c

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

toolchains/solidity/core/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

toolchains/solidity/core/crates/linter-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "linter-server"
33
license = "GPL-3.0-or-later"
4-
version = "0.2.2"
4+
version = "0.2.3"
55
edition = "2021"
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

toolchains/solidity/core/crates/linter-server/src/main.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,14 @@ impl LanguageServer for Backend {
7676
self.lint(params.text_document.uri, params.text_document.text);
7777
}
7878

79-
fn did_change(&self, params: DidChangeTextDocumentParams) {
79+
fn did_save(&self, params: DidSaveTextDocumentParams) {
8080
self.connection.borrow_mut().log_message(
8181
MessageType::INFO,
8282
format!("file changed!: {:}", params.text_document.uri),
8383
);
84-
85-
self.lint(
86-
params.text_document.uri,
87-
params.content_changes[0].text.clone(),
88-
);
84+
if let Some(text) = params.text {
85+
self.lint(params.text_document.uri, text);
86+
}
8987
}
9088

9189
fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) {

0 commit comments

Comments
 (0)