dotnet / dotnet/vscode-csharp

Auto indentation rules

Open
#4,327 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

C# indentation rules are missing from this extention so action based formatting will not work, see example below.

This has been brought up in a couple of other language extentions ([python](https://github.com/microsoft/vscode-python/issues/8996), [c++](https://github.com/microsoft/vscode-cpptools/issues/883)) and is a little niche but would be really cool to get this working in this extention as some other extentions rely on this method for formatting e.g. [VSCode/Vim](https://github.com/VSCodeVim/Vim)

## Steps to reproduce
Map a key to `editor.action.reindentselectedlines`
Put cursor inside a function on a line with an incorrectly line like this
![image](https://user-images.githubusercontent.com/17244425/103470947-37808e00-4dc5-11eb-98ec-e444422aef16.png)
Execute the key/action for `editor.action.reindentselectedlines`

## Expected behavior
The line should be formatted and indented correctly inside the function like this
![image](https://user-images.githubusercontent.com/17244425/103470964-672f9600-4dc5-11eb-96eb-a67c837c52a3.png)

## Actual behavior
The line remains in the same place as VSCode does not know the correctly indenting rules for the language
![image](https://user-images.githubusercontent.com/17244425/103470947-37808e00-4dc5-11eb-98ec-e444422aef16.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.