Skip to content

how IntelliSkript works

John Heikens edited this page May 15, 2025 · 23 revisions

validation

when the extension is activated, it will validate all dependent skript files, like disky.sk etc. when you open a document, it will validate that document only, and it will search in the already validated files of that workspace and the dependencies for patterns. when you changed a document, other documents won't be revalidated until they are opened.

architecture

this extension contains a language server running on another thread on the client. it's bundled using webpack.

the language server follows the LSP (language server protocol). read more about it here

publishing

to package:
vsce package --pre-release
change version: edit in main package.json. be aware that stuff in the main package.json is displayed publicly!
to publish:
vsce publish --pre-release

also upload to open-vsx.org

debugging

if you see 'could not load source map from browserClientMain.js.map', it could mean that you renamed the workspace folder to include a space. remove the spaces and try again.

debugging as package

go to extensions in vs code and click ... -> install from VSIX -> go to intelliskript folder and select correct vsix

debugging after publishing

go to extension page in vs code -> features -> runtime status. also, watch error messages pop up.

tokenization

we're using these rules for tokenization:

  • types should be blueish
  • all actions should be yellowish
  • all expressions and variables should be greenish
  • not tokenized text should be red
  • all definitions (new names, patterns or comments) should be italic. italic means you can type in roughly anything you want. exception is string, because we don't apply any markup there.
  • pattern references should be bold. those are 'actual' code, so they're important.

to debug tokenization, set the keybind for 'Developer: Inspect Editor Tokens and Scopes' and press it while looking at tokenized skript code.

tips

the server doesn't know about the file system; it only calculates what is sent as input to it. therefore, we need to send all files to the server when it starts.

Clone this wiki locally