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

Support String formatting via delegate command #1702

Merged
merged 3 commits into from
Apr 6, 2021

Conversation

CsCherrYY
Copy link
Contributor

@CsCherrYY CsCherrYY commented Mar 23, 2021

When developing the Java formatter Setting Page, a preview part is needed. However, existing format methods have the following limitation:

  • Based on file. If we have a temporary file containing the preview content background, the writing or modifying on the file will trigger VS Code (maybe other clients as well) to open an editor on the temporary file. This behavior can only be avoided by calling document.save() after applying WorkspaceEdit in VS Code by now, see WorkspaceEdit without opening the file microsoft/vscode#96920. but saving the content to disk will cost more time than just keeping them in the memory.
  • The current mechanism of formatting in Language Server is to monitor the modifying of the formatter profile. As a preview, the frequency of changing the settings would be frequent, which may cause saving to the local xml file many times.

Thus, I would like to offer a delegate command to support string formatting with given options.

Signed-off-by: Shi Chen chenshi@microsoft.com

@CsCherrYY CsCherrYY force-pushed the formatterString branch 2 times, most recently from 71baf4d to dc7a1ae Compare March 31, 2021 08:52
Signed-off-by: Shi Chen <chenshi@microsoft.com>
Signed-off-by: Shi Chen <chenshi@microsoft.com>
Signed-off-by: Shi Chen <chenshi@microsoft.com>
@testforstephen testforstephen added this to the End March 2021 milestone Apr 6, 2021
@testforstephen testforstephen merged commit b647c55 into eclipse-jdtls:master Apr 6, 2021
@CsCherrYY CsCherrYY deleted the formatterString branch June 30, 2022 00:47
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.

None yet

2 participants