Skip to content

Add diagnostic and code action for unused anchor#621

Merged
evidolob merged 4 commits intoredhat-developer:mainfrom
evidolob:unused-anchors-diagnostic
Jan 24, 2022
Merged

Add diagnostic and code action for unused anchor#621
evidolob merged 4 commits intoredhat-developer:mainfrom
evidolob:unused-anchors-diagnostic

Conversation

@evidolob
Copy link
Copy Markdown
Collaborator

What does this PR do?

It add diagnostic report for unused anchors, also it add code action which delete unused anchor.
This PR also updates the yaml parser to 2.0.0-9 to be able to use CST scrToken from Node.

Demo:

Screen.Recording.2021-12-17.at.09.46.38.mov

What issues does this PR fix or reference?

Resolve: #587

Is it tested? How?

with test

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob requested a review from JPinkney as a code owner December 17, 2021 07:52
@evidolob
Copy link
Copy Markdown
Collaborator Author

cc @gorkem @remcohaszing WDYT?

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 17, 2021

Coverage Status

Coverage increased (+0.8%) to 80.2% when pulling 5283e31 on evidolob:unused-anchors-diagnostic into 5a51731 on redhat-developer:main.

Copy link
Copy Markdown
Contributor

@remcohaszing remcohaszing left a comment

Choose a reason for hiding this comment

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

It even includes a fixer. Awesome!

@gorkem
Copy link
Copy Markdown
Collaborator

gorkem commented Dec 17, 2021

+1 good idea. I will review it later.
I was thinking about creating more code actions too. This is a good start.

One note. Is an unused anchor an error or a warning?

@evidolob
Copy link
Copy Markdown
Collaborator Author

@gorkem unused anchor is Hint

Comment thread src/languageservice/services/validation/types.ts
Comment thread src/languageservice/services/validation/unused-anchors.ts Outdated
Comment thread src/languageservice/utils/strings.ts Outdated
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
…er into unused-anchors-diagnostic

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob requested a review from gorkem January 12, 2022 08:29
@evidolob
Copy link
Copy Markdown
Collaborator Author

@gorkem Could you look on this again?

Comment thread package.json Outdated
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob merged commit 4973795 into redhat-developer:main Jan 24, 2022
@evidolob evidolob deleted the unused-anchors-diagnostic branch January 24, 2022 07:11
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.

Report unused anchors

4 participants