Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.68 KB

ARCHITECTURE.md

File metadata and controls

40 lines (28 loc) · 1.68 KB

Architecture

The Cucumber Language Service library has two APIs:

The Extraction API provides data structures that are passed as input to the Language Service API.

Extraction API

The Extraction API is used to extract information from Gherkin Documents and Step Definitions. It generates data structures that are consumed by the Language Service API.

graph TD
    A[Glue source code\nJava/Ruby/TypeScript/JavaScript/etc.] -->|tree-sitter| B[Expressions]
    C[Gherkin source code] -->|Gherkin Parser| D[Gherkin Steps]
    B --> E[buildSuggestions]
    D --> E
    E --> F[Suggestions]
    F --> G[Index]
Loading

Cucumber Expressions and Regular Expressions are extracted from Java/Ruby/TypeScript/JavaScript/etc. source code using tree-sitter.

Gherkin steps are extracted from Gherkin source code using the Gherkin parser.

Expressions and steps are passed to buildSuggestions to produce an array of Suggestion, and these are used to update a (search) Index.

Language Service API

The Language Service API provides LSP services.

The expressions and index objects are used in the various getXxx functions that provide the "editor" API. This API is used by both Cucumber Language Server and Cucumber Monaco.