Skip to content

Let read-only editors show problems #89057

Closed

Description

I'm working on an extension that lets users compile Jsonnet files and view them as read-only JSON files.

I would like to add support for JSON Schema to the JSON outputs so that if the output is not valid, VSCode highlights the errors in the output created as a virtual document by the custom content provider.

However; VSCode doesn't seem to validate read-only files so JSON schema validator doesn't work on virtual documents. When I convert the scheme to untitled, the validation does work but since the JSON outputs are idempotent (generated from Jsonnet files), I don't want to give the users the ability to edit/save the JSON output as the output is irrelevant.

I believe that the validation is useful for the read-only files as well. It would be great if we can disable the code actions and make the validation at least optional depending on how the extension creates the virtual documents.

Activity

  1. changed the title [-]Make validation work in virtual documents[/-] [+]Make the validation work in virtual documents[/+] on Jan 21, 2020
  2. aeschli commented on Jan 23, 2020

    @aeschli
    Contributor

    The JSON language server validates all documents of language id json and jsonc.
    The problem view shows the errors, but not the editor.

  3. changed the title [-]Make the validation work in virtual documents[/-] [+]Let read-only editors show problems[/+] on Jan 23, 2020
  4. buremba commented on Jan 23, 2020

    @buremba
    Author

    I see, thanks for the info Martin Aeschlimann (@aeschli). That explains why I started seeing the errors when I installed the extension usernamehw.errorlens.

  5. added
    feature-request
    languages-diagnostics
    on Jan 24, 2020
  6. vscodebot commented on Jan 24, 2020

    @vscodebot

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  7. bpasero commented on Jan 24, 2020

    @bpasero
    Contributor

    I wouldn't even know where to start looking to do this, I have no clue how the editor decides to show errors or not. Back to other folks.

  8. 9 remaining items

  9. alexdima commented on Jan 24, 2020

    @alexdima
    Member

    Benjamin Pasero (@bpasero) Sorry about that, I had my boolean logic wrong :D

  10. bpasero commented on Jan 24, 2020

    @bpasero
    Contributor

    Nice. This is now enabled for all text editors, but not for these which always had custom editor config overrides:

    • log viewer
    • output panel
    • preferences editor

    image

  11. buremba commented on Jan 24, 2020

    @buremba
    Author

    Wow! I didn't expect you to fix the issue that fast. Thanks, folks. :)

  12. added
    verification-needed
    on Jan 24, 2020
  13. bpasero commented on Jan 24, 2020

    @bpasero
    Contributor

    Burak Emre Kabakcı (@buremba) would be great if you could verify this fix on next week Monday when we have an insiders build out with this included.

  14. buremba commented on Jan 24, 2020

    @buremba
    Author
  15. buremba commented on Jan 30, 2020

    @buremba
    Author

    Benjamin Pasero (@bpasero) thanks for checking in, it works just fine!

  16. locked and limited conversation to collaborators on Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestlanguages-diagnosticsverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions