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

fix: don't register document formatter twice #251

Merged
merged 4 commits into from
Oct 4, 2021

Conversation

adalinesimonian
Copy link
Member

@adalinesimonian adalinesimonian commented Oct 4, 2021

Fixes #250, Closes #241

Fixes a bug where the extension is registered twice as a document formatter. One instance is a result of the server's connection.onInitialize response, the other is the extension's own logic for registering a formatter per language ID. This PR replaces the extension's formatter registration implementation with server-side dynamic or static registration, depending on client capabilities.

See #250 (comment)

Fixes #250, Closes #241

Replaces extension's formatter registration implementation with server-
side dynamic or static registration, depending on client capabilities.
server.js Outdated Show resolved Hide resolved
Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

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

Looks good to me, a little out of my depth of JS knowledge though, so I'll defer to you

server.js Outdated Show resolved Hide resolved
src/server.js Show resolved Hide resolved
@adalinesimonian adalinesimonian merged commit 3e75b02 into main Oct 4, 2021
@adalinesimonian adalinesimonian deleted the fix-duplicate-formatters branch October 4, 2021 19:07
@adalinesimonian adalinesimonian added For Uncommitted Issue and removed type: bug a problem with a feature or rule For Uncommitted Issue labels Oct 28, 2021
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.

Multiple Stylelint formatters clashing Update document formatter to use dynamic registration
3 participants