vscode-github-actions
vscode-github-actions copied to clipboard
Copy/Pasting YAML results in wrong indentation
Describe the bug
Copy Pasting yaml when file is identified as GitHub workflow is messed up.
To Reproduce
https://github.com/github/vscode-github-actions/assets/153052/3e056158-fbe9-44f0-b987-6b3fc96c8f48
Expected behavior N/A
Screenshots N/A
Extension Version
v0.25.8
Additional context Add any other context about the problem here.
Do you have any YAML auto-formatter installed?
I do have the redhat.vscode-yaml extension installed.
I see the same behavior where the GitHub workflow doesn't copy/paste the same as a regular YAML file. I don't have another YAML extension installed.
I am on Windows 11 using the desktop version.
GitHub workflow (I noticed I can't find any way to paste it so that it is in the right place with just the paste, I have to do further editing to get it in the right place no matter where I place the cursor to paste):
Regular YAML file:
I've experienced the same issue for months as well. It's a shame because I really like what the extension has to offer. I just leave it disabled.
I think this may be solved by the following setting
"[github-actions-workflow]": {
"editor.autoIndent": "keep"
}
I spent some time tinkering with this incorrectly for the "[yaml]" settings group, not realizing that "[github-actions-workflow]" is considered a separate language. Does this work for others?
@neil176 Thank you! That fixed this for me as well.
"[github-actions-workflow]": { "editor.autoIndent": "keep" }
where to add this
@Lekshmisr26 In the VScode setting file settings.json, see https://code.visualstudio.com/docs/getstarted/settings#_settingsjson.
Same awful experience here. The first line of a pasted block has the indentation always changed wrong, while the rest of the YAML block stays as is. I don't have any YAML-related extension active. I use YAML only in GitHub workflows.
Same awful experience here. The first line of a pasted block has the indentation always changed wrong, while the rest of the YAML block stays as is.
I find an Undo (Cmd/Ctrl + Z) after pasting helps.