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

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

Open
alex290 opened this issue Oct 25, 2022 · 7 comments

Comments

@alex290
Copy link

alex290 commented Oct 25, 2022

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
Copy link

civcode commented Nov 8, 2022

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:

  • Server: x86_64, Ubuntu 22.04, xRDP server, c++ project runs here (C-mantic plugin and C/C++ IntelliSense plugin are installed)
    image

  • Client: x86_64, Win 10, Connecting to server via VS Code with Remote-SSH plugin or via RDP

@lglgdouble
Copy link

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

@alex290
Copy link
Author

alex290 commented Dec 12, 2022

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

Thank you so much, friend. It worked!!

@lglgdouble
Copy link

@BigBahss

@civcode
Copy link

civcode commented Dec 23, 2022

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

Thanks! Solved my issues as well.

@alex290
Copy link
Author

alex290 commented Jan 21, 2023

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
Copy link

geiseri commented Mar 22, 2023

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?

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

No branches or pull requests

4 participants