Skip to content

Conversation

@KonerDev
Copy link
Member

@KonerDev KonerDev commented Nov 2, 2025

This PR adds syntax highlighting for Swift, Ruby, Less, SCSS, Properties, Ignore and log files and improves the handling of all the file extensions.

Features

  • Add syntax highlighting of many languages
    • Better separation between CSS, SCSS and Less
    • Better separation between INI and Properties
  • More intelligent icon detection (use gradle icon for gradlew.bat, use info icon for README.md, ...)

Refactor

  • Implement the FileType enum, which stores all data about file extensions, their corresponding TextMate scopes, their icons, and their name
  • Remove old ScopeRegistry and FileIcon code and migrate the data to the new FileType enum

Why this refactor was needed

Because file extensions were declared multiple times in different places, and some extensions were missing in certain parts of the code, it was confusing and hard to maintain. We needed a universal solution for file info to simplify adding new file types.

@KonerDev
Copy link
Member Author

KonerDev commented Nov 2, 2025

@RohitKushvaha01 By the way, where did you get all the TextMate language configurations from? I just copied them from the VSCode repository; is that correct?

@RohitKushvaha01
Copy link
Member

@RohitKushvaha01 By the way, where did you get all the TextMate language configurations from?

Make sure to test them to see if they are working properly, because some configurations don't work in the Sora editor.

I just copied them from the VSCode repository; is that correct?

Most of them are taken from Sora Editor's demo, and some of them are from VSCode and other sources.

@KonerDev
Copy link
Member Author

KonerDev commented Nov 2, 2025

@RohitKushvaha01 By the way, where did you get all the TextMate language configurations from?

Make sure to test them to see if they are working properly, because some configurations don't work in the Sora editor.

I just copied them from the VSCode repository; is that correct?

Most of them are taken from Sora Editor's demo, and some of them are from VSCode and other sources.

Yes, they are working correctly.
However, in the logcat console there are a few of these warnings:

org.eclips...uleFactory com.rk.xededitor.debug               W  CANNOT find grammar for scopeName [{0}]. I am [{1}]
org.eclips...uleFactory com.rk.xededitor.debug               W  REMOVING BeginEndRule{id=7,name=comment.block.documentation.scss} ENTIRELY DUE TO EMPTY PATTERNS THAT ARE MISSING
org.eclips...uleFactory com.rk.xededitor.debug               W  REMOVING BeginEndRule{id=7,name=comment.block.documentation.scss} ENTIRELY DUE TO EMPTY PATTERNS THAT ARE MISSING
org.eclips...uleFactory com.rk.xededitor.debug               W  REMOVING BeginEndRule{id=7,name=comment.block.documentation.scss} ENTIRELY DUE TO EMPTY PATTERNS THAT ARE MISSING

@KonerDev
Copy link
Member Author

KonerDev commented Nov 2, 2025

@RohitKushvaha01
And where did you get the icons of the languages from?

Colored icons like in acode would also be cool.

@RohitKushvaha01
Copy link
Member

RohitKushvaha01 commented Nov 2, 2025

@RohitKushvaha01
And where did you get the icons of the languages from?

Colored icons like in acode would also be cool.

https://simpleicons.org/

The icons are in svg format but can be converted to android vector drawable via Android studio

…ini and properties files and improve git file icons and syntax highlighting
@KonerDev
Copy link
Member Author

KonerDev commented Nov 2, 2025

I'm finished with this PR. You can merge it now.

@RohitKushvaha01 RohitKushvaha01 merged commit 9a0bcbf into Xed-Editor:main Nov 3, 2025
@KonerDev KonerDev deleted the feat/better-file-types branch November 7, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants