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

"final" specifier breaks formatting #6638

Closed
pascal-soveaux opened this issue Dec 8, 2020 · 4 comments
Closed

"final" specifier breaks formatting #6638

pascal-soveaux opened this issue Dec 8, 2020 · 4 comments
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@pascal-soveaux
Copy link

pascal-soveaux commented Dec 8, 2020

Type: LanguageService

Hello,

Am I on the right place to submit the following issue ?

On my VSCode editor on linux, using the "final" specifier breaks formatting

        class API_INTERNAL IContext /*No final: it works */
        {
            protected:
            virtual ~IContext() = default;
        };

        class API_INTERNAL Context final /*  When using "final": it does not*/
            : public IContext
        {
}

Thanks,

Pascal

@pascal-soveaux pascal-soveaux changed the title "final" keyword breaks formatting "final" specifier breaks formatting Dec 8, 2020
@sean-mcmanus sean-mcmanus self-assigned this Dec 8, 2020
@sean-mcmanus
Copy link
Collaborator

I'm not able to repro a formatting problem with your sample code. Can you provide a screenshot? Also, what are your formatting settings?

@sean-mcmanus sean-mcmanus added Feature: Code Formatting Language Service more info needed The issue report is not actionable in its current state labels Dec 8, 2020
@pascal-soveaux
Copy link
Author

pascal-soveaux commented Dec 8, 2020

I am sorry, I put the blame on the final specifier too quickly. You need to have both attribute and final to reproduce.

You can see that formatting only works if I remove one of the two, with both formatting does not work
final

The code is wrong (copied/pasted) but it does not changed anything once corrected.

Sorry for that.

Thank you.

Here is what I have in settings

"[cpp]": {
    "editor.defaultFormatter": "ms-vscode.cpptools"
  },
  "C_Cpp.formatting": "vcFormat",
  "C_Cpp.commentContinuationPatterns": [
    {
      "start": "/**",
      "continue": "*",
      "end": "*/"
    }
  ],
  "C_Cpp.loggingLevel": "Debug",
  "C_Cpp.default.cppStandard": "c++14",
  "C_Cpp.default.cStandard": "c11",
  "C_Cpp.vcFormat.indent.accessSpecifiers": true,
  "C_Cpp.vcFormat.indent.braces": false,
  "C_Cpp.vcFormat.indent.preprocessor": "none",
  "C_Cpp.vcFormat.indent.withinParentheses": "alignToParenthesis",
  "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "newLine",
  "C_Cpp.inactiveRegionForegroundColor": "gray",
  "C_Cpp.vcFormat.wrap.preserveBlocks": "never",
  "C_Cpp.vcFormat.space.beforeBlockOpenBrace": false,
  "C_Cpp.vcFormat.newLine.scopeBracesOnSeparateLines": true,

Version: 1.51.1
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-10T23:31:29.624Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-56-generic

@sean-mcmanus sean-mcmanus added Visual Studio Inherited from Visual Studio and removed more info needed The issue report is not actionable in its current state labels Dec 8, 2020
@sean-mcmanus sean-mcmanus added this to the Tracking milestone Dec 8, 2020
@sean-mcmanus
Copy link
Collaborator

Thanks for the info. I've filed a bug on VS with our shared formatting code: https://developercommunity.visualstudio.com/content/problem/1281567/cc-formatting-doesnt-work-with-when-a-class-defini.html

@sean-mcmanus sean-mcmanus removed their assignment Dec 8, 2020
@sean-mcmanus sean-mcmanus modified the milestones: Tracking, 1.13.2 Sep 29, 2022
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Sep 29, 2022
@sean-mcmanus sean-mcmanus removed the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 4, 2022
@sean-mcmanus sean-mcmanus modified the milestones: 1.13.2, 1.13.3 Oct 4, 2022
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 6, 2022
@sean-mcmanus sean-mcmanus removed the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 6, 2022
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 13, 2022
@sean-mcmanus
Copy link
Collaborator

The fix is available with 1.13.3 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.3

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
None yet
Development

No branches or pull requests

2 participants