Skip to content

Support statically registering format support#1062

Merged
datho7561 merged 1 commit into
redhat-developer:mainfrom
datho7561:1031-support-static-format-registration
May 6, 2025
Merged

Support statically registering format support#1062
datho7561 merged 1 commit into
redhat-developer:mainfrom
datho7561:1031-support-static-format-registration

Conversation

@datho7561
Copy link
Copy Markdown
Contributor

What does this PR do?

Some clients, like Neovim, do not support dynamic registration of formatting and range formatting. In this case, to tell the client that formatting is supported, the response to initialized, which contains the ServerCapabilities, should mark formatting and range formatting as supported.

What issues does this PR fix or reference?

Fixes #1031

Is it tested? How?

Tried it out in Neovim, it's working after this patch.

@coveralls
Copy link
Copy Markdown

coveralls commented May 1, 2025

Coverage Status

coverage: 83.824%. remained the same
when pulling 1fd2818 on datho7561:1031-support-static-format-registration
into 6c66fdf on redhat-developer:main.

@datho7561
Copy link
Copy Markdown
Contributor Author

datho7561 commented May 1, 2025

In this PR, I assume that iff (if and only if) the server supports dynamically registering range formatting it supports dynamically registering regular formatting. I think this is a safe assumption and I think that we're already making it for the dynamic code.

This language server doesn't support range formatting, so we should be checking if formatting can be dynamically registered. I'll update that.

@datho7561 datho7561 force-pushed the 1031-support-static-format-registration branch from 96f4421 to e4ea0da Compare May 1, 2025 16:16
Copy link
Copy Markdown
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

LGTM

@datho7561 datho7561 force-pushed the 1031-support-static-format-registration branch from 3119d6d to 716a742 Compare May 6, 2025 13:04
Some clients, like Neovim, do not support dynamic registration of
formatting and range formatting.
In this case, to tell the client that formatting is supported,
the response to `initialized`, which contains the `ServerCapabilities`,
should mark formatting and range formatting as supported.

Fixes redhat-developer#1031

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the 1031-support-static-format-registration branch from 716a742 to 1fd2818 Compare May 6, 2025 13:48
@datho7561 datho7561 merged commit 85b0582 into redhat-developer:main May 6, 2025
4 checks passed
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.

How to format?

3 participants