Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

639 B
Raw Blame
import { registerLanguageSemantics, type LanguageSemantics } from "../languages";

const kotlinSemantics: LanguageSemantics = {
  tokenClasses({ type, modifiers, classes }) {
    if (type === "operator" && modifiers.includes("declaration")) classes.push("cm-sem-function");
    // JetBrains Kotlin LSP uses `modification` for mutable declarations and references.
    if ((type === "variable" || type === "property" || type === "parameter") && modifiers.includes("modification"))
      classes.push("cm-sem-mutable");
    if (type === "label") classes.push("cm-sem-constant");
  },
};

registerLanguageSemantics("kotlin", kotlinSemantics);