Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>YAML SQL NavigatorNew to Visual Studio Code? Get it now.
YAML SQL Navigator

YAML SQL Navigator

Evgenii Konev

|
1 install
| (0) | Free
Navigate and preview SQL files referenced in YAML configurations
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

YAML SQL Navigator

A VS Code extension that enhances YAML files containing SQL file references with navigation, preview, and autocomplete features.

Features

🔗 Click-to-Navigate

  • Cmd+Click (Mac) or Ctrl+Click (Windows/Linux) on SQL file paths in YAML to open them directly
  • Works with patterns like sql_file: support_tables/statist/leave_max_action.sql

🔍 Hover Preview

  • Hover over SQL file paths to see a preview of the SQL content
  • Shows file information (path, line count)
  • Displays first 500 characters with syntax highlighting
  • Lists all SQL variables found in the file

✨ Autocomplete

  • IntelliSense for SQL file paths when typing after sql_file: or SQL_SCRIPT_FILE_NAME:
  • Automatically scans dags/social_dataset/sql_scripts_dlh/ directory
  • Shows all available .sql files with relative paths

🎨 Syntax Highlighting

  • Enhanced syntax highlighting for SQL file paths in YAML
  • Special highlighting for sql_file and SQL_SCRIPT_FILE_NAME keys

🚨 NEW: SQL-YAML Variable Linting

  • Real-time validation of variables between SQL files and YAML configs
  • Red error markers for missing variables in YAML
  • Dual error reporting: Shows errors on both task name and sql_file: lines
  • Global variable support: Includes top-level YAML variables
  • YAML anchor resolution: Validates that anchor references exist
  • Trino SQL support: Works specifically with type: 'dlh' tasks

Supported Patterns

The extension recognizes these YAML patterns:

# SQL file references
sql_file: support_tables/statist/leave_max_action.sql
SQL_SCRIPT_FILE_NAME: check_src_tables.sql

# Quoted paths
sql_file: "support_tables/statist/prepare_logs.sql"
sql_file: 'support_tables/statist/select_logs.sql'

# Embedded SQL (basic highlighting)
query: |
  SELECT * FROM users
  WHERE active = true

Installation

Method 1: Install from .vsix file (Recommended for development)

  1. Open VS Code or Cursor
  2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Type "Extensions: Install from VSIX..."
  4. Select the yaml-sql-navigator-0.0.1.vsix file from this directory
  5. Reload VS Code when prompted

Method 2: Development Installation

  1. Clone or copy this extension directory
  2. Open terminal in the extension directory
  3. Run: npm install
  4. Run: npm run compile
  5. Press F5 to launch Extension Development Host
  6. Open your YAML files in the new window

Usage

  1. Open any YAML file in your workspace
  2. Navigate to lines containing sql_file: or SQL_SCRIPT_FILE_NAME:
  3. Hover over the file path to see preview
  4. Cmd+Click on the file path to open the SQL file
  5. Start typing after sql_file: to get autocomplete suggestions

Requirements

  • VS Code 1.74.0 or higher
  • Workspace should contain dags/social_dataset/sql_scripts_dlh/ directory structure

Extension Settings

This extension doesn't add any VS Code settings currently. All features work automatically on YAML files.

Known Issues

  • File paths are resolved relative to dags/social_dataset/sql_scripts_dlh/ - this is hardcoded for your specific project structure
  • Only .sql files are recognized for autocomplete and navigation

Development

To modify this extension:

  1. Edit files in src/ directory
  2. Run npm run compile to build
  3. Run npm run package to create new .vsix file
  4. Reinstall the updated extension

Release Notes

0.0.1

Initial release with:

  • Click-to-navigate SQL file references
  • Hover preview of SQL content
  • Autocomplete for SQL file paths
  • Enhanced syntax highlighting
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft