-
Notifications
You must be signed in to change notification settings - Fork 201
[Featute] Add language packs with 40+ languages and theme #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dingyi222666
wants to merge
5
commits into
Rosemoe:main
Choose a base branch
from
dingyi222666:feat/textmate-language-pack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Featute] Add language packs with 40+ languages and theme #755
dingyi222666
wants to merge
5
commits into
Rosemoe:main
from
dingyi222666:feat/textmate-language-pack
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… language grammars Implement automated TextMate language pack generation system that creates individual Gradle modules for each language and theme from grammar definitions. - Add LanguageTextmatePacksGenerator with template-based code generation * Extract templates to resources for better maintainability * Generate language modules (e.g., language-lua, language-java) * Generate theme modules (e.g., theme-ayu-dark, theme-darcula) * Optimize performance with inline functions and lazy loading * Use unified package name io.github.rosemoe.sora.langs.textmate - Add 40+ language grammars with TextMate bundles * Assembly, Bash, Bat, C/C++, C#, Coq, CSS/SCSS/Less * Dart, Go, Groovy, HTML, HTMX, Ini, Java, JavaScript/JSX * JSON, Kotlin, LaTeX, Lisp, Log, Lua, Markdown, Nim * Pascal, PHP, PowerShell, Properties, Python, Ruby, Rust * Smali, SQL, Swift, Text, TOML, TypeScript/TSX, XML, YAML, Zig - Add 4 color themes * ayu-dark, ayu-light, darcula, quietlight - Integrate with build system * Auto-generate language packs during Gradle sync * Dynamic module inclusion via settings.gradle.kts - Update app dependencies to use generated language packs * Use LuaLanguage and AyuDarkColorScheme in LSP test activities * Simplify theme switching logic
…and themes Implement a comprehensive language pack generator and registry system: Language Pack System: - Add pack generator that processes grammars.json to create standalone modules - Generate 40+ language packs (Java, Kotlin, Python, Rust, Go, etc.) - Generate 4 theme packs (Ayu Dark/Light, Darcula, Quiet Light) - Auto-register generated modules in settings.gradle.kts - Remove singleton pattern from generated pack classes for simpler API TextMate Enhancements: - Add bracket match color support (background, border) - Auto-detect dark theme from theme JSON "type" field - Improve theme lookup to support both theme name and model name - Fix theme loaded state check for better reliability Documentation: - Add comprehensive README for language-textmate-packs module - Include setup instructions with Maven Central dependencies - Document theme and language pack usage patterns - Provide complete language support table with module names The pack system allows applications to easily include specific languages and themes without bundling all grammars, reducing APK size and improving modularity.
Update module naming from language-<name>/theme-<name> to language-textmate-<name>/theme-textmate-<name> format for better consistency and simpler configuration. This change affects the language pack generator, build configuration, and documentation. The new naming convention allows settings.gradle.kts to directly use directory names as module names without string manipulation, improving maintainability. Additionally, fix code formatting issues in language and theme class templates by standardizing indentation and removing unnecessary synchronized blocks.
… plugin Move TextMate language pack module generation from root project plugin to a dedicated settings plugin. This ensures modules are generated during the settings evaluation phase, allowing proper type-safe accessors in build scripts. Changes include creating TextmateSettingsPlugin to handle module generation at settings time, updating app build.gradle.kts to use type-safe project accessors, removing eager generator from root project plugin to avoid duplicate generation, and removing CI build checks to ensure consistent module generation.
cb3cfc5 to
ff95f15
Compare
…ule names in README Updated README to reflect changes in project registration and theme module names.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a comprehensive language packs for the TextMate language module, providing built-in support for over 40 popular programming languages and themes.
The language pack generator creates optimized language bundles from TextMate grammars, making it easier to integrate syntax highlighting for various languages without manual configuration.
Users can now easily enable syntax highlighting for languages including JavaScript, TypeScript, Python, Java, Kotlin, C/C++, Go, Rust, and many others through a simple and consistent API.
Close #549