liveBook · Manning

Language service

As explained in Building User-Friendly DSLs

A software component that derives a particular kind of semantic or editing information from language content, typically represented by an abstract syntax tree.

A language service is a small service that derives a specific kind of semantic or editing information from a parser-produced abstract syntax tree for a particular purpose. section 15.1

Typical language services compute:

  • Possible completions at a text location for content assist. section 15.1
  • Constraints violated by the current text. section 15.1
  • Syntax highlighting, regional type information, and tooltip contents. section 15.1

Editing a textual DSL

An IDE text editor invokes language services when a domain expert requests completions or other editing help. Services may call one another, such as a tooltip service requesting type information from another service. section 15.1

Figure 15.1 The basic architecture of a parsing-based DSL approach
figure

Trace how parsed DSL content becomes an AST and feeds language services alongside compiler or code-generator tooling. section 15.1

How Building User-Friendly DSLs covers it

How deep it goes
Defines service responsibilities and invocation flow but stops short of implementation algorithms or internal service designs.
Examples
Uses textual DSL editing, completion requests, constraint violations, syntax highlighting, type information, and tooltips as examples.
What it assumes
Assumes familiarity with parsing and abstract syntax trees while treating service purposes and IDE interaction explicitly.
What you can do after
Apply it via an IDE to derive targeted editing or semantic information from parsed language content.
How it connects
Connects abstract syntax trees, parsers, IDEs, compilers, code generators, content assist, and type information.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.