github streetsidesoftware/cspell v10.3.2

4 hours ago

Fixes

fix: Add Experimental Validation setting. (#9250)

fix: Add Experimental Validation setting. (#9250)

This pull request introduces new experimental support for fine-grained validation control and refactors plugin support in the CSpell types package. The main changes add the ability to specify which segments of parsed text should be spell-checked using tag-based validation, and reorganize plugin configuration for future extensibility. The changes also update type definitions and exports to support these new features.

Validation Tag Support:

  • Introduced the CSpellSettingsValidation interface, allowing configuration of which tagged segments of text are spell-checked via the new validate property. This uses the new ValidationTags and TagPattern types to enable hierarchical and wildcard matching of tags. [1] [2]
  • Updated exports to include TagPattern and ValidationTags for external usage.

Plugin Configuration Refactor:

  • Added the CSpellSettingsPlugins interface to encapsulate plugin-related settings, including an experimental plugins array. [1] [2]
  • Refactored ExperimentalFileSettings to extend both CSpellSettingsPlugins and CSpellSettingsValidation, consolidating experimental settings. [1] [2]

API and Type Definition Updates:

  • Changed the defineConfig function and its type definition to accept AdvancedCSpellSettings instead of CSpellSettings, reflecting the expanded configuration options. [1] [2]
  • Updated imports and type usage throughout the codebase to align with the new structure for plugins and validation settings.

These changes lay the groundwork for more flexible and precise spell-checking configuration and future plugin extensibility.


fix: Plugin (#9244)

fix: Plugin (#9244)

This pull request introduces support for a new DocumentParser interface alongside the existing Parser interface, modernizing the way documents are parsed throughout the codebase. It updates type definitions, internal APIs, and logic to handle both parser types, and refactors related code for improved clarity and flexibility.

Key changes include:

API and Type Definition Updates:

  • Added DocumentParser, TextDocument, and related types to @cspell/cspell-types, and updated the ParseResult interface to remove content and filename fields, making it compatible with both parser interfaces.
  • Deprecated the old Plugin interface in favor of the new CSpellPlugin interface, which now supports both Parser and DocumentParser instances.

Core Library Refactoring:

  • Updated parser handling in CSpellSettingsServer.ts to support both Parser and DocumentParser, including changes to caches, type signatures, and plugin mapping functions.
  • Refactored DocumentValidator in docValidator.ts to use a new parseDocumentWithParser helper, which abstracts over the two parser interfaces.

Parser Implementation and Test Updates:

  • Modified the TypeScript parser and its tests to align with the new ParseResult structure, removing direct dependencies on content and filename in the result.

These changes make the system more flexible and future-proof by supporting richer document parsing scenarios and decoupling the parsing logic from file-based assumptions.


fix: remove unused dependency `fast-json-stable-stringify` (#9243)

fix: remove unused dependency fast-json-stable-stringify (#9243)


fix: Adjust check text to show only the text that was actually checked. (#9241)

fix: Adjust check text to show only the text that was actually checked. (#9241)


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.