Closed h2110100 closed 9 months ago
Here's is the full error
[Formatter](Thread-4:common.py#L709): [INFO] Current mode: Quick Options:
{
"debug": true,
"format_on_unique": true,
"format_on_paste": [
"clangformat"
],
"format_on_save": [
"clangformat"
]
}
▋[Formatter](Thread-4:formatter.py#L36): [DEBUG] Target: D:\IO\Code\codebreaker.cpp
▋[Formatter](Thread-4:formatter.py#L37): [DEBUG] Scope: source.c++ meta.preprocessor.include.c++ keyword.control.import.include.c++
▋[Formatter](Thread-4:formatter.py#L38): [DEBUG] Syntax: c++
▋[Formatter](Thread-4:formatter.py#L39): [DEBUG] Formatter ID: clangformat
▋[Formatter](Thread-4:common.py#L291): [DEBUG] User executable found: C:\Program Files\Clang\clang-format\clang-format.exe
▋[Formatter](Thread-4:common.py#L402): [DEBUG] Config [default]: C:\Users\The Fool\AppData\Roaming\Sublime Text\Packages\User\formatter.assets\config\clang_format_google_rc.yaml
▋[Formatter](Thread-4:formatter_clangformat.py#L83): [DEBUG] Current arguments: ['C:\\Program Files\\Clang\\clang-format\\clang-format.exe', '--style', '{"AccessModifierOffset": -1, "AlignAfterOpenBracket": "Align", "AlignArrayOfStructures": "None", "AlignConsecutiveAssignments": {"Enabled": false, "AcrossEmptyLines": false, "AcrossComments": false, "AlignCompound": false, "PadOperators": true}, "AlignConsecutiveBitFields": {"Enabled": false, "AcrossEmptyLines": false, "AcrossComments": false, "AlignCompound": false, "PadOperators": false}, "AlignConsecutiveDeclarations": {"Enabled": false, "AcrossEmptyLines": false, "AcrossComments": false, "AlignCompound": false, "PadOperators": false}, "AlignConsecutiveMacros": {"Enabled": false, "AcrossEmptyLines": false, "AcrossComments": false, "AlignCompound": false, "PadOperators": false}, "AlignEscapedNewlines": "Left", "AlignOperands": "Align", "AlignTrailingComments": true, "AllowAllArgumentsOnNextLine": true, "AllowAllParametersOfDeclarationOnNextLine": true, "AllowShortEnumsOnASingleLine": true, "AllowShortBlocksOnASingleLine": "Never", "AllowShortCaseLabelsOnASingleLine": false, "AllowShortFunctionsOnASingleLine": "All", "AllowShortLambdasOnASingleLine": "All", "AllowShortIfStatementsOnASingleLine": "WithoutElse", "AllowShortLoopsOnASingleLine": true, "AlwaysBreakAfterDefinitionReturnType": "None", "AlwaysBreakAfterReturnType": "None", "AlwaysBreakBeforeMultilineStrings": true, "AlwaysBreakTemplateDeclarations": true, "AttributeMacros": ["__capability"], "BinPackArguments": true, "BinPackParameters": true, "BraceWrapping": {"AfterCaseLabel": false, "AfterClass": false, "AfterControlStatement": "Never", "AfterEnum": false, "AfterFunction": false, "AfterNamespace": false, "AfterObjCDeclaration": false, "AfterStruct": false, "AfterUnion": false, "AfterExternBlock": false, "BeforeCatch": false, "BeforeElse": false, "BeforeLambdaBody": false, "BeforeWhile": false, "IndentBraces": false, "SplitEmptyFunction": true, "SplitEmptyRecord": true, "SplitEmptyNamespace": true}, "BreakBeforeBinaryOperators": "None", "BreakBeforeConceptDeclarations": "Always", "BreakBeforeBraces": "Attach", "BreakBeforeInheritanceComma": false, "BreakInheritanceList": "BeforeColon", "BreakBeforeTernaryOperators": true, "BreakConstructorInitializersBeforeComma": false, "BreakConstructorInitializers": "BeforeColon", "BreakAfterJavaFieldAnnotations": false, "BreakStringLiterals": true, "ColumnLimit": 80, "CommentPragmas": "^ IWYU pragma:", "QualifierAlignment": "Leave", "CompactNamespaces": false, "ConstructorInitializerIndentWidth": 4, "ContinuationIndentWidth": 4, "Cpp11BracedListStyle": true, "DeriveLineEnding": true, "DerivePointerAlignment": true, "DisableFormat": false, "EmptyLineAfterAccessModifier": "Never", "EmptyLineBeforeAccessModifier": "LogicalBlock", "ExperimentalAutoDetectBinPacking": false, "PackConstructorInitializers": "NextLine", "BasedOnStyle": "", "ConstructorInitializerAllOnOneLineOrOnePerLine": false, "AllowAllConstructorInitializersOnNextLine": true, "FixNamespaceComments": true, "ForEachMacros": ["foreach", "Q_FOREACH", "BOOST_FOREACH"], "IfMacros": ["KJ_IF_MAYBE"], "IncludeBlocks": "Regroup", "IncludeCategories": [{"Regex": "^<ext/.*\\\\.h>", "Priority": 2, "SortPriority": 0, "CaseSensitive": false}, {"Regex": "^<.*\\\\.h>", "Priority": 1, "SortPriority": 0, "CaseSensitive": false}, {"Regex": "^<.*", "Priority": 2, "SortPriority": 0, "CaseSensitive": false}, {"Regex": ".*", "Priority": 3, "SortPriority": 0, "CaseSensitive": false}], "IncludeIsMainRegex": "([-_](test|unittest))?$", "IncludeIsMainSourceRegex": "", "IndentAccessModifiers": false, "IndentCaseLabels": true, "IndentCaseBlocks": false, "IndentGotoLabels": true, "IndentPPDirectives": "None", "IndentExternBlock": "AfterExternBlock", "IndentRequiresClause": true, "IndentWidth": 2, "IndentWrappedFunctionNames": false, "InsertBraces": false, "InsertTrailingCommas": "None", "JavaScriptQuotes": "Leave", "JavaScriptWrapImports": true, "KeepEmptyLinesAtTheStartOfBlocks": false, "LambdaBodyIndentation": "Signature", "MacroBlockBegin": "", "MacroBlockEnd": "", "MaxEmptyLinesToKeep": 1, "NamespaceIndentation": "None", "ObjCBinPackProtocolList": "Never", "ObjCBlockIndentWidth": 2, "ObjCBreakBeforeNestedBlockParam": true, "ObjCSpaceAfterProperty": false, "ObjCSpaceBeforeProtocolList": true, "PenaltyBreakAssignment": 2, "PenaltyBreakBeforeFirstCallParameter": 1, "PenaltyBreakComment": 300, "PenaltyBreakFirstLessLess": 120, "PenaltyBreakOpenParenthesis": 0, "PenaltyBreakString": 1000, "PenaltyBreakTemplateDeclaration": 10, "PenaltyExcessCharacter": 1000000, "PenaltyReturnTypeOnItsOwnLine": 200, "PenaltyIndentedWhitespace": 0, "PointerAlignment": "Left", "PPIndentWidth": -1, "RawStringFormats": [{"Language": "Cpp", "Delimiters": ["cc", "CC", "cpp", "Cpp", "CPP", "c++", "C++"], "CanonicalDelimiter": "", "BasedOnStyle": "google"}, {"Language": "TextProto", "Delimiters": ["pb", "PB", "proto", "PROTO"], "EnclosingFunctions": ["EqualsProto", "EquivToProto", "PARSE_PARTIAL_TEXT_PROTO", "PARSE_TEST_PROTO", "PARSE_TEXT_PROTO", "ParseTextOrDie", "ParseTextProtoOrDie", "ParseTestProto", "ParsePartialTestProto"], "CanonicalDelimiter": "pb", "BasedOnStyle": "google"}], "ReferenceAlignment": "Pointer", "ReflowComments": true, "RemoveBracesLLVM": false, "RequiresClausePosition": "OwnLine", "SeparateDefinitionBlocks": "Leave", "ShortNamespaceLines": 1, "SortIncludes": "CaseSensitive", "SortJavaStaticImport": "Before", "SortUsingDeclarations": true, "SpaceAfterCStyleCast": false, "SpaceAfterLogicalNot": false, "SpaceAfterTemplateKeyword": true, "SpaceBeforeAssignmentOperators": true, "SpaceBeforeCaseColon": false, "SpaceBeforeCpp11BracedList": false, "SpaceBeforeCtorInitializerColon": true, "SpaceBeforeInheritanceColon": true, "SpaceBeforeParens": "ControlStatements", "SpaceBeforeParensOptions": {"AfterControlStatements": true, "AfterForeachMacros": true, "AfterFunctionDefinitionName": false, "AfterFunctionDeclarationName": false, "AfterIfMacros": true, "AfterOverloadedOperator": false, "AfterRequiresInClause": false, "AfterRequiresInExpression": false, "BeforeNonEmptyParentheses": false}, "SpaceAroundPointerQualifiers": "Default", "SpaceBeforeRangeBasedForLoopColon": true, "SpaceInEmptyBlock": false, "SpaceInEmptyParentheses": false, "SpacesBeforeTrailingComments": 2, "SpacesInAngles": "Never", "SpacesInConditionalStatement": false, "SpacesInContainerLiterals": true, "SpacesInCStyleCastParentheses": false, "SpacesInLineCommentPrefix": {"Minimum": 1, "Maximum": -1}, "SpacesInParentheses": false, "SpacesInSquareBrackets": false, "SpaceBeforeSquareBrackets": false, "BitFieldColonSpacing": "Both", "Standard": "Auto", "StatementAttributeLikeMacros": ["Q_EMIT"], "StatementMacros": ["Q_UNUSED", "QT_REQUIRE_VERSION"], "TabWidth": 8, "UseCRLF": false, "UseTab": "Never", "WhitespaceSensitiveMacros": ["STRINGIZE", "PP_STRINGIZE", "BOOST_PP_STRINGIZE", "NS_SWIFT_NAME", "CF_SWIFT_NAME"]}', '--assume-filename', 'dummy.cpp']
▋[Formatter](Thread-4:formatter_clangformat.py#L97): [ERROR] File not formatted due to an error (exitcode=255): "The filename, directory name, or volume label syntax is incorrect.
"
▋[Formatter](Thread-4:main.py#L418): [DEBUG] Formatting failed. 💔😢💔
To the first issue: I have updated the clang-format commands, as they were not present when Formatter was born.
Regarding the second issue: Editing settings in the left-hand pane under Formatter > Settings will lead to it consistently reverting to the default one, while the right-hand pane is where user customizations should be made.
But now there this error
Formatter: [ERROR] File not formatted due to an error (exitcode=255): "'gmock' is not recognized as an internal or external command,
and I have also updated the plugin
Without using Formatter, could you please run from terminal to see what is happening:
"C:\\Program Files\\Clang\\clang-format\\clang-format.exe" --style=file:"C:\\Users\\The Fool\\AppData\\Roaming\\Sublime Text\\Packages\\User\\formatter.assets\\config\\clang_format_google_rc.yaml" --assume-filename=dummy.cpp "C:\\path\\to\\file\\test.cpp" --
test.cpp
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter an integer: ";
cin >> n;
if (n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
return 0;
}
This is what i got on windows:
▋[Formatter](Thread-44:formatter_clangformat.py#L80): [DEBUG] Current arguments: ['C:\\Users\\admin\\Downloads\\clang-format.exe', '--style=file:C:\\Users\\admin\\AppData\\Roaming\\Sublime Text\\Packages\\User\\formatter.assets\\config\\clang_format_google_rc.yaml', '--assume-filename=dummy.cpp', '-']
▋[Formatter](Thread-44:main.py#L415): [DEBUG] Formatting successful. 🎉😃🍰
It prints
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter an integer: ";
cin >> n;
if (n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
return 0;
}
but not the formatting successful status
gmock
is neither part of the executed arguments nor it is part of Formatter codebase. I do not have any clue how it appears here. The input command arguments chain and your logs seem to be correct. Formatter only feeds the correct command arguments to the subprocess. However, I could not reproduce this issue with the exitcode 255 on my Mac and Windows. This must be done on your system. You could try to:
These are all that one can do and where Formatter directly invokes.
The dummy --assume-filename=dummy.
is part of the command arguments and Formatter handles correct this ways, otherwise we will get an another type of error.
Update: @h2110100 It should get fixed now i think.
It does work now. Thanks for your time!
@h2110100 Thanks for your time to testing and bug report! I released 1.1.6 to address this issue.
Firstly. Here is the error from the debug console
"StatementAttributeLikeMacros": ["Q_EMIT"], "StatementMacros": ["Q_UNUSED", "QT_REQUIRE_VERSION"], "TabWidth": 8, "UseCRLF": false, "UseTab": "Never", "WhitespaceSensitiveMacros": ["STRINGIZE", "PP_STRINGIZE", "BOOST_PP_STRINGIZE", "NS_SWIFT_NAME", "CF_SWIFT_NAME"]}', '--assume-filename', 'dummy.cpp'] Formatter: [ERROR] File not formatted due to an error (exitcode=255): "The filename, directory name, or volume label syntax is incorrect.
Here is my settings.js: `{ // Enable debug mode to view errors in the console. "debug": true,
}`
Secondly, everytime I save and exit sublime text, the settings file return back to the demo one.