Add syntax highlighting for GDScript (.gd) and GDShader (.gdshader) #2925
Camisole opened 2 months ago

Hi!

When browsing or reviewing Godot project files (.gd and .gdshader) in OneDev, they currently render as plain text without syntax highlighting. It would be an awesome quality-of-life improvement if we could get support for Godot files!

If it helps, GDQuest maintains a Lezer parser specifically for CodeMirror here: https://github.com/GDQuest/gdscript-lezer-grammar

Alternatively, even just mapping .gd files to the standard Python syntax highlighter as a fallback would work pretty well as a quick fix, since the two languages share a very similar structure, and .gdshader to C, C++, or GLSL highlighters works great as a fallback given its C-like shader syntax.

Thanks for all your hard work on OneDev!

  • Robin Shen changed fields 1 month ago
    Name Previous Value Current Value
    Assignee
    robin
    cwh
  • Unknown referenced from pull request 1 month ago
  • Unknown commented 1 month ago

    Implemented syntax highlighting for Godot source files: .gd now uses Python mode and .gdshader uses CodeMirror's GLSL shader mode. Verified with mvn -Pce -pl server-core -am -DskipTests compile (BUILD SUCCESS).

    Submitted as pr #99.

  • OneDev commented 1 month ago

    State changed as build OD-7986 (16.4.0) is successful

  • OneDev changed state to 'Closed' 1 month ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Improvement
Priority
Normal
Assignee
cwh
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2925
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover