pulumi / pulumi-lsp

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

Tokens with dashes in name throw errors #74

Open jaxxstorm opened 2 years ago

jaxxstorm commented 2 years ago

What happened?

I defined a resource from an MLC with token aws-tailscale:index:Bastion

Steps to reproduce

Define some resource like so:

name: yaml_aws_tailscalebastion
runtime: yaml
resources:
  vpc:
    type: awsx:ec2:Vpc
    properties:
      cidrBlock: "172.20.0.0/22"
  bastion:
    type: "aws-tailscale:index:Bastion"
    properties:
      vpcId: ${vpc.vpcId}
      subnetIds: ${vpc.privateSubnetIds}
      route: "172.20.0.0/22"
      region: "us-west-2"

outputs:
  url: ${vpc.vpcId}

Expected Behavior

No errors

Actual Behavior

image

Output of pulumi about

No response

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

RobbieMcKinstry commented 2 years ago

Bizarre! It looks like a pretty straight-forward parsing error... which is definitely odd!

RobbieMcKinstry commented 2 years ago

@jaxxstorm I traced the parsing code to Pulumi-Yaml. Given that you've opened this code in LSP, I assume that means the code executed fine? It just shows a false positive error in your editor?

RobbieMcKinstry commented 2 years ago

Tracing the code, this is the first place that actually does any parsing, so I'm unsure why you'd get a parse error in the LSP but Pulumi would accept that same code -- they use the same parser. Hmm...