From 96edb1d0f73b244bd73b533e524fc29582dd29ff Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 12 Jun 2022 21:04:16 +0200 Subject: [PATCH 1/2] Add '@indent_end' markers Ensures for example that the following scenario ```tiger let in ( ) /* <- Inputting a new-line will indent the cursor */ end ``` Does not happen. --- queries/indents.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/queries/indents.scm b/queries/indents.scm index 2fa5a28..911681c 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -12,20 +12,26 @@ ; Class {{{ (class_declaration) @indent +(class_declaration "}" @indent_end) + (class_type) @indent +(class_type "}" @indent_end) ; }}} ; Groups {{{ (let_expression) @indent "in" @branch "end" @branch +(let_expression "end" @indent_end) (sequence_expression) @indent ")" @branch +(sequence_expression ")" @indent_end) ; }}} ; Functions and methods {{{ (parameters) @indent +(parameters ")" @indent_end) (function_call) @indent (method_call) @indent @@ -39,12 +45,14 @@ ; Values and expressions {{{ (array_value) @indent "]" @branch +(array_value "]" @indent_end) (array_expression) @indent "of" @branch (record_expression) @indent "}" @branch +(record_expression "}" @indent_end) (variable_declaration) @indent ; }}} From c90d9d82128edeb4efc419894ab47c4e610a85ab Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 12 Jun 2022 21:06:11 +0200 Subject: [PATCH 2/2] Release 0.1.2 Fix indentation *after* and indented block. --- Cargo.toml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 79ec0d4..e7f0a8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tree-sitter-tiger" description = "Tiger grammar for the tree-sitter parsing library" -version = "0.1.1" +version = "0.1.2" keywords = ["incremental", "parsing", "tiger"] categories = ["parsing", "text-editors"] repository = "https://gitea.belanyi.fr/ambroisie/tree-sitter-tiger" diff --git a/package.json b/package.json index 0cfb51b..2f53243 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tree-sitter-tiger", - "version": "0.1.1", + "version": "0.1.2", "description": "tiger grammar for tree-sitter", "main": "bindings/node", "keywords": [