zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.66k stars 3.14k forks source link

Generic YAML file error: ansible-schema #4304

Open fearoffish opened 11 months ago

fearoffish commented 11 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When I open a generic YAML file it's showing syntax errors for ansible-schema. Example:

ansible-schema: Ansible Tasks Schema: Incorrect type. Expected one of array, null. 0

So it's incorrectly registering it as an ansible schema file, but it's just a generic one.

Environment

Zed: v0.116.1 (stable) OS: macOS 13.6.1 Memory: 8 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

CleanShot 2023-12-19 at 09 27 24

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

2023-12-19T09:28:52 [
ERROR] unexpected item event after pane was dropped
2023-12-19T09:29:18 [ERROR] unexpected item event after pane was dropped

2023-12-19T09:29:19 [ERROR] unexpected item event after pane was dropped
2023-12-19T09:29:20 [ERROR] unexpected item event after pane was dropped
2023-12-19T09:29:20 [ERROR] unexpected item event after pane was dropped
2023-12-19T09:29:36 [INFO] 
Initializing default prettier with plugins {}
goblinfactory commented 9 months ago

Does anyone have a workaround for this please?

Update I found the following hacky workaround to disable the language server. Add the following to your ZED settings.json

  "language_overrides": {
    "YAML": {
      "enable_language_server": false
    }
baptisteArno commented 3 months ago

Same issue and I found that it is only happening for YAML files located in a tasks folder

RemiBardon commented 2 months ago

Might be related to

notpeter commented 2 months ago

This is an upstream yaml-language-server issue. If you know the schema of your file, you can provide a modeline in a comment to link to the json schema on schemastore, local file or other url:

# yaml-language-server: $schema=https://json.schemastore.org/github-action.json

Additionally, there is an open issue to add support for a modeline which explicitly disabled schema validation: