yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

Code completion interactions with the Pulumi YAML LSP server

Open AaronFriel opened this issue 3 years ago • 6 comments

Hey folks! First I want to say, awesome work on schematizing and providing great completions for YAML documents. It's a great extension.

Background

The Pulumi team is working on an LSP server for our domain specific language, Pulumi YAML, for which static shipped schemas are not the right approach. For context, each YAML program can use multiple resource providers at distinct versions, each of which supports returning its own schema. Our Azure schemas weigh around 100MiB for each version, and that's just one provider!

Accordingly, we've been investing in an LSP server catering to our language & our simple expression language.

What's not working

When a user has both the Red Hat YAML and Pulumi YAML LSP extensions installed, code completions misbehave - double completing or editing the document in "incorrect" ways.

Solutions

I think if we could exclude "Pulumi.yaml" files from your LSP server's activations, or have the Red Hat plugin not serve files if it detects (I am unsure how) that the Pulumi YAML LSP is active for Pulumi.yaml files we might resolve the issue.

AaronFriel avatar Oct 03 '22 16:10 AaronFriel

Are you shipping yaml-language-server as part of your solution?

gorkem avatar Nov 18 '22 14:11 gorkem

Are you shipping yaml-language-server as part of your solution?

Nope, but lots of us have both installed.

iwahbe avatar Nov 18 '22 17:11 iwahbe

what is the language identifier for pulumi.yaml? If it is YAML, at least vscode will activate it. we do list * .yaml files but I suspect even without us listing the file extension vscode would wake this LSP through language identifier.

gorkem avatar Nov 19 '22 14:11 gorkem

It's YAML. We're hoping to keep the general language support for YAML, we just get LSP server conflicts. My understanding is that changing the language identifier will disable all language specific plugins (because it will be a different language).

iwahbe avatar Nov 19 '22 19:11 iwahbe

What kind of conflicts do you get? Is there a schema associated somehow with pulumi files. If that is the case, you can try to set it to a dummy schema using the extension API.

gorkem avatar May 03 '23 04:05 gorkem

@gorkem there is not a fixed schema for Pulumi YAML, as the valid properties for a YAML program depend on the providers (values) used, and are dynamic.

We would want a way to prevent the Red Hat YAML language server from trying to offer completions for Pulumi.yaml files in particular.

AaronFriel avatar May 04 '23 05:05 AaronFriel