opencode-qml-lsp
v0.3.0
Published
QML language server support for OpenCode — auto-detect qmlls, filter diagnostics, auto-fix warnings
Maintainers
Readme
opencode-qml-lsp
QML language server support for OpenCode.
Features
- Auto-detect qmlls — finds qmlls binary and PySide6 QML import paths
- Generate .qmlint — suppresses noisy warnings (unqualified access, block-scope-var)
- Custom LSP config — generates the correct
lspblock for youropencode.json - Auto-fix tool —
qml_fix_warningsfixes common lint issues automatically
Installation
1. Add to your opencode.json
{
"plugin": ["opencode-qml-lsp"]
}2. Run setup in your QML project
Open OpenCode in your QML project directory and ask the AI to run:
run qml_setupOr invoke the qml_setup tool directly. This generates two files:
.qmlint— suppresses noisy warningsopencode-qml-lsp.config.json— thelspconfig block to merge intoopencode.json
3. Merge the LSP config
Copy the lsp block from opencode-qml-lsp.config.json into your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"qmlls": {
"command": ["/path/to/qmlls", "-E", "-I/path/to/PySide6/Qt/qml"],
"extensions": [".qml", ".qrc"]
}
}
}Custom Tools
qml_setup
Detects qmlls, finds PySide6 QML import paths, and generates .qmlint + LSP config. No arguments needed.
qml_fix_warnings
Fixes QML lint warnings in a file:
qml_fix_warnings({
filePath: "my_canvas_app/views/canvas.qml",
fixTypes: ["var-to-let", "remove-unused-imports", "qualify-access"]
})Fix Types
| Fix Type | What it does |
|---|---|
| var-to-let | Replaces var with let in JS blocks |
| remove-unused-imports | Removes unused import statements |
| qualify-access | Adds root. prefix to unqualified property accesses |
Development
# Clone
git clone https://github.com/your-username/opencode-qml-lsp.git
cd opencode-qml-lsp
# Install dependencies
npm install
# Link locally for testing
ln -s $(pwd) ~/.config/opencode/plugins/opencode-qml-lsp
# Or use npm link
npm linkLicense
MIT
