Add qml lsp support

This commit is contained in:
Henrik Quanz
2025-01-13 15:59:59 +01:00
committed by mattn
parent bd6c80e758
commit 07f39b2f45
4 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
@echo off
setlocal
set version="0.2"
curl -L -o "qmlls-windows.zip" "https://github.com/TheQtCompanyRnD/qmlls-workflow/releases/download/%version%/qmlls-windows-%version%.zip"
call "%~dp0\run_unzip.cmd" qmlls-windows.zip qmlls.exe
del qmlls-windows.zip

27
installer/install-qmlls.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
set -e
os=$(uname -s | tr "[:upper:]" "[:lower:]")
url="${url_ubuntu}"
platform="ubuntu"
version="0.2"
case $os in
linux)
platform="ubuntu"
;;
darwin)
platform="macos"
;;
*)
echo "unknow platform: $os"
exit 1
;;
esac
curl -L -o "qmlls-${platform}.zip" "https://github.com/TheQtCompanyRnD/qmlls-workflow/releases/download/${version}/qmlls-${platform}-${version}.zip"
tar -xf "qmlls-${platform}.zip" qmlls
rm "qmlls-${platform}.zip"
chmod +x qmlls

View File

@@ -1438,6 +1438,17 @@
]
}
],
"qml": [
{
"command": "qmlls",
"url" : "https://github.com/qt/qtdeclarative",
"description": "An implementation of the Language Server Protocol for qml/qmljs",
"requires": [],
"root_uri_patterns": [
".qmlls.ini"
]
}
],
"r": [
{
"command": "r-languageserver",

11
settings/qmlls.vim Normal file
View File

@@ -0,0 +1,11 @@
augroup vim_lsp_settings_qmlls
au!
LspRegisterServer {
\ 'name': 'qmlls',
\ 'cmd': {server_info->lsp_settings#get('qmlls', 'cmd', [lsp_settings#exec_path('qmlls')])+lsp_settings#get('qmlls', 'args', ['-E'])},
\ 'root_uri':{server_info->lsp_settings#get('qmlls', 'root_uri', lsp_settings#root_uri('qmlls'))},
\ 'allowlist': lsp_settings#get('qmlls', 'allowlist', ['qml', 'qmljs']),
\ 'blocklist': lsp_settings#get('qmlls', 'blocklist', []),
\ 'config': lsp_settings#get('qmlls', 'config', lsp_settings#server_config('pyls-all')),
\ }
augroup END