LiminaliaLiminalia

VS Code extension

An extension for writing .lim scenarios in VS Code. You get the same syntax check and completion as in Studio, in the editor you already use. It also works in editors that load VS Code extensions, such as Cursor.

It's being prepared for release. The release will be announced on X by @skyt_a.

What it does

FeatureDetails
HighlightingColors labels, commands and parameters, comments, dialogue speakers, in-text notation such as ruby (small reading aids above Japanese characters), and choice lines
Syntax checkRuns the same checks as lim check as you type. Open files are checked with their unsaved contents. Problems in cast.json, liminalia.json and translation files appear in those files too
CompletionSuggests command names after @; parameter names and values that fit their type (characters, sprite sets, variants, positions, asset files and so on); jump targets; speaker names at the start of a line; and in-text notation after {
HoversHover over a command name to see its summary, an example and a table of its parameters
Go to definitionGoes from a jump target, a @use file or a macro call to its definition (F12)
OutlineLists labels and macros
FoldingFolds from @if, @choice and @define to @end
Formatting“Format Document” (⇧⌥F) tidies command lines the same way as lim fmt. The text is left as it is
Quick FixPress ⌘. to fix problems that come with a suggested fix, such as a misspelled name. The fixes are the same as in Studio
Scene renamingPress F2 on a label or a jump target to rename the scene. References in other files and the start position in liminalia.json are updated along with it
Play from HereOpens the game in your browser, starting from the state just before the cursor line runs, like Play from Here in Studio (⌘⌥P, or Ctrl+Alt+P on Windows and Linux)

The extension's commands, Quick Fix and notices, and the command descriptions in completion and hovers, follow VS Code's display language: Japanese or English. The syntax check's error and warning messages are in Japanese for now.

An example as you type

Type @chara, and the project's characters are suggested for the parameter. Pick a character, and that character's variants are suggested next.

# morning
@bg hill_morning.webp time=1s
@chara Akari smlie at=left
Akari "Good morning. You're up early today."
@choice
  - Go out together -> #walk
  - Stay in bed -> #morning
@end

In this example, the variant name is misspelled as smlie instead of smile. That line gets a squiggly underline, with an error saying that Akari's default sprite set has no variant smlie, and a suggested fix: did you mean smile? The extension also points out that there's no label #walk in this file for the jump target.

Installing

Once it's released, the plan is to let you install it by searching for “Liminalia” in the Extensions view. You can also install it from the distributed .vsix file.

  1. In the VS Code Command Palette, choose “Extensions: Install from VSIX...” and pick the .vsix file.
  2. Open the project folder that contains liminalia.json, then open a .lim file.

To update to a new version, follow the same steps to install over the old one.

Things to keep in mind

  • Commands added by the project's plugins are covered by the syntax check and completion too. In untrusted folders and in projects outside the workspace folders, plugin code doesn't run, and only the built-in and standard commands are checked.
  • Play from Here uses the Studio that has the project open (the Studio app or lim studio). If none is open, click “Start lim studio” to start it in a terminal and wait for it. For lines it can't start from, such as lines inside a macro, it starts at the top of the scene with variables at their initial values and skips ahead to the cursor line.
  • Settings, cast.json and plugins are reloaded automatically when you change them. If they don't reload properly, use “Liminalia: Restart Language Server” in the Command Palette. The reason appears under “Liminalia” in the Output panel.
  • Scene renaming also updates translation keys, locked voice numbers and review comments, the same way renaming a scene in Studio does.

How the extension works and how to build it are covered in VS Code extension in the technical docs.