Good morning, sir,
I use VisualStudio Code to code in C language. I recently discovered the Prettier extension for C, ( and "C/C++")
I saw that I could add an automatic indentation, when I added a ";" or when I saved with Ctrl+S.
with the addition of the lines ;
"editor.formatOnSave": true,
"editor.formatOnType": true
in visual studio's settings.json file.
Now, despite the almost perfect indentation, I wanted to make some adjustments such as the fact that after an initialization of variable type int
there's not a space but a tabulation, like this;
int x;
//rather than;
int x;
as well as for the type of functions
void ft_function(int x);
//rather than ;
void ft_function(int x);
(Because I have a standard to meet, and when I save or what, all the indentation of these variable initializations no longer meets my standard)
I don't know anything about json, and I've just discovered the function so I was wondering if the geniuses in the forum know anything about it, and if so how? At least some leads ^^
I found the setting "C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, AlignConsecutiveDeclarations: true }"
It works for my variables alignement but not for the functions. Therefore, my functions got auto-indent like this:
int ft_strlen(char *str) {
int i;
i = 0;
while (str[i])
i++;
return (i);
}
I would like something like:
int ft_strlen(char *str) {
int i;
i = 0;
while (str[i])
i++;
return (i);
}