Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Scalactive Single File Component (.st)New to Visual Studio Code? Get it now.
Scalactive Single File Component (.st)

Scalactive Single File Component (.st)

Ondeoma

|
1 install
| (0) | Free
Language support for Scalactive single file components (.st): syntax highlighting, completion, type errors, hover and go to definition
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Scalactive Single File Component (.st)

Language support for single file components (.st) of Scalactive, a reactive frontend framework for Scala.js.

日本語の説明は ドキュメントの「エディタ」 を参照してください.

Syntax highlighting

  • <script lang="scala"> is highlighted as Scala, <style> as CSS.
  • In <template>, the HTML is highlighted, and these parts are highlighted as Scala:
    • {{ expr }}
    • v-if / v-else-if / v-show / v-model / v-for
    • :attr="expr" / v-bind:attr="expr"
    • @event.modifier="stmt" / v-on:event="stmt"
  • Tags starting with an uppercase letter (child components) are highlighted separately.
  • In the script, a triple-quoted string after a // language=scala / html / css comment is highlighted in that language.

Scala highlighting uses the Scala Syntax (official) extension, which is installed automatically.

Language server

The Scala parts of .st files get these features from the Scalactive language server:

  • Completion, including classes that are not imported yet (an import is added to the <script>). In the HTML part of the template: component names, props, events and v-model of child components, directives, slot names, and standard HTML tags, attributes and enumerated values.
  • Type errors and other diagnostics, reported at their position in the .st file.
  • Hover with types and documentation, and signature help.
  • Go to definition: within the .st file, to .scala / .st files of the project, and into library sources. From a child component's tag or attribute, it goes to the Props of that .st file.
  • Find references and rename (F2) of child component props.
  • Inspections of child component tags (unknown props and slots, missing required props) with quick fixes.
  • Inlay hints for inferred types.
  • Document formatting (template indentation, <style> rules, and scalafmt for <script>).

Requirements

  1. An sbt project that enables ScalactivePlugin. Run sbt compile once so that target/scalactive-lsp.json (the classpath and other settings for the language server) is written. If it is missing, a notification offers to run sbt compile.
  2. Java 11 or later. The extension looks at scalactive.languageServer.javaHome, JAVA_HOME and PATH in this order.

On first use, the language server downloads the Scala 3 presentation compiler for the project's Scala version from Maven Central. Definitions in other files are read from the last sbt compilation.

Settings

Setting Default Description
scalactive.languageServer.enabled true Use the language server
scalactive.languageServer.javaHome "" JDK to run the language server
scalactive.languageServer.jvmOptions ["-Xss4m", "-Xmx2G"] JVM options for the language server
scalactive.trace.server off Trace the communication with the language server

Commands

  • Scalactive: New Scalactive Component (also in the Explorer's context menu) creates a .st file from a template.
  • Scalactive: Open Generated Scala Source opens the Scala code generated from the current .st file.
  • Scalactive: Restart Language Server

Links

  • Scalactive documentation
  • Source code and issues
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft