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

Surround with try/catch reformats document #1631

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Sep 21, 2020

Fixes #1572
Requires eclipse-jdtls/eclipse.jdt.ls#1551

Signed-off-by: Snjezana Peco [email protected]

package.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
@snjeza snjeza force-pushed the issue-1572 branch 3 times, most recently from ac5ea0c to 0458644 Compare September 22, 2020 19:32
@fbricon
Copy link
Collaborator

fbricon commented Sep 25, 2020

unfortunately, if vscode's default setting is set to use spaces/4, but the document contains only tab/4, then adding new lines manually will have vscode automatically detect the indentation and insert tabs, but applying a code action will insert spaces.
That's the one good thing the previous code had, i.e. maintain consistent editing experience.

I think we'll need to apply #1081 to make it useable.

@snjeza
Copy link
Contributor Author

snjeza commented Sep 29, 2020

I think we'll need to apply #1081 to make it useable.

Agree.

@testforstephen
Copy link
Collaborator

There is another PR eclipse-jdtls/eclipse.jdt.ls#1657 to use #1081, so no need to take care of it in this PR.

@snjeza could you rebase and resolve the conflicts?

@snjeza
Copy link
Contributor Author

snjeza commented Feb 24, 2021

@snjeza could you rebase and resolve the conflicts?

Done.

Comment on lines +406 to +408
const editorConfig = workspace.getConfiguration('editor');
javaConfig.format.insertSpaces = editorConfig.get('insertSpaces');
javaConfig.format.tabSize = editorConfig.get('tabSize');
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should add "editor.insertSpaces" and "editor.tabSize" to the synchronized configuration sections as well.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@testforstephen testforstephen merged commit c45fd51 into redhat-developer:master Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surround with try/catch reformats document
3 participants