@void2610/tyranoscript-lsp
v0.8.3
Published
TyranoScript Language Server for VS Code and Zed
Readme
@void2610/tyranoscript-lsp
Language Server for TyranoScript. Used by the VS Code extension tyranoscript-vscode and the Zed extension tyranoscript-zed.
Features
- Tag name completion (on
[or@input) - Parameter completion (already used parameters are excluded)
- Snippet insertion for required parameters
- Hover documentation for tags and parameters
- Automatic workspace indexing for assets, labels, macros, and characters
- Indexes
tf.xxxvariable definitions and references - Asset file completion for
storage="" - Label completion (
*xxx) fortarget="" - User-defined macro completion and hover documentation
- Hover descriptions from comments immediately above label definitions
- Indexes
- Go to Definition
target="*xxx"→ jump to label definitionnextOrderWithLabel("*xxx", "file.ks")→ jump to label definitionstorage="xxx.ks"→ jump to file[mymacro]/@mymacro→ jump to macro definitiontf.xxx→ jump to the assignment site[chara_show name="xxx"]→ jump to[chara_new name="xxx"]definitionface=in[chara_mod name="akane" face="smile"]→ jump to[chara_face]definitionptext=in[chara_config]/use=in[glyph]→ jump to[ptext]/[image]definition
- Find References — list all usages of labels, JS label calls, macros,
tf.xxx, characters, faces, and named elements
Macro And Label Description Comments
Comments immediately above macro and label definitions are shown in hover.
Recommended format:
; Calls the target file and injects tf.kw_list / kw_key / judge_table
; Params: storage - path to the data file
[macro name="load_keyword_data"]
; Renders keyword buttons from tf.kw_list and enters click wait
; Returns after on_complete_click finishes
*show_report_uiDescriptions can be plain comment lines without a field label. Params: lines and description lines are treated separately.
- Diagnostics (checks the entire project, including unopened files)
- Missing required parameters (error)
- Missing file references (warning):
storage,graphic,enterimg,leaveimg,clickimg - Undefined tag/macro (warning)
- Undefined label references (warning)
- Unused labels (warning)
- Undefined character references (warning):
nameinchara_show/chara_hideetc. not defined bychara_new - Unused characters (warning):
chara_newdefined but never referenced - Skips JS code inside
[iscript]...[endscript] - Resolves relative paths containing
../ - Skips variable expansion prefixes (
&,%,[)
Suppressing Warnings
You can suppress specific warnings using comment directives:
; tyranoscript-disable-next-line ← suppress next line entirely
; tyranoscript-disable-next-line tyrano-unused-label ← suppress specific code only
[jump target="*unused"] ; tyranoscript-disable-line ← suppress current line
; tyranoscript-disable ← start of suppressed range
...
; tyranoscript-enable ← end of suppressed rangeDevelopment
npm install
npm run build # bundle to dist/server.js
npm run watch # watch modeAcknowledgements
Tag dictionary data is based on tyrano.Tooltip.json from orukRed/tyranosyntax.
