Skip to content

Add Razor Diagnostic Test #8266

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

ryzngard
Copy link
Contributor

@ryzngard ryzngard commented May 8, 2025

No description provided.

@ryzngard ryzngard force-pushed the diagnostic_test branch from 5b395a1 to 4a44394 Compare May 8, 2025 21:50
@ryzngard ryzngard marked this pull request as ready for review May 8, 2025 21:50
@ryzngard ryzngard requested a review from a team as a code owner May 8, 2025 21:50
await testAssetWorkspace.cleanupWorkspace();
});

test('CSharp Diagnostics', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This is a "CSharp and Razor Diagnostics" test

expect(diagnostics[0].range).toStrictEqual(new vscode.Range(2, 0, 2, 25));
expect(diagnostics[0].source).toBe('Razor');

expect(diagnostics[1].message).toBe("The name 'Message' does not exist in the current context");
Copy link
Member

Choose a reason for hiding this comment

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

Why not validate the C# diagnostic code too? Would confirm we're sending it through correctly etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me add that. I wasn't sure how to do it because it's a weird definition but I think I can use toStrictEqual and achieve that

Copy link
Member

Choose a reason for hiding this comment

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

Oh, it's not the same as the Razor one above? That's interesting...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, it's a code + uri

@ryzngard ryzngard enabled auto-merge May 8, 2025 23:14
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