Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pull diagnostics #153

Merged
merged 9 commits into from
Dec 16, 2024
Merged

feat: pull diagnostics #153

merged 9 commits into from
Dec 16, 2024

Conversation

psteinroe
Copy link
Collaborator

@psteinroe psteinroe commented Dec 12, 2024

adds diagnostics

Copied and adapted from Biome. The CLI-related stuff will need some in-depth testing and a number of improvements eg to just handle sql files. I also do not know yet how to define a glob pattern. The std-in mode is also not implemented yet. But the basics are working, and we will figure out the ergonomics later when the linter is implemented.

  • to workspace
  • to lsp
  • to cli via check command

for now just for syntax errors but it will be easily extendable. will add the linter after this.

Screenshot 2024-12-13 at 13 55 09 Screenshot 2024-12-15 at 16 40 13

@psteinroe psteinroe marked this pull request as draft December 12, 2024 09:36
@psteinroe psteinroe marked this pull request as ready for review December 15, 2024 16:04
Copy link
Collaborator

@juleswritescode juleswritescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool :) Great work!!

Mostly Nits except for the coment regarding the Severity 🙌🏻

crates/pg_workspace_new/src/workspace/server.rs Outdated Show resolved Hide resolved
crates/pg_workspace_new/src/workspace/server.rs Outdated Show resolved Hide resolved

let errors = diagnostics
.iter()
.filter(|d| d.severity() == Severity::Error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also Severity::Fatal which would not be included here, should we maybe check d.severity() >= Severity::Error?

crates/pg_lsp_new/src/server.rs Show resolved Hide resolved
@@ -34,7 +34,7 @@ pub(crate) struct JunitReporterVisitor<'a>(pub(crate) Report, pub(crate) &'a mut

impl<'a> JunitReporterVisitor<'a> {
pub(crate) fn new(console: &'a mut dyn Console) -> Self {
let report = Report::new("Biome");
let report = Report::new("PgLsp");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-12-16 at 10 07 45

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha

crates/pg_cli/src/execute/mod.rs Outdated Show resolved Hide resolved
crates/pg_lsp_new/src/session.rs Outdated Show resolved Hide resolved
crates/pg_lsp_new/src/session.rs Outdated Show resolved Hide resolved
Comment on lines +38 to +39
// pub only: Vec<RuleSelector>,
// pub skip: Vec<RuleSelector>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove those?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need them once the linter is there

@psteinroe psteinroe merged commit b2efc18 into main Dec 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants