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

YAML (Ansible file type) autoindentation doesn't work #148528

Closed
Tracked by #1
life5ign opened this issue May 1, 2022 · 3 comments
Closed
Tracked by #1

YAML (Ansible file type) autoindentation doesn't work #148528

life5ign opened this issue May 1, 2022 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@life5ign
Copy link

life5ign commented May 1, 2022

We have written the needed data into your clipboard because it was too large to send. Please paste.

Issue Type: Bug

YAML files and Ansible files do not autoindent.

VS Code version: Code 1.66.2 (dfd34e8, 2022-04-11T07:49:24.808Z)
OS version: Linux x64 5.13.0-7620-generic
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz (16 x 4112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 62.51GB (12.90GB free)
Process Argv --unity-launch --crash-reporter-id bf08a8e5-a4e6-4b9c-a674-2d09badb4fb3
Screen Reader no
VM 0%
DESKTOP_SESSION pop
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP pop
XDG_SESSION_TYPE x11
Extensions (28)
Extension Author (truncated) Version
ng-template Ang 13.3.1
vscode-eslint dba 2.2.2
EditorConfig Edi 0.16.4
vscode-npm-script eg2 0.3.24
prettier-vscode esb 9.5.0
angular-essentials joh 13.0.0
Angular2 joh 13.0.0
vscode-peacock joh 4.0.1
vscode-docker ms- 1.22.0
python ms- 2022.4.1
vscode-pylance ms- 2022.4.3
jupyter ms- 2022.3.1000901801
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.6
remote-containers ms- 0.231.6
remote-ssh ms- 0.78.0
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.2
vscode-remote-extensionpack ms- 0.21.0
debugger-for-chrome msj 4.13.0
debugger-for-edge msj 1.0.15
angular-console nrw 17.16.0
material-icon-theme PKi 4.16.0
ansible red 0.8.1
vscode-yaml red 1.7.0
LiveServer rit 5.7.5
vim vsc 1.22.2
markdown-pdf yza 1.4.4

(6 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30475217

@aeschli
Copy link
Contributor

aeschli commented May 3, 2022

Can you describe more what kind of auto indentation you expect?
Please provide a small code sample with steps, what you see, and what you expect.

@aeschli aeschli added the info-needed Issue requires more information from poster label May 3, 2022
@life5ign
Copy link
Author

life5ign commented May 3, 2022

Hello, for Ansible language mode, which I have configured, I expect this line:

- name: test

to have the cursor indent two spaces (below the "n" of "name") when I press Enter, which it doesn't.

I then also expect this example to indent two spaces from the start of the "d" character in "directive", which it doesn't, when I press Enter:

- name: test
  directive:

In other words, for Ansible language mode in vscode , I expect the special - name: test structure to always be followed by an indentation. Technically, in pure yaml, that's a list element with dicrionary, which I would expect to be followed by an auto "-" in normal yaml, with no indentation, meaning I wanted to continue the list, but not in ansible.

Then for any dictionary following that, I expect an autoindent every time only a dictionary key is specified (the value will be indented on the next line), but no additional autoindentation if a value is specified after a key (in this case, the cursor should align with the beginning of the previous key, since the next line will represent the next item in the dictionary, which already works).

@life5ign life5ign changed the title YAML autoindentation doesn't work YAML (Ansible file type) autoindentation doesn't work May 3, 2022
@aeschli
Copy link
Contributor

aeschli commented May 4, 2022

Let's track this in redhat-developer/vscode-yaml#279 as they are they are the YAML experts.

@aeschli aeschli closed this as completed May 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants
@connor4312 @aeschli @life5ign and others