-
-
Notifications
You must be signed in to change notification settings - Fork 48
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] - Turn off Auto-closing pair for <
>
#153
Comments
Hi @Pontiac76 , VS Code does not (yet) support user defined auto-closing pairs, so each language extension defines its own sets. There is an open issue on their repo, bur no ETA (microsoft/vscode#38352). The You can, however, turn off all Hope this helps |
<
>
When and if VSC does support auto-closing pairs, it'd also get disabled. I ran into this issue when I was working in some comments and making notes about why something was as it was (4am coding trying to keep my mind straight on something that should have been simple) and it was driving me nuts. I appreciate the option being present for those that want to use that functionality, but I sincerely can't stand it when the IDE tries to "do things" for me. Can the option in the addons config be present to turn off all functionality for all the closing pairs instead of editing? I already deleted the parameters in the json. I'm much happier with that. But that's my style of coding, and yeah, i do understand the reason that it exists for generics. I'd still put in the closing "bracket" myself and not think about it. |
The If you think this setting should have a different default value/behavior, I would suggest you to open an issue at VS Code repo (https://github.com/microsoft/vscode/issues), so the team could evaluate your proposal. Hope this helps |
I don't think your default is good, @Pontiac76 is right.
C++ also heavily depends on generics, as you may or may not know, and yet if you look in its language-configuration.json in the corresponding extension, you'll notice it doesn't define that particular pair. Speaking of which, yes, you should disable auto-closing on strings and comments: "autoClosingPairs": [
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "(*", "close": "*)", "notIn": ["string", "comment"] },
], and probably define |
Hi @overanalytcl , I suggested to disable auto-closing pairs on strings and comments, as @Pontiac76 scenario looked like it was being interrupted while adding comments, but it appeared not to be enough. Instead, the request was to remove all auto-closing pairs. This change, I respectful disagree, and will not be made. If you want to disable all auto-closing pairs from the extension, simply use the VS Code setting that I commented above. On the other hand, specifically for the But, I'll leave it to the community/users. I'll reopen the issue gand If a good amount of users choose to remove it or make it available only for strings and comments, I'll change the extension. Hope this helps |
Let's vote... What would you like to see on auto-closing pair for
Thank you |
My vote is to have the ability to specifically CHOOSE which auto-complete function the user wants enabled. Every single one of those fields in that config json can be configured and can be set at script initialization. It doesn't have to be a read-once function. If a change happens, the script can be reloaded fast if that's what it takes. My solution that I have right now works for me. If you don't want to apply an option to turn off the autogen, I'm perfectly happy with that as well. I'll just leave my side to not update as to not mess with my preferred configuration file. This is your code, this is how you envision and how want to work with it, and I won't make demands and make harassing remarks about it. I'm just explaining my use case, what frustrates me with your solution, and offering the ability to add an enhancement for others who may also find what I'm experiencing to be hugely frustrating. To be sincerely honest, I was content (but saddened) with having this issue closed. But I'm glad you re-opened to revisit and see what other opinions are. I have other "concerns" in life that can raise my blood pressure. What a stranger does with code they wrote and freely distribute for others to use, I don't have a leg to stand on, nor the right I feel, to make demands for change, other than just offer suggestions to take the rough edges off for my use case. |
Oh... By the way... I don't think your earlier solution would have done the trick either. VSC doesn't know what Pascal is by default to generate a generic type of code. This is purely something on your script. I don't have this issue with other languages that I enter code in, like, HTML or PHP. Both languages are HUGE on < and >. Without looking at code, I suspect you're checking to see if that setting you suggested is on or off and and then having VSC do the inserts? Unless that variable specifically tells VSC to adapt and conform to that function and does its application on its own outside your script, still, it's your script that's feeding VSC to run those commands. |
There is no way to choose, as VS Code does not support that. The configuration must be upfront, defined solely on If you, or anyone knows how to make the extension customizable at this level, using VS Code APIs, feel free to open a PR, and I'll be glad to incorporate in the extension. On the other hand, if the poll above is not enough, and no PR is about to be open, the issue can be closed again. |
The auto-closing pairs are controlled exclusively by pascal.configuration.json, as can be seen in the package.json: "languages": [
{
"id": "pascal",
"aliases": [
"Pascal",
"pascal"
],
"extensions": [
".pas",
".p",
".dfm",
".fmx",
".dpr",
".dpk",
".lfm",
".dpr",
".lpr"
],
"configuration": "./pascal.configuration.json"
}
], The solution, as employed by the JS, C++ and C# extensions (I suppose also by the PHP one, I couldn't find the right file in Intelephense) is to keep {
"comments": {
"blockComment": [ "@*", "*@" ]
},
"brackets": [
["<!--", "-->"],
["<", ">"],
["{", "}"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}"},
{ "open": "[", "close": "]"},
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "@*", "close": "*@" }
],
"surroundingPairs": [
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "<", "close": ">" }
]
} and "comments": {
"lineComment": "//",
"blockComment": [
"/*",
"*/"
]
},
"brackets": [
[
"${",
"}"
],
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
]
],
"autoClosingPairs": [
{
"open": "{",
"close": "}"
},
{
"open": "[",
"close": "]"
},
{
"open": "(",
"close": ")"
},
{
"open": "'",
"close": "'",
"notIn": [
"string",
"comment"
]
},
{
"open": "\"",
"close": "\"",
"notIn": [
"string"
]
},
{
"open": "`",
"close": "`",
"notIn": [
"string",
"comment"
]
},
{
"open": "/**",
"close": " */",
"notIn": [
"string"
]
}
],
"surroundingPairs": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"'",
"'"
],
[
"\"",
"\""
],
[
"`",
"`"
],
[
"<",
">"
]
],
"colorizedBracketPairs": [
[
"(",
")"
],
[
"[",
"]"
],
[
"{",
"}"
],
[
"<",
">"
]
],
// ... |
I don't know if this is a BUG or a Feature request, but PLEASE OH PLEASE allow us to toggle the Auto Bracket functionality somewhere, somehow, without having to edit code or digging into settings.json for user or workspaces. It's SERIOUSLY annoying when hitting < and you get a forced > right after with no prompting.
I found pascal.configuration.json and will be removing ALL the automatic text functionality. I'm just worried next update to your code, my changes get nuked, so I've disabled the Auto Update on this one specific tool.
Environment/version
Steps to reproduce
You'll see a trailing >
That > is distracting and doesn't help at all when attempting to do <= or < or adding info to comments for auto documentation.
The text was updated successfully, but these errors were encountered: