Ver Fonte

nixpkgs/neovim: try fixing typescript indentation

Thomas Dy há 4 semanas atrás
pai
commit
7fa977ff37

+ 8 - 3
.config/nixpkgs/neovim/plugins/default.nix

@@ -8,9 +8,14 @@ let
     };
 
     "nvim-treesitter/nvim-treesitter" = {
-      # these extra rules causes nvim to crash when looking at a deeply nested
-      # JSX expression
-      patches = [ ./treesitter-jsx.patch ];
+      patches = [
+        # these extra rules causes nvim to crash when looking at a deeply nested
+        # JSX expression
+        ./treesitter-jsx.patch
+
+        # try to fix indentation in JS
+        ./treesitter-ecma.patch
+      ];
     };
 
     "mistweaverco/kulala.nvim" = {

+ 13 - 0
.config/nixpkgs/neovim/plugins/treesitter-ecma.patch

@@ -0,0 +1,13 @@
+diff --git a/queries/ecma/indents.scm b/queries/ecma/indents.scm
+index d5674167..dcfd2ad6 100644
+--- a/queries/ecma/indents.scm
++++ b/queries/ecma/indents.scm
+@@ -37,7 +37,7 @@
+ 
+ (variable_declarator
+   value: (_) @_value
+-  (#not-kind-eq? @_value "arrow_function" "call_expression" "function")) @indent.begin
++  (#not-kind-eq? @_value "arrow_function" "function")) @indent.begin
+ 
+ (arguments
+   ")" @indent.end)