Support templ

This commit is contained in:
Yasuhiro Matsumoto
2021-10-26 22:00:19 +09:00
parent f1c1c956f8
commit db44714704
4 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
@echo off
call "%~dp0\go_install.cmd" github.com/a-h/templ/cmd/templ@latest

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
"$(dirname "$0")/go_install.sh" github.com/a-h/templ/cmd/templ@latest

View File

@@ -826,7 +826,7 @@
{
"command": "racket-lsp",
"requires": [
"raco"
"raco"
]
}
],
@@ -1028,6 +1028,20 @@
]
}
],
"templ": [
{
"command": "templ",
"requires": [
"go"
],
"vim_plugin": {
"extensions": [
"templ"
],
"name": "Joe-Davidson1802/templ.vim"
}
}
],
"toml": [
{
"command": "taplo-lsp",

21
settings/templ.vim Normal file
View File

@@ -0,0 +1,21 @@
augroup vim_lsp_settings_templ
au!
LspRegisterServer {
\ 'name': 'templ',
\ 'cmd': {server_info->lsp_settings#get('templ', 'cmd', [lsp_settings#exec_path('templ')]+lsp_settings#get('templ', 'args', ['lsp']))},
\ 'root_uri':{server_info->lsp_settings#get('templ', 'root_uri', lsp_settings#root_uri('templ'))},
\ 'initialization_options': lsp_settings#get('templ', 'initialization_options', {
\ 'completeUnimported': v:true,
\ 'matcher': 'fuzzy',
\ 'codelenses': {
\ 'generate': v:true,
\ 'test': v:true,
\ },
\ }),
\ 'allowlist': lsp_settings#get('templ', 'allowlist', ['templ']),
\ 'blocklist': lsp_settings#get('templ', 'blocklist', []),
\ 'config': lsp_settings#get('templ', 'config', lsp_settings#server_config('templ')),
\ 'workspace_config': lsp_settings#get('templ', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('templ', 'semantic_highlight', {}),
\ }
augroup END