stoplightio / vscode-spectral

VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support

Home Page:https://marketplace.visualstudio.com/items?itemName=stoplight.spectral

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extension does not clean up Problems view after correcting an error

DavidBiesack opened this issue · comments

Describe the bug

Spectral finds a problem; in this case, a $ref cannot be resolved. The extension properly shows valid problems

Screen Shot 2022-09-30 at 9 25 54 AM

However, after I correct the paths for those $ref, Spectral does not remove the errors. It leave error items and text markers in the source.

Screen Shot 2022-09-30 at 9 31 52 AM

Even closing the file and opening it again does not clear the problems view. I have to exit VS Code and restart.

Similarly, when Spectral adds a problem about an unused component, that problem persists
even after adding a .spectral.yaml file containing

extends: spectral:oas
rules:
  oas3-unused-component: false

To Reproduce

unzip the attachment
Even though the command

$ cd apis/common
$ spectral lint -r .spectral.yaml openapi.yaml 
No results with a severity of 'error' found!

the VS Code view still shows the problems.

For this small example, the problem view does clear when I fix the $ref from

        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'

to

        '401':
          $ref: '../common/openapi.yaml#/components/responses/401'
        '403':
          $ref: '../common/openapi.yaml#/components/responses/403'

but in my working OpenAPI (3000+ lines) it does not refresh

Expected behavior

Clear errors for a file after the file has been edited and re-scanned.

Environment: