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

Indent function arguments #1993

Closed
voidtrance opened this issue May 14, 2018 · 7 comments
Closed

Indent function arguments #1993

voidtrance opened this issue May 14, 2018 · 7 comments

Comments

@voidtrance
Copy link

I am not sure whether this should be a bug report or a feature request, so I am not entirely sure what information to include.

I am using:

  • VSCode 1.23.1
  • C/C++ extension: 0.17.0
  • C++ Intellisense 0.2.2
  • C/C++ Clang Command Adapter 0.2.2

The issue that I am having is that function arguments, which span multiple lines are not indented properly. What I would expect is this:

function_call(arg1, arg2, arg3,
              arg4, arg5);

What I get is this:

function_call(arg1, arg2, arg3,
arg4, arg5);

If I were to use the Tab key to indent the second argument line, I can't indent to the correct spot without doing it manually (Hit Tab until I get close and then hit Space until aligned).

@sean-mcmanus
Copy link
Contributor

Related to #883 .

@sean-mcmanus sean-mcmanus added Language Service Feature Request help wanted Can be fixed in the public (open source) repo. labels May 15, 2018
@voidtrance
Copy link
Author

Forgive my lack of GitHub knowledge but what does the "help wanted" label mean here? Do you need help from me in order to fix this issue.

Indentation is one of the main reasons why I can't start using vscode on regular basis and I'd like to get this fixed so if there is anything required from me, I'd like to know about it.

@sean-mcmanus
Copy link
Contributor

It's just a tag specific to our repo. We use it mean that we believe it can be fixed via changes to our open source code on this repo, so if anyone wants it fixed sooner than we can get around to it then we could accept a pull request. We don't need your help specifically. Fixing this issue might be very difficult or impossible though using the regular expression mechanism present in VS Code (see #883 for another user's attempt to fix auto-indent).

Our team has mostly been focused on implementing the intellisense features and not editing/indentation issues.

@voidtrance
Copy link
Author

voidtrance commented May 16, 2018

I understand that fixing this might be difficult. Therefore, the following is my plea...

In my opinion, this comes down to code-style support. A lot of projects do specify a coding style that all committed code should adhere to. This includes indentation. As such, it would be important for VS Code to be able to support various coding styles.

As an example, I wouldn't be able to use VS Code without the pain of manually formatting indentation on the Linux kernel.

To be perfectly honest, I've tried many, many IDEs and automatic and intelligent indentation has been the major deterrent in almost all of them.

@bobbrow
Copy link
Member

bobbrow commented May 16, 2018

Do you use clang-format? It may not be ideal that we don't auto-indent for you while typing (yet), but you can configure VS Code to run clang-format on your file when you save or when you type a closing curly brace, if either of those are options for you.

@voidtrance
Copy link
Author

No, I don't use it. Thank you for the suggestion. At this point, I am reluctant to have VS Code run an external application to get the formatting right. I also don't want to spend the time to configure clang-format. I see the indentation capability as a core feature (yes, I realize that this is personal opinion/preference).

Unfortunately, this means that I have to abandon VS Code for now. It's too bad because I generally like it but the indentation is a must-have for me. Hopefully, this bug will get some attention soon.

@bobbrow
Copy link
Member

bobbrow commented Dec 5, 2019

This will be addressed by #657

@bobbrow bobbrow closed this as completed Dec 5, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants