Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logos Language Support for VS Code

Logos Syntax Highlighting Demo

简体中文 | English


📖 简介

一个功能完整的 VS Code 扩展,为 Logos 语言提供全面的开发支持。Logos 是用于 iOS 越狱插件(Tweak)开发的预处理器语言,基于 Theos 开发框架。

什么是 Logos?

Logos 是一种建立在 Objective-C 之上的预处理器语言,它简化了 iOS 越狱插件的开发过程。通过 Logos,开发者可以轻松地:

  • Hook(钩住) 系统类和方法,修改其行为
  • 添加新方法 到现有类
  • 创建新的子类
  • Hook C 函数

Logos 代码会被 Theos 预处理器转换为标准的 Objective-C 代码,然后编译成动态库注入到目标进程中。

✨ 功能特性

🎨 语法高亮

为所有 Logos 指令提供精确的语法高亮:

  • %hook / %end - 类钩子
  • %group / %init - 分组和初始化
  • %ctor / %dtor - 构造/析构函数
  • %new / %property - 新方法和属性
  • %subclass - 子类创建
  • %hookf - C 函数钩子
  • %orig / %log / %c - 其他指令

📝 代码片段(45+ 个)

快速插入常用代码模板,提高开发效率:

前缀 描述
hook 创建 %hook/%end
hooks 创建简单的 %hook 块(无方法模板)
hookm 创建包含多个方法的 %hook
group 创建 %group/%init/%end
groupios 创建 iOS 版本条件分组
ctor / ctori / ctorf 创建 %ctor 构造函数
dtor 创建 %dtor 析构函数
new / newr / newc 使用 %new 添加新方法
subclass / subview 创建 %subclass 子类
hookf / hookfv 使用 %hookf 钩住 C 函数
property / props / propw / propa 添加属性
orig / origr 调用原始方法
tweak / tweakp 完整的 Tweak 模板
dispatch / dispatchm / dispatchb GCD 异步执行
nslog / nslogf NSLog 日志
alert UIAlertController 弹窗
weakself / strongself 弱/强引用 self

💡 智能补全

输入 % 时自动显示所有可用的 Logos 指令,包含指令名称、描述和使用示例。

📚 悬停文档(中文)

将鼠标悬停在任何 Logos 指令上,即可查看指令说明、语法格式、使用示例和详细文档。

⚠️ 实时诊断

自动检测常见错误:

  • 未闭合的块 - %hook%group%subclass 缺少对应的 %end
  • 未初始化的组 - %group 定义后未调用 %init
  • 无效的 %orig - 在 %hook 块外使用 %orig

🔧 代码格式化

Shift+Option+F(Mac)或 Shift+Alt+F(Windows/Linux)格式化 Logos 指令缩进。

📁 支持的文件类型

扩展名 描述
.x Logos 文件(C 语法)
.xm Logos 文件(Objective-C/C++ 语法)
.xi 可包含的 Logos 文件(C 语法)
.xmi 可包含的 Logos 文件(Objective-C/C++ 语法)

📦 安装方法

方法一:从 VSIX 安装(推荐)

  1. 下载 Releases 页面的 .vsix 文件
  2. 打开 VS Code,按 Cmd+Shift+P(Mac)或 Ctrl+Shift+P(Windows/Linux)
  3. 输入 Install from VSIX,选择下载的文件

方法二:从源码安装

git clone https://github.com/user/repo.git
cd repo
npm install
npm run compile

复制到 VS Code 扩展目录:

  • macOS/Linux: ~/.vscode/extensions/logos-language
  • Windows: %USERPROFILE%\.vscode\extensions\logos-language

🔨 从源码构建

# 安装依赖
npm install

# 编译
npm run compile

# 打包为 VSIX
npx @vscode/vsce package

🚀 使用示例

%hook SpringBoard

- (void)applicationDidFinishLaunching:(id)app {
    %orig;
    NSLog(@"SpringBoard 已启动!");
}

%end

%ctor {
    %init;
}

🔗 相关资源


📖 Introduction

A full-featured VS Code extension providing comprehensive development support for the Logos language. Logos is a preprocessor language used for iOS jailbreak tweak development, based on the Theos framework.

What is Logos?

Logos is a preprocessor language built on top of Objective-C that simplifies iOS jailbreak tweak development. With Logos, developers can easily:

  • Hook system classes and methods to modify their behavior
  • Add new methods to existing classes
  • Create new subclasses
  • Hook C functions

Logos code is transformed by the Theos preprocessor into standard Objective-C code, then compiled into dynamic libraries that are injected into target processes.

✨ Features

🎨 Syntax Highlighting

Precise syntax highlighting for all Logos directives:

  • %hook / %end - Class hooks
  • %group / %init - Grouping and initialization
  • %ctor / %dtor - Constructor/destructor
  • %new / %property - New methods and properties
  • %subclass - Subclass creation
  • %hookf - C function hooks
  • %orig / %log / %c - Other directives

📝 Code Snippets (45+)

Quickly insert common code templates:

Prefix Description
hook Create %hook/%end block
hooks Create simple %hook block (no method template)
hookm Create %hook block with multiple methods
group Create %group/%init/%end block
groupios Create iOS version conditional group
ctor / ctori / ctorf Create %ctor constructor
dtor Create %dtor destructor
new / newr / newc Add new method with %new
subclass / subview Create %subclass
hookf / hookfv Hook C function with %hookf
property / props / propw / propa Add properties
orig / origr Call original method
tweak / tweakp Complete tweak templates
dispatch / dispatchm / dispatchb GCD async execution
nslog / nslogf NSLog statements
alert UIAlertController
weakself / strongself Weak/strong self references

💡 IntelliSense

Auto-completion for all Logos directives when typing %, with names, descriptions, and usage examples.

📚 Hover Documentation

Hover over any Logos directive to see documentation, syntax, examples, and detailed explanations.

⚠️ Real-time Diagnostics

Automatic error detection:

  • Unclosed blocks - %hook, %group, %subclass missing %end
  • Uninitialized groups - %group defined without %init
  • Invalid %orig - %orig used outside %hook block

🔧 Code Formatting

Press Shift+Option+F (Mac) or Shift+Alt+F (Windows/Linux) to format Logos directive indentation.

📁 Supported File Types

Extension Description
.x Logos file (C syntax)
.xm Logos file (Objective-C/C++ syntax)
.xi Includable Logos file (C syntax)
.xmi Includable Logos file (Objective-C/C++ syntax)

📦 Installation

Option 1: Install from VSIX (Recommended)

  1. Download the .vsix file from Releases
  2. Open VS Code, press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Type Install from VSIX and select the downloaded file

Option 2: Install from Source

git clone https://github.com/user/repo.git
cd repo
npm install
npm run compile

Copy to VS Code extensions directory:

  • macOS/Linux: ~/.vscode/extensions/logos-language
  • Windows: %USERPROFILE%\.vscode\extensions\logos-language

🔨 Build from Source

# Install dependencies
npm install

# Compile
npm run compile

# Package as VSIX
npx @vscode/vsce package

🚀 Usage Example

%hook SpringBoard

- (void)applicationDidFinishLaunching:(id)app {
    %orig;
    NSLog(@"SpringBoard launched!");
}

%end

%ctor {
    %init;
}

🔗 Resources


📄 License

MIT License

🤝 Contributing

Issues and Pull Requests are welcome!


Happy Tweaking! 🎉

About

一个功能完整的 VS Code 扩展,为 **Logos** 语言提供全面的开发支持。Logos 是用于 iOS 越狱插件(Tweak)开发的预处理器语言,基于 [Theos](https://theos.dev/) 开发框架。

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages