Skip to content

Fix duplicate of quarkus-properties when registering textDocument/rangeFormatting#52

Merged
angelozerr merged 1 commit intoeclipse-lsp4mp:masterfrom
angelozerr:duplicate-quarkus-properties
Aug 28, 2020
Merged

Fix duplicate of quarkus-properties when registering textDocument/rangeFormatting#52
angelozerr merged 1 commit intoeclipse-lsp4mp:masterfrom
angelozerr:duplicate-quarkus-properties

Conversation

@angelozerr
Copy link
Copy Markdown
Contributor

@angelozerr angelozerr commented Aug 12, 2020

Fix duplicate of quarkus-properties when registering textDocument/rangeFormatting

Fixes redhat-developer/vscode-quarkus#296

Signed-off-by: azerr azerr@redhat.com

@angelozerr angelozerr force-pushed the duplicate-quarkus-properties branch from e24b668 to 99e1d94 Compare August 12, 2020 15:22
@fbricon
Copy link
Copy Markdown
Contributor

fbricon commented Aug 12, 2020

Can you explain what happened, and change the commit message (it's a fix, no longer an investigation)

@angelozerr angelozerr changed the title Investigate why quarkus-properties appears twice when registering textDocument/rangeFormatting Fix duplicate of quarkus-properties when registering textDocument/rangeFormatting Aug 12, 2020
@angelozerr angelozerr force-pushed the duplicate-quarkus-properties branch from 99e1d94 to 51bb182 Compare August 12, 2020 15:27
`textDocument/rangeFormatting`

Fixes redhat-developer/vscode-quarkus#296

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Copy Markdown
Contributor Author

The problem is that formatting and rangeFormatting used the same instance of List https://github.com/eclipse/lsp4mp/blob/7b84e7f6d0685a83a870966cdfdccb52cb6b5802/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/settings/capabilities/MicroProfileCapabilityManager.java#L113

as Registration options https://github.com/eclipse/lsp4mp/blob/7b84e7f6d0685a83a870966cdfdccb52cb6b5802/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/settings/capabilities/MicroProfileCapabilityManager.java#L144

When configure was done for this shared list in https://github.com/eclipse/lsp4mp/blob/7b84e7f6d0685a83a870966cdfdccb52cb6b5802/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/settings/capabilities/MicroProfileCapabilityManager.java#L147 the first call of registerCapability from formatting added quarkus-properties and the second call of registerCapability from rangeFormatting added a second quarkus-properties in the shared list.

To fix the issue, formatting and rangeFormatting must not share the same List of options.

@fbricon
Copy link
Copy Markdown
Contributor

fbricon commented Aug 13, 2020

ok makes sense

@fbricon
Copy link
Copy Markdown
Contributor

fbricon commented Aug 27, 2020

@datho7561 please review this one

@angelozerr angelozerr merged commit 2785d5f into eclipse-lsp4mp:master Aug 28, 2020
@angelozerr angelozerr added this to the 0.1.0 milestone Sep 11, 2020
@angelozerr angelozerr added the bug Something isn't working label Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate why quarkus-properties appears twice when registering textDocument/rangeFormatting

3 participants