Skip to content

showed error on unresolved alias#1059

Merged
msivasubramaniaan merged 3 commits intoredhat-developer:mainfrom
msivasubramaniaan:fix-show-error-on-unresolved-alias
May 6, 2025
Merged

showed error on unresolved alias#1059
msivasubramaniaan merged 3 commits intoredhat-developer:mainfrom
msivasubramaniaan:fix-show-error-on-unresolved-alias

Conversation

@msivasubramaniaan
Copy link
Contributor

@msivasubramaniaan msivasubramaniaan commented Apr 29, 2025

fixes #1098

What does this PR do?

This PR showed diagnostic error when there were no alias
image

What issues does this PR fix or reference?

redhat-developer/vscode-yaml#1098

Is it tested? How?

Yes added test case for the fix

@coveralls
Copy link

coveralls commented Apr 29, 2025

Coverage Status

coverage: 84.201% (+0.02%) from 84.178%
when pulling 2e59af2 on msivasubramaniaan:fix-show-error-on-unresolved-alias
into 7f64eeb on redhat-developer:main.

@msivasubramaniaan msivasubramaniaan self-assigned this Apr 29, 2025
const startOffset = nodeRange[0];
const endOffset = nodeRange[1];
const range = Range.create(document.positionAt(startOffset), document.positionAt(endOffset));
const warningDiagnostic = Diagnostic.create(range, `Unresolved alias "${node}"`, DiagnosticSeverity.Hint, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Also maybe worth adding "it will be treated as a string instead" into the error message

@msivasubramaniaan
Copy link
Contributor Author

image

@datho7561
Copy link
Contributor

Sorry, somehow this slipped through for me, I'll take another look

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

One more comment that I think you missed from last time, but it's fine to merge as-is.

@msivasubramaniaan msivasubramaniaan merged commit 4a5c6ca into redhat-developer:main May 6, 2025
4 checks passed
@msivasubramaniaan msivasubramaniaan deleted the fix-show-error-on-unresolved-alias branch May 6, 2025 09:45
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.

Error for missing anchor (unidentified alias) broken since 1.0

3 participants