Skip to content

VS Code fails to detect the correct indentation for certain YAML files #65668

Closed

Description

  • VSCode Version: 1.30.1
  • OS Version: macOS 10.14.2

Steps to Reproduce:

  1. Save the following as foo.yml:
version: 2

jobs:
  build:
    docker:
      - circleci/golang:1.11

  environment:
    TEST_RESULTS: /tmp/test-results

  steps:
    - checkout
    - run: mkdir -p $TEST_RESULTS # create the test results directory

    - restore_cache:
        keys:
          - v1-pkg-cache

    - run:
        name: dep ensure
        command: dep ensure -v

    - run:
        name: Run unit tests
        command: |
          trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
          go test -v ./... | tee ${TEST_RESULTS}/go-test.out

    - run:
        name: Build
        command: go build -v

    - save_cache:
        key: v1-pkg-cache
        paths:
          - "/go/pkg"

    - store_artifacts:
        path: /tmp/test-results
        destination: raw-test-output

    - store_test_results:
        path: /tmp/test-results
  1. Check the detected indentation, it will be 4 spaces, despite the file being indented with 2 spaces.

I didn't change any related settings.

The code that does this is src/vs/editor/common/model/indentationGuesser.ts and using the developer tools I can see that it returns 4 spaces for this file.

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. changed the title [-]VS Code fails to detect the correct indentation for YAML i[/-] [+]VS Code fails to detect the correct indentation for certain YAML files[/+] on Dec 25, 2018
  2. added
    bug
    on Jan 7, 2019
  3. added
    verified
    on Jan 31, 2019
  4. locked and limited conversation to collaborators on Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions