File tree Expand file tree Collapse file tree 4 files changed +380
-4
lines changed Expand file tree Collapse file tree 4 files changed +380
-4
lines changed Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " zed_crystal"
3+ version = " 0.0.1"
4+ edition = " 2021"
5+ publish = false
6+
7+ [lib ]
8+ path = " src/crystal.rs"
9+ crate-type = [" cdylib" ]
10+
11+ [dependencies ]
12+ zed_extension_api = " 0.1.0"
Original file line number Diff line number Diff line change 11authors = [
" Margret Riegert <[email protected] >" ]
2- description = " Syntax highlighting for Crystal"
2+ description = " Syntax highlighting and LSP support for Crystal"
33id = " crystal"
44name = " Crystal"
55repository = " https://github.com/crystal-lang-tools/zed-crystal"
66schema_version = 1
77version = " 0.0.1"
88
9- [grammars .crystal ]
10- commit = " 61cc201c8eb3b6fd4d4eb3e0ac6c303a580eeb6b"
11- repository = " https://github.com/crystal-lang-tools/tree-sitter"
9+ # Use Ruby grammar for now until Crystal grammar is more complete
10+ [grammars .ruby ]
11+ repository = " https://github.com/tree-sitter/tree-sitter-ruby"
12+ commit = " 7dbc1e2d0e2d752577655881f73b4573f3fe85d4"
13+
14+ [language_servers .crystalline ]
15+ name = " crystalline"
16+ language = " Crystal"
17+
18+ # [grammars.crystal]
19+ # commit = "61cc201c8eb3b6fd4d4eb3e0ac6c303a580eeb6b"
20+ # repository = "https://github.com/crystal-lang-tools/tree-sitter"
Original file line number Diff line number Diff line change 1+ use zed_extension_api:: { self as zed, Result } ;
2+
3+ struct CrystalExtension ;
4+
5+ impl zed:: Extension for CrystalExtension {
6+ fn new ( ) -> Self {
7+ Self
8+ }
9+
10+ fn language_server_command (
11+ & mut self ,
12+ _language_server_id : & zed:: LanguageServerId ,
13+ worktree : & zed:: Worktree ,
14+ ) -> Result < zed:: Command > {
15+ let path = worktree. which ( "crystalline" ) . ok_or_else ( || {
16+ "Please install crystalline manually and make sure it is on $PATH." . to_string ( )
17+ } ) ?;
18+ Ok ( zed:: Command {
19+ command : path,
20+ args : vec ! [ ] ,
21+ env : Default :: default ( ) ,
22+ } )
23+ }
24+ }
25+
26+ zed:: register_extension!( CrystalExtension ) ;
You can’t perform that action at this time.
0 commit comments