BigBahss / vscode-cmantic

C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
https://bigbahss.github.io/vscode-cmantic/
MIT License
84 stars 9 forks source link

Refactoring (Add Definition) began to work strangely. I can't find the reason #52

Open alex290 opened 1 year ago

alex290 commented 1 year ago

Hello. Refactoring (Add Definition) began to work strangely. When added to the cpp file, only curly braces are created. I don't understand where to look for the reason.

It used to work fine

civcode commented 1 year ago

I'm experiencing the same issue. However, in my case it only occurs when I'm using the Remote-SSH plugin to connect to the server. When I'm working directly on the server or via RDP, the Add Definition feature work fine. Setup:

lglgdouble commented 1 year ago

me too,but i find some connection with ms-vscode.cpptools。1.12.4 is ok

alex290 commented 1 year ago

me too,but i find some connection with ms-vscode.cpptools。1.12.4 is ok

Thank you so much, friend. It worked!!

lglgdouble commented 1 year ago

@BigBahss

civcode commented 1 year ago

me too,but i find some connection with ms-vscode.cpptools。1.12.4 is ok

Thanks! Solved my issues as well.

alex290 commented 1 year ago

I solved the problem in a different way

  1. Removed the Microsoft C++ extension
  2. I installed the llvm-vs-code-extensions extension
  3. I installed an LLVM program for the full operation of CLANG
  4. I put the .clang-format file in the root of the project to configure the formatting of the code
BasedOnStyle: Google
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 500
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
    AfterClass: 'true'
    AfterControlStatement: 'true'
    AfterEnum : 'true'
    AfterFunction : 'true'
    AfterNamespace : 'true'
    AfterStruct : 'true'
    AfterUnion : 'true'
    BeforeCatch : 'true'
    BeforeElse : 'true'
    IndentBraces : 'false'
}

And everything works fine. Everything works even faster

geiseri commented 1 year ago

I think this is related to #57. I am wondering if there is something strange when interfacing with the ms-vscode.cpptools the API changed somehow. When I run this command I see the following on the Remote Extension Host window:

[warning] tdennis4496.cmantic - Code actions of kind 'quickfix 'requested but returned code action is of kind 'refactor'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.

Do you see that error?