Skip to content

About

Syntax highlighting for syzkaller Syscall Description Language (SDL)

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

SyzLang

SyzLang

Syntax highlighting and language server for syzkaller syscall descriptions

CI Version Downloads License

Features

  • Full syzlang grammar — include, incdir, define, meta, resource, type aliases/templates, struct/union blocks, flags, syscall definitions with variants
  • Syzconst grammar — extracted constants (.const, .txt.const) and warnings (.txt.warn)
  • Language server — go-to-definition, find references, hover info, autocomplete, document symbols, and diagnostics
  • Dark and light themes — optimized color palettes for Dark+, Dark Modern, Light+, and Light Modern
  • Fully customizable — every token color is overridable via editor.tokenColorCustomizations

Supported File Types

Language ID Extensions / Patterns Description
syzlang .syz, sys/**/*.txt Syscall descriptions
syzconst .const, .txt.const, .txt.warn Extracted constants and warnings

Note: Syzkaller stores descriptions as plain .txt files under sys/<os>/. The extension auto-associates **/sys/**/*.txt with syzlang via files.associations. You can adjust or disable this in your settings.json.

Quick Start

  1. Install from the VS Code Marketplace or search "Syzlang" in the Extensions panel
  2. Open any .syz file or a syzkaller sys/ directory
  3. Syntax highlighting, hover info, and diagnostics activate automatically

Settings

Setting Default Description
syzlang.trace.server off Trace communication between VS Code and the language server
syzlang.diagnostics.enable true Enable diagnostics (duplicate definitions, undefined type references)
syzlang.diagnostics.undefinedTypes info Severity for undefined type references (error, warning, info, off)

Scope Reference

Use these scopes to customize colors in editor.tokenColorCustomizations.textMateRules:

Syzlang

Scope Highlights
keyword.control.directive.syzlang include, incdir, define, meta
keyword.control.declaration.syzlang resource, type
keyword.control.direction.syzlang in, out, inout
keyword.control.conditional.syzlang if in field attributes
support.type.builtin.syzlang Primitives: int32, string, void, ...
support.type.constructor.syzlang Constructors: ptr, flags, array, len, fmt, ...
entity.name.function.syscall.syzlang Syscall base names
entity.name.tag.variant.syzlang Variant suffix after $
punctuation.separator.variant.syzlang The $ separator
entity.name.type.struct.syzlang Struct names
entity.name.type.union.syzlang Union names
entity.name.type.resource.syzlang Resource names
entity.name.type.alias.syzlang Type alias names
entity.name.type.flags.syzlang Flag definition names
entity.name.type.return.syzlang Syscall return types
variable.parameter.syzlang Syscall parameter names
variable.other.member.syzlang Struct/union field names
variable.parameter.template.syzlang Template parameters
variable.other.type.syzlang User-defined type references
constant.other.caps.syzlang ALL_CAPS constants
storage.modifier.optional.syzlang opt keyword
storage.modifier.attribute.syzlang packed, varlen, align, size
storage.modifier.call.syzlang disabled, no_generate, breaks_returns, ...

Syzconst

Scope Highlights
variable.other.constant.syzconst Constant names
constant.numeric.syzconst Numeric values
keyword.control.arches.syzconst arches keyword
support.constant.arch.syzconst Architecture names (386, amd64, ...)
markup.deleted.syzconst Warning/diagnostic keys
keyword.other.syzconst syz, kernel in warning lines
entity.name.type.syzconst Type references in warning lines

Customization

Override any color in your settings.json:

{
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "entity.name.function.syscall.syzlang",
                "settings": { "foreground": "#FFD700", "fontStyle": "bold" }
            }
        ]
    }
}

File Association

The extension registers **/sys/**/*.txt as syzlang by default. If this conflicts with other .txt files in your workspace, narrow or override it:

{
    "files.associations": {
        "**/sys/**/*.txt": "syzlang",
        "**/my-other-dir/**/*.txt": "plaintext"
    }
}

Development

make install        # install dependencies
make build          # build extension
make lint           # type-check + eslint
make format         # format with prettier
make package        # build + package .vsix
make ci             # full CI pipeline

Related Projects

License

MIT

About

Syntax highlighting for syzkaller Syscall Description Language (SDL)

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages