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

File level Diagnostic reporting #238608

Closed
prmichaelsen opened this issue Jan 23, 2025 · 3 comments
Closed

File level Diagnostic reporting #238608

prmichaelsen opened this issue Jan 23, 2025 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality languages-diagnostics Source problems reporting

Comments

@prmichaelsen
Copy link

I would like to supply file level diagnostics, eg

  const diagnosticsCollection = languages.createDiagnosticCollection("Datapath Lint");
  // Applies to entire file, no line number/range is applicable
  diagnosticCollection.set(uri, new Diagnostic(
    message,
    DiagnosticSeverity.Error,
  )); 

Instead of

  const diagnosticsCollection = languages.createDiagnosticCollection("Datapath Lint");
  diagnosticCollection.set(uri, new Diagnostic(
    range,
    message,
    DiagnosticSeverity.Error,
  )); 

Currently, the workaround I am using is

  const diagnosticsCollection = languages.createDiagnosticCollection("Datapath Lint");
  diagnosticCollection.set(uri, new Diagnostic(
    new Range(0, 0, 0, 0),
    message,
    DiagnosticSeverity.Error,
  )); 

This enables the issue to show up in the Problems tab, but does not
look very sophisticated in the file itself.

The issue is the underlying linter I am using to generate the diagnostics
does not support reporting the line numbers generating the errors.

Thank you,
Patrick

@lszomoru lszomoru assigned jrieken and unassigned lszomoru Jan 24, 2025
@jrieken jrieken added feature-request Request for new features or functionality languages-diagnostics Source problems reporting labels Jan 24, 2025
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Jan 24, 2025
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality languages-diagnostics Source problems reporting
Projects
None yet
Development

No branches or pull requests

3 participants