Skip to content

bug: input descriptions keep their opening quote #326

Open

Description

@eFAILution

Bug summary

Input descriptions written in quotes show up with a stray opening quote in hover, completion docs and the Component Browser details panel. description: 'OpenTofu version that should be used.' displays as 'OpenTofu version that should be used.

The cause is src/parsers/specParser.ts:302. substring(12) keeps the space after description:, so the ^["'] half of the regex never matches and only the closing quote is stripped. Trimming before the replace should fix it.

Steps to reproduce

  1. Include gitlab.com/components/opentofu/validate-plan@4.9.0 with an inputs: block.
  2. Hover opentofu_version under inputs:.
  3. Observe the description starts with '.

The details panel for secret-detection shows the same thing with double quotes ("The stage where the secret detection scanning job will run.).

Expected behavior

The description shows without quotes.

Actual behavior

The opening quote stays, the closing one is removed.

Component context (if applicable)

Any component that quotes its input descriptions, which is most of gitlab.com/components.

Minimal .gitlab-ci.yml snippet

include:
  - component: gitlab.com/components/opentofu/validate-plan@4.9.0
    inputs:
      opentofu_version: 1.12.6

Extension logs

No response

Affected area

Hover provider

Extension version

0.17.19

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions