github streetsidesoftware/cspell v10.3.2-alpha.0

pre-release4 hours ago

Fixes

fix: Add tags to ParsedText (#9237)

fix: Add tags to ParsedText (#9237)

This pull request introduces the concept of "tags" for parsed text segments in the CSpell types, allowing each segment of text to be annotated with a set of named tags. These tags can hold boolean, string, or undefined values, supporting richer metadata for parsers and downstream consumers. The changes affect both the TypeScript source and the type definitions.

The most important changes are:

Tagging Support for Parsed Text

  • Added a new optional tags property to the ParsedText interface, allowing each parsed text segment to carry a set of tags as metadata. (ParsedText in parser.ts, index.d.mts, index.d.mts) [1] [2] [3]
  • Introduced the ParsedTag type (boolean | string | undefined) and the ParsedTags interface (a map of tag names to ParsedTag values) to define the structure of tags. (parser.ts, index.d.mts, index.d.mts) [1] [2] [3]

Type Exports and API Surface

  • Updated exports throughout the codebase to include ParsedTag and ParsedTags, making these types available to consumers. (src/Parser/index.ts, src/index.ts, index.d.mts, index.d.mts) [1] [2] [3] [4]
  • Changed the export style in src/Parser/index.mts from export * to export type *, ensuring only types are exported.

These changes lay the groundwork for parsers and other tools to annotate text with structured metadata, improving extensibility and downstream processing.


Don't miss a new cspell release

NewReleases is sending notifications on new releases.