Setting up VSCode
VSCode stub https://en.wikipedia.org/wiki/Visual_Studio_Code
Location of function/class braces
According to the Moodle coding guidelines
https://docs.moodle.org/dev/Coding_style#Functions_and_methods_2
"the brace should always be written on same line as the function name."
By default VSCode uses the PSR coding convention https://www.php-fig.org/psr/psr-2/#1-overview that braces appear on the next line when the internal formatter is used. (Cmd -K-F on OSX).
This can be changed via a file called
omnisharp.json
Which can be placed either in the root of the project or as a configuration in the users home dir, e.g. ~/.omnisharp/omnisharp.json
The following example will put braces on the same line as the function/class declaration
{
"FormattingOptions": {
"NewLinesForBracesInLambdaExpressionBody": false,
"NewLinesForBracesInAnonymousMethods": false,
"NewLinesForBracesInAnonymousTypes": false,
"NewLinesForBracesInControlBlocks": false,
"NewLinesForBracesInTypes": false,
"NewLinesForBracesInMethods": false,
"NewLinesForBracesInProperties": false,
"NewLinesForBracesInObjectCollectionArrayInitializers": false,
"NewLinesForBracesInAccessors": false,
"NewLineForElse": false,
"NewLineForCatch": false,
"NewLineForFinally": false
}
}
See
https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options