Skip to content

Add variable IntelliSense, hover tooltips, sidebar panel, diagnostics, and go-to-definition#15

Open
ivan-velasco wants to merge 4 commits into
Thiht:masterfrom
ivan-velasco:feature/dx-02
Open

Add variable IntelliSense, hover tooltips, sidebar panel, diagnostics, and go-to-definition#15
ivan-velasco wants to merge 4 commits into
Thiht:masterfrom
ivan-velasco:feature/dx-02

Conversation

@ivan-velasco
Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive variable support to the Venom VS Code extension, making it easier to discover, inspect, and navigate variables inside *.venom.yml test suites.

  • Autocomplete — suggests available variables when typing inside {{ }} templates, scoped to the current test case and step
  • Hover tooltips — shows variable source and details on hover; hover a specific variable for its info, or hover {{ / }} for a compact list of all in-scope variables
  • Sidebar panel — new "Venom > Variables" view in the activity bar showing a tree of global, suite, and step variables for the active file
  • Diagnostics — warns on {{.varname}} references that don't match any in-scope variable (suite vars, prior step vars, globals, or built-ins)
  • Go-to-definition — Ctrl+click / F12 on a {{.varname}} reference jumps to the vars: block where it is defined
  • Global variables — recognizes variables from .venomrc (variables, variables_files) and CLI args (--var, --var-from-file)
  • Step-prefixed references — supports {{.stepName.varName}} syntax (e.g. {{.login.token}}) across all features
  • Schema — adds name property to step types in venom.schema.json

Test plan

  • Open a *.venom.yml file and verify autocomplete triggers inside {{ }}
  • Hover a variable reference to see its source; hover {{ to see all in-scope vars
  • Check the "Variables" sidebar panel updates as you switch files
  • Verify warnings appear for undefined variable references
  • Ctrl+click a variable to jump to its definition
  • F12 a variable to jump to its definition
  • Test {{.stepName.varName}} references resolve correctly
  • Run npm test — unit tests pass

Other Misc

Test runs

  • Removed the strict Venom version check so custom or locally built binaries are not rejected incorrectly.
  • Handles Venom output when there are multiple JSON files: ignores *.dump.json and selects the real test_results JSON.
  • Detects legacy vs new result format from the JSON shape (not only test_results.json).
  • Parses results safely when entries are missing or malformed instead of throwing.

Test Explorer

  • Reuses rich failure UI (diff + link to the .venom.yml line) for more error types, not only assertion mismatches.
  • “Unexpected output” problems are reported on the test run instead of a blocking modal.

Editing

  • Schema: optional name on steps is allowed so the YAML validator matches Venom.

(Note: removing the pre-run venom version call also drops unused version() export if that was only used for the gate.)

Example of plugin in action

new-dx2.mov

… Added support for viewing and managing global variables, updated .venomrc structure, and improved file watching for configuration changes. Updated package.json to include new views and commands.
…ded functions for finding variable definitions in YAML and registered new diagnostics and definition commands in the extension activation process. Updated existing constants to be exported for broader access.
…rences and improved variable definition resolution. Added functions to handle dotted variable paths in YAML and updated tests to validate new functionality.
@ivan-velasco
Copy link
Copy Markdown
Contributor Author

@Thiht let me know if you need anything else to get this merged. Thanks.

@ivan-velasco
Copy link
Copy Markdown
Contributor Author

@Thiht Any insights if you plan on merging more contributions?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant