Skip to content

Commit 041df21

Browse files
authored
vscode: add linting diagnostics (#571)
1 parent 2537c5a commit 041df21

13 files changed

Lines changed: 558 additions & 150 deletions

File tree

Cargo.lock

Lines changed: 81 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ rowan = "0.15.15"
3636
smol_str = "0.3.2"
3737
enum-iterator = "2.1.0"
3838
line-index = "0.1.2"
39+
lsp-server = "0.7.8"
40+
lsp-types = "0.95"
3941
serde-wasm-bindgen = "0.6.5"
4042
wasm-bindgen = "0.2.100"
4143
wasm-bindgen-test = "0.3.34"
@@ -57,6 +59,7 @@ squawk_lexer = { version = "0.0.0", path = "./crates/squawk_lexer" }
5759
squawk_parser = { version = "0.0.0", path = "./crates/squawk_parser" }
5860
squawk_syntax = { version = "0.0.0", path = "./crates/squawk_syntax" }
5961
squawk_linter = { version = "0.0.0", path = "./crates/squawk_linter" }
62+
squawk_server = { version = "0.0.0", path = "./crates/squawk_server" }
6063

6164
[workspace.lints.clippy]
6265
collapsible_else_if = "allow"

crates/squawk/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ squawk_syntax.workspace = true
3030
squawk_linter.workspace = true
3131
squawk_lexer.workspace = true
3232
squawk_github.workspace = true
33+
squawk_server.workspace = true
3334
toml.workspace = true
3435
glob.workspace = true
3536
anyhow.workspace = true
3637
annotate-snippets.workspace = true
3738
line-index.workspace = true
39+
lsp-server.workspace = true
40+
lsp-types.workspace = true
3841

3942
[dev-dependencies]
4043
insta.workspace = true

crates/squawk/src/github.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::Command;
1+
use crate::UploadToGithubArgs;
22
use crate::config::Config;
33
use crate::reporter::{CheckReport, fmt_tty_violation};
44
use crate::{file_finding::find_paths, reporter::check_files};
@@ -69,7 +69,7 @@ fn create_gh_app(
6969
const COMMENT_HEADER: &str = "# Squawk Report";
7070

7171
pub fn check_and_comment_on_pr(
72-
cmd: Command,
72+
args: UploadToGithubArgs,
7373
cfg: &Config,
7474
is_stdin: bool,
7575
stdin_path: Option<String>,
@@ -78,7 +78,7 @@ pub fn check_and_comment_on_pr(
7878
pg_version: Option<Version>,
7979
assume_in_transaction: bool,
8080
) -> Result<()> {
81-
let Command::UploadToGithub {
81+
let UploadToGithubArgs {
8282
paths,
8383
fail_on_violations,
8484
github_private_key,
@@ -89,7 +89,7 @@ pub fn check_and_comment_on_pr(
8989
github_repo_name,
9090
github_pr_number,
9191
github_private_key_base64,
92-
} = cmd;
92+
} = args;
9393

9494
let fail_on_violations =
9595
if let Some(fail_on_violations_cfg) = cfg.upload_to_github.fail_on_violations {

0 commit comments

Comments
 (0)