pub trait Lang: 'static {
type ElementError: Into<SimpleDiagnostic> + Send + Sync + Debug;
const CODE_ACTION: bool;
const HOVER: bool;
const LANG: &'static str;
const TRIGGERS: &'static [&'static str];
const LEGEND_TYPES: &'static [SemanticTokenType];
const PATTERN: Option<&'static str>;
// Provided methods
fn semantic_token_type(_kind: SyntaxKind) -> Option<SemanticTokenType> { ... }
fn semantic_token_spans(
kind: SyntaxKind,
span: Range<usize>,
_text: &str,
) -> Vec<(SemanticTokenType, Range<usize>)> { ... }
}Required Associated Constants§
const CODE_ACTION: bool
const HOVER: bool
const LANG: &'static str
const TRIGGERS: &'static [&'static str]
const LEGEND_TYPES: &'static [SemanticTokenType]
const PATTERN: Option<&'static str>
Required Associated Types§
type ElementError: Into<SimpleDiagnostic> + Send + Sync + Debug
Provided Methods§
Sourcefn semantic_token_type(_kind: SyntaxKind) -> Option<SemanticTokenType>
fn semantic_token_type(_kind: SyntaxKind) -> Option<SemanticTokenType>
Map a CST syntax kind to a semantic token type for highlighting.
Sourcefn semantic_token_spans(
kind: SyntaxKind,
span: Range<usize>,
_text: &str,
) -> Vec<(SemanticTokenType, Range<usize>)>
fn semantic_token_spans( kind: SyntaxKind, span: Range<usize>, _text: &str, ) -> Vec<(SemanticTokenType, Range<usize>)>
Map a CST syntax kind + byte span to semantic token spans for highlighting.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".