Skip to main content

Module lang

Module lang 

Source
Expand description

Language plugins — the only seam languages plug into.

A plugin maps source text to the common Symbol model. The core stays language-agnostic; adding a language is a new plugin, not a core change.

Modules§

go
Go plugin. Extracts func (free → function, with a receiver → method), type … struct → struct, and type … interface → trait (Go’s interface is the same “named contract” concept). Methods are qualified by their receiver type (Handle · Server); interface method signatures by the interface.
python
Python plugin. Extracts class → class and def (free → function, inside a class → method), qualified with . (method · Account, nested class Inner · Outer). Decorators are transparent — the wrapped def is what counts.
ruby
Ruby plugin — the first language.
rust
Rust plugin — the second language, and what rq dogfoods on its own source.
typescript
TypeScript / JavaScript plugin. One grammar family, two language tags: JavaScript is TypeScript with the types taken out, so both share a walk and -x ts / -x js still mean what you’d expect.

Traits§

LanguagePlugin
Extracts definitions from a single source file.

Functions§

languages
The tags of all registered languages — the set --lang matches against, so it can’t drift from the registry.
plugin_for_extension
The plugin handling files with the given extension (without the dot), if any.
registry
The registered language plugins.