pulumi / pulumi-lsp

A LSP server for Pulumi YAML
Apache License 2.0
22 stars 0 forks source link

Make compatible with Red Hat YAML #56

Open iwahbe opened 2 years ago

iwahbe commented 2 years ago

Hello!

Issue details

Affected area/feature

ericrudder commented 1 year ago

Note additional detail on https://github.com/pulumi/pulumi-lsp/issues/77

joeduffy commented 1 month ago

Notably, it appears you get an error if you have both installed:Image

EronWright commented 1 month ago

Note that an extension may be disabled on a per-workspace basis, but it isn't clear to me whether the "Disable Red Hat YAML" button disables for this workspace or globally.

Also, the current arrangement of having the Pulumi LSP be a sub-extension of the main extension allows the user to disable the LSP without losing the debugging or ESC functionality.

EronWright commented 1 month ago

Some points about the Red Hat YAML extension:

  1. It exposes an extension API that seemingly allows other extensions to supply a schema for the document, see src/schema-extension-api.ts.
  2. It too has some extension conflict logic: src/extensionConflicts.ts.
lukehoban commented 1 month ago

A note from @ringods related to this:

the Github Actions extension also manages YAML files but doesn't conflict with Redhat YAML. Looking into their package.json, they register a separate language and limit the scope to some file patterns: https://github.com/github/vscode-github-actions/blob/44facd0a4a4cbb64c0eead90df04195028e10063/package.json#L33-L49

Looking at the docs for contributes.languages extension point, I think we will have to experiment with filename patterns and/or firstline option for our extension to be picked up as the language instead of being treated as generic YAML by the Redhat extension. https://code.visualstudio.com/api/references/contribution-points#contributes.languages

mhmdio commented 4 days ago

Any update? 🤔

We are using GitHub Actions, Pulumi, and K8s daily, so I need to install all three extensions.

Image

The only thing worked for us was adding this to the settings:

  "files.associations": {
    "Pulumi.yaml": "pulumi-esc",
    "Pulumi.*.yaml": "pulumi-esc"
  }