From d19048f2a3b1b53e41f24233fa1a926c5a6c02d0 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Tue, 18 Apr 2023 20:56:38 -0700 Subject: [PATCH] helix: Added souffle support --- roles/home/helix.nix | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/roles/home/helix.nix b/roles/home/helix.nix index 506a519..b305f77 100644 --- a/roles/home/helix.nix +++ b/roles/home/helix.nix @@ -35,6 +35,76 @@ [[language]] name = "python" formatter = { command = "black", args = [ "-" ] } + + [[language]] + name = "souffle" + scope = "source.souffle" + roots = [] + file-types = [ "dl" ] + comment-token = "//" + indent = { tab-width = 2, unit = " " } + + [[grammar]] + name = "souffle" + source = { git = "https://github.com/langston-barrett/tree-sitter-souffle", rev = "8cc32019f6aa8d7ef98ff5abc643c8f35dfc1099" } + ''; + + file.".config/helix/runtime/queries/souffle/highlights.scm".text = '' + [ + (pragma) @keyword + (functor_decl) @keyword + (component_decl) @keyword + (component_init) @keyword + (directive) @keyword + (monotonic_rule) @keyword + (subsumptive_rule) @keyword + (fact) @keyword + (relation_decl) @keyword + (type_decl) @keyword + (legacy_type_decl) @keyword + ] @keyword + + [ + (primitive_type) @type + (type_synonym) @type + (subtype) @type + (type_union) @type + (type_record) @type + (adt) @type + (legacy_bare_type_decl) @type + ] @type + + [ + (block_comment) @comment + (line_comment) @comment + ] @comment + + [ + (string) @string + ] @string + + [ + (number) @constant.numeric + (integer) @constant.numeric + (decimal) @constant.numeric + (unsigned) @constant.numeric + (hex) @constant.numeric + (binary) @constant.numeric + (float) @constant.numeric + (ipv4) @constant.numeric + ] @constant.numeric + + [ + (ident) @variable + ] @variable + + [ + (qualified_name) @entity + ] @entity + + [ + (intrinsic_functor) @operator + ] @operator ''; packages = with pkgs.unstablePkgs; [