Skip to content

TyranoScript Language Server (LSP) for editors supporting the Language Server Protocol

License

Notifications You must be signed in to change notification settings

void2610/tyranoscript-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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
    • Asset file completion for storage=""
    • Label completion (*xxx) for target=""
    • User-defined macro completion and hover documentation
  • Go to Definition
    • target="*xxx" → jump to label definition
    • storage="xxx.ks" → jump to file
    • [mymacro] / @mymacro → jump to macro definition
    • [chara_show name="xxx"] → jump to [chara_new name="xxx"] definition
    • face= in [chara_mod name="akane" face="smile"] → jump to [chara_face] definition
    • ptext= in [chara_config] / use= in [glyph] → jump to [ptext] / [image] definition
  • Find References — list all usages of labels, macros, characters, faces, and named elements
  • 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): name in chara_show/chara_hide etc. not defined by chara_new
    • Unused characters (warning): chara_new defined 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 range

Development

npm install
npm run build    # bundle to dist/server.js
npm run watch    # watch mode

Acknowledgements

Tag dictionary data is based on tyrano.Tooltip.json from orukRed/tyranosyntax.

License

MIT

About

TyranoScript Language Server (LSP) for editors supporting the Language Server Protocol

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors