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

Is formatFull() exposed in JSON-RPC? #1478

Open
jcrben opened this issue Feb 10, 2023 · 1 comment
Open

Is formatFull() exposed in JSON-RPC? #1478

jcrben opened this issue Feb 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jcrben
Copy link

jcrben commented Feb 10, 2023

I like the formatting provided by this extension and I want to use it in a script (no editor) to automatically clean up the formatting for a bunch of repos and possibly in a CI check.

I used https://github.com/yeger00/pylspclient and hit the the textDocument/formatting endpoint but as the specification notes this returns TextEdit[]` and I don't want to mess around with them.

In reading the codebase I noticed that these edits are applied in the formatFull method

public String formatFull(String text, String uri, SharedSettings sharedSettings, CancelChecker cancelChecker) {

I think this full formatting isn't part of the official spec but I was wondering if was exposed in another way or if I should just write an extension to access it?

@jcrben jcrben changed the title Is formatFull exposed in JSON-RPC? Is formatFull() exposed in JSON-RPC? Feb 10, 2023
@angelozerr
Copy link
Contributor

I like the formatting

Glad you like it!

I think this full formatting isn't part of the official spec but I was wondering if was exposed in another way or if I should just write an extension to access it?

If I understand correctly your need, you would like to have an endoint like xml/formatting endoint which will consumes the formatFull which will return a String?

If it that we could expose it with a new command like https://github.com/eclipse/lemminx/tree/main/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands

Are you intersted to contribute with this new command? If yes, don't hesitate to ask us if you need more help.

@datho7561 datho7561 added the enhancement New feature or request label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants