Logos for Zed
Language support for Theos Logos files in Zed, backed by Tree-sitter Objective-C and C grammars.
Supported file suffixes:
.x.xm.xi.xmi
Features
- Syntax highlighting for C and Objective-C declarations, expressions, methods, messages, imports, preprocessor directives, comments, strings, and literals.
- All Logos directives as documented in the
Theos Logos syntax reference:
- top level:
%config,%hookf,%ctor,%dtor; - block level:
%group,%hook,%subclass,%property,%new,%end; - function level:
%init,%orig(and&%orig),%c,%log.
- top level:
- Structured constructs: grouped hooks, runtime subclasses, protocol lists,
function hooks, explicit
%origarguments, and%propertydeclarations whose attributes, type, and name are highlighted like a native@property. - Outline & symbol navigation (
outline.scm): jump between%group,%hook,%subclass,%hookf,%ctor,%dtor,%property, Objective-C methods/interfaces, and C functions via the outline panel andeditor: toggle outline/ symbol search. - Snippets (
snippets/logos.json): scaffolds for every directive —%hook,%group,%subclass,%hookf,%ctor,%dtor,%new,%property,%init,%c,%orig,%log,%config, plus atweakstarter block. - Editing ergonomics: bracket and quote auto-closing, bracket matching,
line comments (
//) and block comments (/* */), indentation rules, and tree-sitter folding of%hook/%group/%subclassblocks.
The parser is based on tree-sitter-objc, which itself extends
tree-sitter-c. See THIRD_PARTY_NOTICES.md for license notices.
File Types
.x: Logos followed by preprocessing, compiled as Objective-C..xm: Logos followed by preprocessing, compiled as Objective-C++..xi: preprocessing followed by Logos, compiled as Objective-C..xmi: preprocessing followed by Logos, compiled as Objective-C++.
The .xm and .xmi suffixes are detected, but the current grammar uses an
Objective-C/C base. Logos and Objective-C highlighting are covered; complete
C++ syntax highlighting is not yet claimed.
Local Testing
- Open Zed.
- Run
zed: install dev extension. - Select this directory.
- Open files under
examples/. - Confirm the language selector shows
Logosfor.x,.xm,.xi, and.xmifiles. - Check that Objective-C syntax and Logos directives are both highlighted.
If Zed cannot load the grammar, open zed: open log and search for logos.
For grammar development:
npm install
npm run generate
npm test
npm run parsePublishing
This extension lives at
nobottomline/logos-zed and is a
single-repository setup: the Zed extension and the Tree-sitter grammar share
this repository, with grammar.js and src/parser.c at the root.
It is submitted to the Zed registry via zed-industries/extensions#6428. When updating the published version:
- Bump
versioninextension.toml,tree-sitter.json, andpackage.json. - Set
[grammars.logos].revto the commit that contains the matchinggrammar.js/src/parser.c. - Update the submodule pointer and
extensions.tomlentry in thezed-industries/extensionsfork.
LICENSE must stay in the repository root; Zed requires a recognized license
for extension submissions.