Behaviour for LiveCode language modules.
A language module describes meaning. The editor shell owns browser mechanics; language modules own tokens, completions, snippets, diagnostics, and optional formatting.
Summary
Functions
Safely ask a language module for completions.
Safely ask a language module for diagnostics.
Safely format text with a language module.
Safely ask a language module for snippets.
Safely tokenize text with a language module.
Callbacks
@callback completions(context :: LiveCode.Context.t(), opts :: keyword()) :: [ LiveCode.Completion.t() ]
@callback diagnostics(text :: String.t(), opts :: keyword()) :: [LiveCode.Diagnostic.t()]
@callback snippets(opts :: keyword()) :: [LiveCode.Snippet.t()]
@callback tokenize(text :: String.t(), opts :: keyword()) :: [LiveCode.Token.t()]
Functions
@spec completions(module(), LiveCode.Context.t(), keyword()) :: [ LiveCode.Completion.t() ]
Safely ask a language module for completions.
@spec diagnostics(module(), String.t(), keyword()) :: [LiveCode.Diagnostic.t()]
Safely ask a language module for diagnostics.
Safely format text with a language module.
@spec snippets( module(), keyword() ) :: [LiveCode.Snippet.t()]
Safely ask a language module for snippets.
@spec tokenize(module(), String.t(), keyword()) :: [LiveCode.Token.t()]
Safely tokenize text with a language module.