extensions icon indicating copy to clipboard operation
extensions copied to clipboard

GLSL language server support

Open jansol opened this issue 2 years ago • 2 comments

Check for existing issues

  • [X] Completed

Language

GLSL

Tree Sitter parser link

https://github.com/theHamsta/tree-sitter-glsl

Language server link

https://github.com/svenstaro/glsl-language-server

Misc notes

Common file suffixes are listed in the reference parser readme (there are quite a few). In addition to those, .glsl is frequently used for GLSL files that contain shared code to be included in other files.

jansol avatar Mar 15 '23 13:03 jansol

I’m sure I’m not the only one who was wondering what the state of this is, so:

  • Syntax highlighting seems to already be supported, but there’s no autocomplete of any kind.
  • The syntax works for .vert/.frag etc. files, but not for .glsl files. For those you need to manually change the language every time you open the file.
  • You can use clang-format for formatting GLSL on save by adding the below to Zed settings:
"language_overrides": {
  "GLSL": {
    "formatter": {
      "external": {
        "command": "node_modules/.bin/clang-format”, // or where ever you’ve installed it
        "arguments": []
      }
    }
  }
}

jonikorpi avatar Nov 09 '23 12:11 jonikorpi

Just to note, the GLSL code currently resides in the Zed repo, but it will be removed as a built-in language and will be published to the extension store soon. Right now, it has tree-sitter support - all that is left is for someone to add the code to bring in the language server.

JosephTLyons avatar Apr 12 '24 16:04 JosephTLyons