Open raffeale opened 2 years ago
I'll add some additional information:
Arduino IDE 1.x adds a closing */
when Enter is pressed on a line that starts with an unclosed /*
:
Arduino IDE 2.x does not have any auto closing of block comments:
The VS Code built-in cpp extension used by Arduino IDE 2.x does allow this to be configured via the autoClosingPairs
key in its language-configuration.json
file:
--- a/resources/app/plugins/vscode-builtin-cpp/extension/language-configuration.json
+++ b/resources/app/plugins/vscode-builtin-cpp/extension/language-configuration.json
@@ -8,11 +8,12 @@
"autoClosingPairs": [
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
- { "open": "\"", "close": "\"", "notIn": ["string"] }
+ { "open": "\"", "close": "\"", "notIn": ["string"] },
+ { "open": "/*", "close": "*/", "notIn": ["string", "comment"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
It seems this is not configurable via the settings UI: https://github.com/microsoft/vscode/issues/38352
However, that configuration does not result in behavior matching Arduino IDE 1.x:
And that auto-closing behavior seems to be the source of frustration for people who are attempting to comment out blocks of existing code, which is a relatively common use for block comments:
https://github.com/microsoft/vscode-cpptools/issues/3891
https://github.com/microsoft/vscode-cpptools/issues/3904
https://github.com/microsoft/vscode/issues/77008
Describe the bug there is a bug in Arduino IDE 2.0, when I type /** and press enter key , the ide did not automatic close the comment statement!
Desktop (please complete the following information): os: MacOS 11.6 BigSur