Skip to content

bug: validation: unknown-input Quick Fix suggestions aren't ranked by similarity #333

Open

Description

@eFAILution

Bug summary

For an unknown input, the Quick Fix offers the first three declared inputs, however close they are. src/providers/validationProvider.ts:519 filters out the unknown name and keeps the first three in declaration order. The first one is also marked isPreferred, so Auto Fix would apply an unrelated input.

With excluded_path on sast the list is enable_mr_pipelines, excluded_analyzers, excluded_paths, with enable_mr_pipelines preferred. Ranking by edit distance or shared prefix would put excluded_paths first.

Steps to reproduce

  1. Use the snippet below.
  2. Put the cursor on excluded_path and press Cmd+..

Expected behavior

The closest match comes first and is the preferred fix.

Actual behavior

Inputs are offered in declaration order and the first one is preferred.

Component context (if applicable)

gitlab.com/components/sast/sast@3.5.0.

Minimal .gitlab-ci.yml snippet

include:
  - component: gitlab.com/components/sast/sast@3.5.0
    inputs:
      excluded_path: "spec, tmp"

Extension logs

No response

Affected area

Validation 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