Skip to content

Partially move document formatting to server side #874

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

Merged
merged 6 commits into from
Jun 14, 2017

Conversation

kapilmb
Copy link

@kapilmb kapilmb commented Jun 13, 2017

This is one step closer towards moving document formatting completely to server side. The logic could not be moved completely because vscode doesn't appear to send updated values of tabSize and insertSpaces when sending textDocument/formatting or any other formatting related request. Hence, we register the providers on the client side and then manually send the textDocument/rangeFormatting request. The code is designed such that even textDocument/formatting and textDocument/onTypeFormatting requests are handled by textDocument/rangeFormatting. This is done to minimize code duplication.

As and when the tabSize and insertSpaces issues get resolved, we will only need to enable the formatting capabilities on server and add a textDocument/onTypeFormatting handler to completely move formatting to server-side.

Related PRs:

This and the related PRs should also help use resolve the following issues:

@@ -286,158 +247,12 @@ class PSDocumentFormattingEditProvider implements
PSDocumentFormattingEditProvider.documentLocker.lock(document, unlockWhenDone);
}

private executeRulesInOrder(
Copy link
Contributor

Choose a reason for hiding this comment

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

So happy this is gone now!

Copy link
Contributor

@daviwil daviwil left a comment

Choose a reason for hiding this comment

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

Looks great!

@daviwil daviwil added this to the June 2017 milestone Jun 14, 2017
@daviwil daviwil merged commit 3ca6d4b into master Jun 14, 2017
@daviwil daviwil deleted the kapilmb/update-formatter branch June 14, 2017 03:03
@daviwil daviwil modified the milestones: June 2017, 1.4.0 Jun 16, 2017
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.

3 participants