Otter has been configured to provide LSP features for code embedded in other files (like SQL in Python strings, bash in scripts, etc.).
Otter is activated for these languages:
- python - Python code
- javascript/typescript - JS/TS code
- lua - Lua code
- rust - Rust code
- bash/sh - Bash/shell scripts
- go - Go code
- cpp/c - C/C++ code
- java - Java code
- ruby - Ruby code
- php - PHP code
- perl - Perl code
- r - R code
- sql - SQL queries
<leader>oa- Activate Otter for current buffer<leader>od- Deactivate Otter for current buffer<leader>os- Show Otter status
When you open a file (like a Python script), Otter will:
- Detect embedded code in strings, comments, or other contexts
- Provide LSP features (completion, diagnostics, hover, etc.) for the embedded language
- Work alongside your main LSP server
In a Python file with embedded SQL:
import sqlite3
# This SQL will get LSP features from Otter
query = """
SELECT name, age
FROM users
WHERE active = 1
ORDER BY name;
"""
conn = sqlite3.connect('database.db')
cursor = conn.execute(query) # SQL completion and diagnostics hereOtter is configured in lua/scribe/plugins.lua with:
- LSP hover borders
- Diagnostic updates on file changes
- Support for quote character stripping
- Leading whitespace handling
Use the test_otter.py file to see Otter in action with embedded bash and SQL code.