Skip to content

enum

HighlightKind

pub enum HighlightKind {
    Keyword,
    Element,
    Component,
    Attribute,
    Event,
    String,
    Interpolation,
    Number,
    Constant,
    Reference,
    Variable,
    Function,
    Operator,
    Punctuation,
    Comment,
}

What a highlighted range is.

Variants

Keyword

Keyword

A keyword: if, for, state…

Element

Element

A built-in element's name.

Component

Component

A component's name (capitalised).

Attribute

Attribute

An attribute's name.

Event

Event

An event binding: @click.

String

String

A string.

Interpolation

Interpolation

A {…} interpolation inside a string.

Number

Number

A number.

Constant

Constant

true, false or null.

Reference

Reference

A name read from the scope.

Variable

Variable

A name being declared: by state, let, load or for.

Function

Function

A function a template calls: len(xs), xs |> len.

Operator

Operator

An operator.

Punctuation

Punctuation

Punctuation: brackets, braces, commas and colons.

Comment

Comment

A comment.

Methods

ALL

pub const ALL: [HighlightKind; 15];

Every kind, in the order the language server's legend lists them.

name

pub fn name(self) -> &'static str

A stable lower-case name (used for CSS classes and token legends).

Trait implementations