Expand description
Static recognition of the package/class authoring commands — the metadata a
.sty/.cls declares about itself. Definitions are inspected, not executed.
Three declarations are extracted, mirroring how \definecolor/\newglossaryentry
feed the SemanticModel:
\ProvidesPackage/\ProvidesClass/\ProvidesFileand the expl3\ProvidesExplPackage/Class/File— the package/class identity (name, date, version, description) →ProvidesDecl.\NeedsTeXFormat— the required format and optional release date →NeedsFormatDecl.\DeclareOption(and the starred default handler\DeclareOption*) — a declared option name →OptionDecl.
\ProcessOptions/\ExecuteOptions carry no extractable identity, so they get no
model entry — the LSP hover renders a static note for them.
Extraction populates SemanticModel during its CST walk.
Consumers match declarations by their control-word range.
Structs§
- Needs
Format Decl - A
\NeedsTeXFormat{format}[date]declaration. - Option
Decl - A
\DeclareOption{name}{code}declaration, or the starred default handler\DeclareOption*{code}(withnameNone). - Provides
Decl - A
\ProvidesPackage/Class/File(or its expl3 variant) self-identification.
Enums§
- Provides
Form - The argument shape of a
\Provides…declaration: the LaTeX2e{name}[info]or the expl3{name}{date}{version}{description}. - Provides
Kind - Which of the three
\Provides…namespaces a declaration names.
Functions§
- needs_
format_ from_ command - Extract a
NeedsFormatDeclfrom a\NeedsTeXFormatCOMMANDnode. - option_
from_ command - Extract an
OptionDeclfrom a\DeclareOptionCOMMANDnode. The non-star form\DeclareOption{name}{code}reads the name from group 0; the starred default handler\DeclareOption*{code}(recognized by the*WORDthe parser folds into the invocation) recordsname: None. - provides_
from_ command - Extract a
ProvidesDeclfrom a\Provides…COMMANDnode, orNoneif the name group is a non-literal (nested macro) or the command is not a\Provides…. - provides_
kind - Whether
nameis a\Provides…declaration, and which namespace it names.