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

JSDoc-style multi-line comments are wrongly indented #12249

Closed
thennothinghappened opened this issue Apr 23, 2024 · 3 comments · Fixed by microsoft/vscode#211202
Closed

JSDoc-style multi-line comments are wrongly indented #12249

thennothinghappened opened this issue Apr 23, 2024 · 3 comments · Fixed by microsoft/vscode#211202
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix Visual Studio Code Caused by (or depends on changes from) VS Code
Milestone

Comments

@thennothinghappened
Copy link

thennothinghappened commented Apr 23, 2024

Environment

  • OS and Version: MacOS Ventura 13.5
  • VS Code Version: 1.88.1
  • C/C++ Extension Version: v1.19.9
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary: When writing a multi-line documentation comment, the ending line is not indented correctly.

Steps to reproduce:

  1. On a new line, start a multi-line documentation comment: /**.
  2. The closing */ will be autocompleted, placing the cursor right before it.
  3. Press enter to expand the comment to a new line.
  4. The closing */ will not be correctly indented with the contents of the comment:
/**
 *
*/

Expected behavior:
I'd expect the closing comment line to be indented by one space to match with the comment body:

/**
 *
 */

Configuration and Logs

Log Diagnostics:

-------- Diagnostics - 24/04/2024, 08:42:08
Version: 1.19.9
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-arm64",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPath": "/usr/bin/clang++",
    "compilerPathIsExplicit": true,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.19.9.0
No active translation units.

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 9124

c_cpp_properties.json:

N/A - Problem presents with no configuration given with no workspace needed.

Language Server Log:

loggingLevel: Debug
loggingLevel has changed to: Debug
LSP: (invoked) cpptools/didChangeCppProperties (id: 6)
LSP: Sending response (id: 6)
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors

Other Extensions

Issue presents without any other extensions.

Additional context

No response

sean-mcmanus added a commit to sean-mcmanus/vscode that referenced this issue Apr 24, 2024
This fixes the issue at microsoft/vscode-cpptools#12249 .

This was removed in microsoft@98fa77a .

Then PR microsoft#160357 added /* */ autoClosingPair.
@sean-mcmanus
Copy link
Contributor

@thennothinghappened I have a PR against VS Code at microsoft/vscode#211202 which fixes this. You could also apply that PR manually to get the same behavior (although a VS Code update might overwrite those changes).

@sean-mcmanus sean-mcmanus self-assigned this Apr 24, 2024
@sean-mcmanus sean-mcmanus added Language Service Visual Studio Code Caused by (or depends on changes from) VS Code enhancement Improvement to an existing feature labels Apr 24, 2024
@sean-mcmanus sean-mcmanus added this to the 1.21 milestone Apr 30, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.21, 1.21.0 May 2, 2024
@bobbrow bobbrow added bug and removed enhancement Improvement to an existing feature labels May 14, 2024
alexr00 pushed a commit to microsoft/vscode that referenced this issue May 15, 2024
This fixes the issue at microsoft/vscode-cpptools#12249 .

This was removed in 98fa77a .

Then PR #160357 added /* */ autoClosingPair.
@sean-mcmanus
Copy link
Contributor

@thennothinghappened This should be fixed in the latest VS Code Insiders release, although you may have to wait till tomorrow's build, and the fix to Doxygen generation with /** isn't available till 1.21.0.

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label May 15, 2024
@bobbrow bobbrow added this to cpptools Jun 17, 2024
@bobbrow bobbrow moved this to Done in cpptools Jun 17, 2024
@bobbrow bobbrow modified the milestones: 1.21.0, 1.21 Jun 17, 2024
@sean-mcmanus
Copy link
Contributor

@thennothinghappened Fixed with the latest VS Code (and our doxygen comment generation with /** is fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.21.0).

@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix Visual Studio Code Caused by (or depends on changes from) VS Code
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants