microsoft / microsoft/vscode-cpptools

Indent can not be aligned to the parenthsis for the functions with structure pointer return value

Open
#10,395 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Code Formatting Language Service more votes needed Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Bug

Indent can not be aligned to the parenthsis for the functions with structure pointer return value, even if "C_Cpp.vcFormat.indent.withinParentheses" has been set to "alignToParenthesis". For the below example, the "enum ynr_slot_list_type type" should be aligned to the left parenthsis of "(uint8_t cam_id", but it is only indented with a tab.
struct ynr_slot *ynr_peer_last_slot(uint8_t cam_id,
enum ynr_slot_list_type type);

Extension version: 1.13.9
VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T16:59:02.252Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.13.0-51-generic
Remote OS version: Linux x64 5.13.0-51-generic
Connection to 'ssh-remote+10.106.35.200' could not be established

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.85GB (4.06GB free)
Process Argv --crash-reporter-id f8d5cbc7-a399-423b-a5bb-d7767774009e
Screen Reader no
VM 50%
Item Value
Remote SSH: 10.106.35.200
OS Linux x64 5.13.0-51-generic
CPUs Intel(R) Xeon(R) Silver 4314 CPU @ 2.40GHz (64 x 800)
Memory (System) 125.35GB (77.07GB free)
VM 0%
Item Value
Remote SSH: 10.106.35.200
OS Linux x64 5.13.0-51-generic
CPUs Intel(R) Xeon(R) Silver 4314 CPU @ 2.40GHz (64 x 800)
Memory (System) 125.35GB (77.07GB free)
VM 0%

Connection to 'ssh-remote+10.106.35.200' could not be established

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848:30577860
nodejswelcome1cf:30587006
2e4cg342:30602488
89544117:30613380
fim-prod:30623723

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported C/C++ formatting case with C_Cpp.vcFormat.indent.withinParentheses set to alignToParenthesis. Verify that the second parameter type aligns with the opening parenthesis after the function name for a structure-pointer return value.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.