Skip to content

Linter lints old version when comparing diffs #281

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

Open
kristof-mattei opened this issue Nov 24, 2023 · 0 comments
Open

Linter lints old version when comparing diffs #281

kristof-mattei opened this issue Nov 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kristof-mattei
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create & commit the following workflow:

    # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
    name: Build
    
    on:
      pull_request:
        branches:
          - main
    
    permissions:
      contents: read
    
    jobs:
      build:
        name: Build
        runs-on: ubuntu-latest
        outputs:
          build_id: ${{ steps.build.build_id }}
        steps:
          - name: Checkout
            uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
            with:
              show-progress: false
    
          - name: Build
            id: build
            shell: bash
            run: |
              echo "Building"
              echo "build_id=12345" >> "$GITHUB_OUTPUT"
    
  2. Notice the linting warning on ${{ steps.build.build_id }}: Context access might be invalid: build_id.

  3. Delete the following lines, save but do NOT commit:

        outputs:
          build_id: ${{ steps.build.build_id }}
  4. In the diff window compare the changes

  5. (BUG 1) (while diff is open) Notice the LEFT window showing the linting warning, which also shows up under 'PROBLEMS'

    image

  6. (while diff is open) Double click the warning under problems and notice it opens a locked (denoted the padlock next to the name) version of the previous, unedited version of build.yaml.

    image

  7. Close the diff & locked old version of build.yaml

  8. (BUG 2) Notice the linting error is still there under 'PROBLEMS'

    image

  9. (BUG 2 related) When double clicking linting warning it opens up the same locked (denoted the padlock next to the name) version of the previous, unedited version of build.yaml.

  10. (BUG 1) Now when hitting 'CTRL+P' to switch between files there are 2 entries for build.yaml which are indistinguishable, yet refer to different versions:

    image

Expected behavior
Only errors on the new version are reported.

Screenshots
See reproduction

Extension Version
v0.26.2

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog 🗒
Development

No branches or pull requests

1 participant