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

Adding format selection for VSCode plugin #933

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

Exiled1
Copy link

@Exiled1 Exiled1 commented Aug 17, 2023

Aims to resolve #659

Replaces the old languages registerDocumentFormattingEditProvider for registerDocumentRangeFormattingEditProvider to add range formatting support. Note: registerDocumentRangeFormattingEditProvider still acts as a document formatter so the old one is not needed.

Potential issues: Currently only accepts valid AST code, so selecting an entire local function doesn't work, however selecting the contents of the function should work the same since that makes a valid AST.

@shocklateboy92
Copy link
Collaborator

Do you want to merge this as-is (behind an experimental config and a warning that depending on the selection, things will behave weirdly?
Or is this just to gather feedback on code style while you work on the actual implementation modifying the backend?

@Exiled1
Copy link
Author

Exiled1 commented Aug 21, 2023

Do you want to merge this as-is (behind an experimental config and a warning that depending on the selection, things will behave weirdly? Or is this just to gather feedback on code style while you work on the actual implementation modifying the backend?

@shocklateboy92 I think this can be merged as-is currently. However it should be noted that I'm going to be implementing the options we talked about into the process for mapping AST nodes to their place pre and post formatting. The reason I bring this up is because I'll probably have to revisit this at a later date in an issue to update the format selection.

For the future:

  • I'll be opening a new Issue to add in support for the change that I'll be doing with the process options since I think that the plugin will need to pass it over to the process.

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.

Format only the selected code
2 participants