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

[Feature request] automatically close brackets and quotes even when no text is selected #272

Closed
BachiMjavanadze opened this issue May 30, 2023 · 5 comments

Comments

@BachiMjavanadze
Copy link

Please add in your extention the ability to automatically close brackets even when no text is selected.

Automatic brace completion does not works properly in Visual Studio IDE:

vs-img

but VSCode does this job correctly:

vscode-gif

I would disable Visual Studio IDE standard behavior:

image

and enable your extension's option. I suggest to add into settings one more option:

AutomaticalyCloseAnyBraces: true/false

enabling this option should cause automatically close open braces: (), {}, []

mouse cursor should be between braces: (|), {|}, [|]

to avoid incorrect behavior angle brackets should not auto close:

if(a<>b)

P.S. Please do it also for double quotes "|" and single quotes '|'

@wmjordan
Copy link
Owner

The situation is somewhat complicated.
Kind of alike #198, I guess.

@wmjordan
Copy link
Owner

wmjordan commented Jun 29, 2023

I studied the behavior of the auto-completion of parentheses in VS Code.
It always completes the right part of the parentheses pair.
VS will check the next character to the caret, if it is the right parenthesis, it won't automatically add the right parenthesis.
However, adding the ")" by hand is not so difficult since our finger is already on top of the "(".

It is not easy for Codist to add the ")" since it is unpredictable whether Codist or VS will complete the parentheses pair first.
It can lead to a situation that both of them inserts the ")" and duplicated ")"s certainly suck. Maybe you should push the VS guys more.

@wmjordan wmjordan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
@BachiMjavanadze
Copy link
Author

@wmjordan I did it: Auto Close & Surround Punctuations. Fill free to include it to your extension

@wmjordan
Copy link
Owner

wmjordan commented Jun 7, 2024

Interesting!
I have trouble visiting the extension website. Do you host your extension on Github?

@BachiMjavanadze
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants