From 31d41080edd216649d1db9ec7303561c58716d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sat, 15 May 2021 01:34:34 +0900 Subject: [PATCH] Add indentation queries for golang. --- README.md | 2 +- runtime/queries/go/indents.toml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/go/indents.toml diff --git a/README.md b/README.md index 24bd88db0..d63b93bcc 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ It's a terminal-based editor first, but I'd like to explore a custom renderer # Installation -Note: Only the Rust syntax has indentation definitions at the moment. +Note: Only Rust and Golang have indentation definitions at the moment. We provide packaging for various distributions, but here's a quick method to build from source. diff --git a/runtime/queries/go/indents.toml b/runtime/queries/go/indents.toml new file mode 100644 index 000000000..d75ef7ecc --- /dev/null +++ b/runtime/queries/go/indents.toml @@ -0,0 +1,21 @@ +indent = [ + "import_declaration", + "const_declaration", + "var_declaration", + "function_declaration", + "method_declaration", + "composite_literal", + "func_literal", + "literal_value", + "expression_case", + "default_case", + "argument_list", + "block" +] + +outdent = [ + "case", + "}", + "]", + ")" +]