Skip to content

matej/vscode-diagnostics-comment-awareness#467

Open
voiys wants to merge 6 commits intodmno-dev:mainfrom
voiys:matej/vscode-diagnostics-comment-awareness
Open

matej/vscode-diagnostics-comment-awareness#467
voiys wants to merge 6 commits intodmno-dev:mainfrom
voiys:matej/vscode-diagnostics-comment-awareness

Conversation

@voiys
Copy link
Copy Markdown
Contributor

@voiys voiys commented Mar 23, 2026

Summary

  • only treat comment lines as decorator-bearing when the comment body starts with @
  • stop regular comments that merely mention @decorator or @type=... from triggering VS Code diagnostics/type validation
  • add regression coverage for both regular-comment cases

Test plan

  • bunx vitest packages/vscode-plugin/test/diagnostics-core.test.ts
  • bun run lint:fix

Examples:

  1. Regular comments are ignored (intellisense does not trigger either, can turn that off if you want)
Screenshot 2026-03-23 at 5 50 32 PM
  1. Post-comments on decorator lines are ignored
Screenshot 2026-03-23 at 5 46 19 PM
  1. Real decorator diagnostics still work
Screenshot 2026-03-23 at 5 46 28 PM
  1. Real type diagnostics still work, but commented trailing type text does not
Screenshot 2026-03-23 at 5 46 42 PM Screenshot 2026-03-23 at 5 46 49 PM

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: d9f9160

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
env-spec-language Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@voiys voiys changed the title Fix VS Code diagnostics comment awareness matej/vscode-diagnostics-comment-awareness Mar 23, 2026
@philmillman philmillman requested a review from theoephraim March 23, 2026 17:56
expect(diagnostics).toEqual([]);
});

it('ignores parser-style ignored decorator comments', () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure about this. The real loader will explode when it sees this with an "unknown decorator" kind of error. Maybe we should allow them as noops since they are common though. But either way it should match.

@@ -0,0 +1,2 @@
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you can add a changeset with the vscode extension tagged. It will merge them all up when we publish together

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/varlock@467

commit: d9f9160

@voiys
Copy link
Copy Markdown
Contributor Author

voiys commented Mar 25, 2026

VS Code now matches parser behavior here: prose mentions/post-comments are ignored, but leading @word comment lines still parse the same way the parser does

Screenshot 2026-03-25 at 11 52 40 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants