add tsp-server

This commit is contained in:
Yasuhiro Matsumoto
2025-04-26 10:45:11 +09:00
parent 82cae9df8f
commit 853e9a6bc9
4 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
@echo off
call "%~dp0\npm_install.cmd" tsp-server @typespec/compiler

View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -e
"$(dirname "$0")/npm_install.sh" tsp-server @typespec/compiler

View File

@@ -1981,6 +1981,16 @@
]
}
],
"typespec": [
{
"command": "tsp-server",
"url": "https://github.com/microsoft/typespec",
"description": "TypeSpec Language Server",
"requires": [
"npm"
]
}
],
"typ": [
{
"command": "typst-lsp",

14
settings/tsp-server.vim Normal file
View File

@@ -0,0 +1,14 @@
augroup vim_lsp_settings_tsp_server
au!
LspRegisterServer {
\ 'name': 'tsp-server',
\ 'cmd': {server_info->lsp_settings#get('tsp-server', 'cmd', [lsp_settings#exec_path('tsp-server')]+lsp_settings#get('tsp-server', 'args', ['--stdio']))},
\ 'root_uri':{server_info->lsp_settings#get('tsp-server', 'root_uri', lsp_settings#root_uri('tsp-server'))},
\ 'initialization_options': lsp_settings#get('tsp-server', 'initialization_options', {}),
\ 'allowlist': lsp_settings#get('tsp-server', 'allowlist', ['typespec']),
\ 'blocklist': lsp_settings#get('tsp-server', 'blocklist', []),
\ 'config': lsp_settings#get('tsp-server', 'config', lsp_settings#server_config('tsp-server')),
\ 'workspace_config': lsp_settings#get('tsp-server', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('tsp-server', 'semantic_highlight', {}),
\ }
augroup END