branch: externals/matlab-mode
commit eeba508a33f52937d93f1ad1fcf4b787898d7e6c
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
matlab-ts-mode: don't align multi-line arguments
---
matlab-ts-mode--ei.el | 9 +-
.../electric_indent_arguments2.m | 23 +++
.../electric_indent_arguments2_expected.m | 23 +++
.../electric_indent_arguments2_expected_msgs.m | 23 +++
.../indent_xr_fun1.m | 21 ++-
.../indent_xr_fun1_expected.org | 201 +++++++++++----------
.../electric_indent_arguments2.m | 23 +++
.../electric_indent_arguments2_expected.txt | 87 +++++++++
.../electric_indent_prop2.m | 13 ++
.../electric_indent_prop2_expected.txt | 21 +++
10 files changed, 346 insertions(+), 98 deletions(-)
diff --git a/matlab-ts-mode--ei.el b/matlab-ts-mode--ei.el
index 37b60cb52c..4fe000d4f4 100644
--- a/matlab-ts-mode--ei.el
+++ b/matlab-ts-mode--ei.el
@@ -1209,17 +1209,18 @@ Returns nil if not a property, enum field, or argument
node that ends on
same line and has items to align."
(let* ((first-node-in-line (nth 3 ei-info))
(modified-node-type (cdr (matlab-ts-mode--ei-get-node-to-use
first-node-in-line)))
- (prop-node (pcase modified-node-type
+ (prop-id-node (pcase modified-node-type
((or "prop-id" "enum-id")
first-node-in-line)
("property_name"
- (treesit-node-parent first-node-in-line)))))
+ (treesit-node-parent first-node-in-line))))
+ (prop-node (treesit-node-parent prop-id-node)))
;; skip multi-line nodes for alignment (properties / arguments can span
multiple lines)
(when (and prop-node
(= (line-number-at-pos (treesit-node-start prop-node))
(line-number-at-pos (treesit-node-end prop-node)))
- (> (length (treesit-node-children (treesit-node-parent
prop-node))) 1))
- prop-node)))
+ (> (length (treesit-node-children prop-node)) 1))
+ prop-id-node)))
(defun matlab-ts-mode--ei-prop-length (ei-info)
"Get the property length from the electric indented line in EI-INFO."
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
new file mode 100644
index 0000000000..f7a31e1d63
--- /dev/null
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
@@ -0,0 +1,23 @@
+% -*- matlab-ts -*-
+
+% t-utils-test-indent: no-line-by-line-indent - when typing line-by-line we
can't align the
+% arguments because we don't have them all.
+
+function electric_indent_arguments2( ...
+ firstToAnalyze, argTwo, generateFoobar, NameValues)
+ arguments
+ firstToAnalyze string {mustBeScalarOrEmpty}
+ argTwo { ...
+ Aero.internal.validation.mustBeEmptyStringOrStateSpace ...
+ } = ''
+ generateFoobar (1,1) matlab.lang.OnOffSwitchState = "off"
+ NameValues.SecondDocument (1,1) string
{mustBeMember(NameValues.SecondDocument, ["Document1", "Document2"])} =
"Document1"
+ NameValues.Level (1,1) string {mustBeMember(NameValues.Level, ...
+ ["Lowest", "All",
"1", "2", "3"])} = "Lowest"
+ end
+
+ disp(firstToAnalyze);
+ disp(argTwo);
+ disp(generateFoobar);
+ disp(NameValues);
+end
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.m
new file mode 100644
index 0000000000..3b37ed9b97
--- /dev/null
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.m
@@ -0,0 +1,23 @@
+% -*- matlab-ts -*-
+
+% t-utils-test-indent: no-line-by-line-indent - when typing line-by-line we
can't align the
+% arguments because we don't have them all.
+
+function electric_indent_arguments2( ...
+ firstToAnalyze, argTwo, generateFoobar, NameValues)
+ arguments
+ firstToAnalyze string {mustBeScalarOrEmpty}
+ argTwo { ...
+ Aero.internal.validation.mustBeEmptyStringOrStateSpace ...
+ } = ''
+ generateFoobar (1,1) matlab.lang.OnOffSwitchState = "off"
+ NameValues.SecondDocument (1,1) string
{mustBeMember(NameValues.SecondDocument, ["Document1", "Document2"])} =
"Document1"
+ NameValues.Level (1,1) string {mustBeMember(NameValues.Level,
...
+ ["Lowest", "All",
"1", "2", "3"])} = "Lowest"
+ end
+
+ disp(firstToAnalyze);
+ disp(argTwo);
+ disp(generateFoobar);
+ disp(NameValues);
+end
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected_msgs.m
new file mode 100644
index 0000000000..43215e2322
--- /dev/null
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected_msgs.m
@@ -0,0 +1,23 @@
+% -*- matlab-ts -*- % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
+
+% t-utils-test-indent: no-line-by-line-indent - when typing line-by-line we
can't align the % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
+% arguments because we don't have them all. % <{Matched rule:
(matlab-ts-mode--i-block-comment-end-matcher
matlab-ts-mode--i-block-comment-end-anchor 0)}>
+
+function electric_indent_arguments2( ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
+ firstToAnalyze, argTwo, generateFoobar, NameValues) % <{Matched rule:
(matlab-ts-mode--i-fcn-args-next-line-matcher
matlab-ts-mode--i-fcn-args-next-line-anchor
matlab-ts-mode--i-fcn-args-next-line-offset)}>
+ arguments % <{Matched rule: ((parent-is "\\`function_definition\\'")
parent matlab-ts-mode--set-function-indent-level-for-gp)}>
+ firstToAnalyze string {mustBeScalarOrEmpty} % <{Matched rule:
((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ argTwo { ... % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ Aero.internal.validation.mustBeEmptyStringOrStateSpace ... %
<{Matched rule: (matlab-ts-mode--i-validation-functions-matcher parent
matlab-ts-mode--i-validation-functions-offset)}>
+ } = '' % <{Matched rule: ((n-p-gp "\\`}\\'"
"\\`validation_functions\\'" nil) parent 0)}>
+ generateFoobar (1,1) matlab.lang.OnOffSwitchState = "off" %
<{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ NameValues.SecondDocument (1,1) string
{mustBeMember(NameValues.SecondDocument, ["Document1", "Document2"])} =
"Document1" % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ NameValues.Level (1,1) string {mustBeMember(NameValues.Level,
... % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ ["Lowest", "All",
"1", "2", "3"])} = "Lowest" % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
+ end % <{Matched rule: ((node-is
"\\`\\(?:catch_clause\\|e\\(?:lse\\(?:\\(?:if\\)?_clause\\)\\|nd\\)\\)\\'")
parent 0)}>
+
+ disp(firstToAnalyze); % <{Matched rule: ((parent-is
"\\`function_definition\\'") parent
matlab-ts-mode--set-function-indent-level-for-gp)}>
+ disp(argTwo); % <{Matched rule: ((parent-is "\\`block\\'") parent 0)}>
+ disp(generateFoobar); % <{Matched rule: ((parent-is "\\`block\\'") parent
0)}>
+ disp(NameValues); % <{Matched rule: ((parent-is "\\`block\\'") parent 0)}>
+end % <{Matched rule: ((node-is
"\\`\\(?:catch_clause\\|e\\(?:lse\\(?:\\(?:if\\)?_clause\\)\\|nd\\)\\)\\'")
parent 0)}>
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1.m
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1.m
index 2a58ba9752..a95c5d11d3 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1.m
@@ -1,3 +1,20 @@
% -*- matlab-ts -*-
-% Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
-function indent_xr_fun1
+%{
+ Case1:
+ (t-utils-xr
+
+ (re-search-forward "%}") "C-n"
+
+ "C-m" "C-b"
+
+ (insert "function indent_xr_fun1") "C-m"
+
+ (insert "a = 1;") "C-m"
+
+ (insert "end") "C-m"
+
+ (re-search-backward "^fun")
+ (print (buffer-substring-no-properties (point) (point-max)))
+
+ )
+%}
diff --git
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1_expected.org
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1_expected.org
index 063f8d1774..0785b77cf7 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun1_expected.org
@@ -1,154 +1,171 @@
#+startup: showall
-* Executing commands from indent_xr_fun1.m:2:9:
+* Executing commands from indent_xr_fun1.m:4:2:
- Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
+ Case1: (t-utils-xr
-- Invoking : "C-a" = move-beginning-of-line
- Start point : 219
- Moved to point: 21
- : 2:0: % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m"
(insert "end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
- : ^
- No buffer modifications
+ (re-search-forward "%}") "C-n"
-- Invoking : "C-n" = next-line
- Start point : 21
- Moved to point: 220
- : 3:0: function indent_xr_fun1
- : ^
+ "C-m" "C-b"
+
+ (insert "function indent_xr_fun1") "C-m"
+
+ (insert "a = 1;") "C-m"
+
+ (insert "end") "C-m"
+
+ (re-search-backward "^fun")
+ (print (buffer-substring-no-properties (point) (point-max)))
+
+ )
+
+- Invoking : (re-search-forward "%}")
+ Start point : 314
+ Moved to point: 317
+ : 20:2: %}
+ : ^
No buffer modifications
-- Invoking : "C-e" = move-end-of-line
- Start point : 220
- Moved to point: 243
- : 3:23: function indent_xr_fun1
- : ^
+- Invoking : "C-n" = next-line
+ Start point : 317
+ Moved to point: 318
+ : 21:0:
+ : ^
No buffer modifications
- Invoking : "C-m" = newline
- Start point : 243
- Moved to point: 244
- : 4:0:
- : ^
+ Start point : 318
+ Moved to point: 319
+ : 22:0:
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -1,3 +1,4 @@
- % -*- matlab-ts -*-
- % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
- function indent_xr_fun1
+@@ -18,3 +18,4 @@
+
+ )
+ %}
+
#+end_src diff
-- Invoking : (insert "a = 1;")
- Start point : 244
- Moved to point: 250
- : 4:6: a = 1;
- : ^
+- Invoking : "C-b" = backward-char
+ Start point : 319
+ Moved to point: 318
+ : 21:0:
+ : ^
+ No buffer modifications
+
+- Invoking : (insert "function indent_xr_fun1")
+ Start point : 318
+ Moved to point: 341
+ : 21:23: function indent_xr_fun1
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -1,4 +1,4 @@
- % -*- matlab-ts -*-
- % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
- function indent_xr_fun1
+@@ -18,4 +18,4 @@
+
+ )
+ %}
-
-+a = 1;
++function indent_xr_fun1
#+end_src diff
- Invoking : "C-m" = newline
- Start point : 250
- Moved to point: 251
- : 5:0:
- : ^
+ Start point : 341
+ Moved to point: 346
+ : 22:4:
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -2,3 +2,4 @@
- % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
+@@ -19,3 +19,4 @@
+ )
+ %}
function indent_xr_fun1
- a = 1;
-+
++
#+end_src diff
-- Invoking : (insert "end")
- Start point : 251
- Moved to point: 254
- : 5:3: end
- : ^
+- Invoking : (insert "a = 1;")
+ Start point : 346
+ Moved to point: 352
+ : 22:10: a = 1;
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -2,4 +2,4 @@
- % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
+@@ -19,4 +19,4 @@
+ )
+ %}
function indent_xr_fun1
- a = 1;
--
-+end
+-
++ a = 1;
#+end_src diff
- Invoking : "C-m" = newline
- Start point : 254
- Moved to point: 255
- : 6:0:
- : ^
+ Start point : 352
+ Moved to point: 357
+ : 23:4:
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -3,3 +3,4 @@
+@@ -20,3 +20,4 @@
+ %}
function indent_xr_fun1
- a = 1;
- end
-+
+ a = 1;
++
#+end_src diff
-- Invoking : "C-p" = previous-line
- Start point : 255
- Moved to point: 251
- : 5:0: end
- : ^
- No buffer modifications
-
-- Invoking : "C-p" = previous-line
- Start point : 251
- Moved to point: 244
- : 4:0: a = 1;
- : ^
- No buffer modifications
+- Invoking : (insert "end")
+ Start point : 357
+ Moved to point: 360
+ : 23:7: end
+ : ^
+ Buffer modified:
+ #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -20,4 +20,4 @@
+ %}
+ function indent_xr_fun1
+ a = 1;
+-
++ end
+ #+end_src diff
-- Invoking : "C-i" = indent-for-tab-command
- Start point : 244
- Moved to point: 248
- : 4:4: a = 1;
- : ^
+- Invoking : "C-m" = newline
+ Start point : 360
+ Moved to point: 357
+ : 24:0:
+ : ^
Buffer modified:
#+begin_src diff
--- start_contents
+++ end_contents
-@@ -1,6 +1,6 @@
- % -*- matlab-ts -*-
- % Case1: (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "a = 1;") "C-m" (insert
"end") "C-m" "C-p" "C-p" "C-i" (re-search-backward "^fun") (print
(buffer-substring-no-properties (point) (point-max))))
+@@ -20,4 +20,5 @@
+ %}
function indent_xr_fun1
--a = 1;
-+ a = 1;
- end
-
+ a = 1;
+- end
++end
++
#+end_src diff
- Invoking : (re-search-backward "^fun")
- Start point : 248
- Moved to point: 220
- : 3:0: function indent_xr_fun1
- : ^
+ Start point : 357
+ Moved to point: 318
+ : 21:0: function indent_xr_fun1
+ : ^
No buffer modifications
- Invoking : (print (buffer-substring-no-properties (point) (point-max)))
- Start point : 220
+ Start point : 318
No point movement
standard-output:
#+begin_example
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
new file mode 100644
index 0000000000..f7a31e1d63
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2.m
@@ -0,0 +1,23 @@
+% -*- matlab-ts -*-
+
+% t-utils-test-indent: no-line-by-line-indent - when typing line-by-line we
can't align the
+% arguments because we don't have them all.
+
+function electric_indent_arguments2( ...
+ firstToAnalyze, argTwo, generateFoobar, NameValues)
+ arguments
+ firstToAnalyze string {mustBeScalarOrEmpty}
+ argTwo { ...
+ Aero.internal.validation.mustBeEmptyStringOrStateSpace ...
+ } = ''
+ generateFoobar (1,1) matlab.lang.OnOffSwitchState = "off"
+ NameValues.SecondDocument (1,1) string
{mustBeMember(NameValues.SecondDocument, ["Document1", "Document2"])} =
"Document1"
+ NameValues.Level (1,1) string {mustBeMember(NameValues.Level, ...
+ ["Lowest", "All",
"1", "2", "3"])} = "Lowest"
+ end
+
+ disp(firstToAnalyze);
+ disp(argTwo);
+ disp(generateFoobar);
+ disp(NameValues);
+end
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.txt
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.txt
new file mode 100644
index 0000000000..0f5c733862
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_arguments2_expected.txt
@@ -0,0 +1,87 @@
+# -*- t-utils-ts-parse-tree -*-
+(source_file<1,933> (comment[1,20]@{% -*- matlab-ts -*-}@) (comment[22,157]@{%
t-utils-test-indent: no-line-by-line-indent - wh...}@) \n[157,159]
+ (function_definition<159,932> function[159,167] name:
(identifier[168,194]@{electric_indent_arguments2}@)
+ (function_arguments<194,255> ([194,195]
(line_continuation[196,200]@{...\n}@) arguments:
(identifier[204,218]@{firstToAnalyze}@) ,[218,219]
(identifier[220,226]@{argTwo}@) ,[226,227]
(identifier[228,242]@{generateFoobar}@) ,[242,243]
(identifier[244,254]@{NameValues}@) )[254,255])
+ \n[255,256]
+ (arguments_statement<260,835> arguments[260,269] \n[269,270]
+ (property<278,321> name: (identifier[278,292]@{firstToAnalyze}@)
(identifier[293,299]@{string}@)
+ (validation_functions<300,321> {[300,301]
(identifier[301,320]@{mustBeScalarOrEmpty}@) }[320,321]))
+ \n[321,322]
+ (property<330,440> name: (identifier[330,336]@{argTwo}@)
+ (validation_functions<337,435> {[337,338]
(line_continuation[339,343]@{...\n}@)
+ (field_expression<360,414> object: (identifier[360,364]@{Aero}@)
.[364,365] field: (identifier[365,373]@{internal}@) .[373,374]
(identifier[374,384]@{validation}@) .[384,385]
(identifier[385,414]@{mustBeEmptyStringOrStateSpace}@))
+ (line_continuation[415,419]@{...\n}@) }[434,435])
+ (default_value<436,440> =[436,437]
+ (string<438,440> '[438,439] '[439,440])))
+ \n[440,441]
+ (property<449,513> name: (identifier[449,463]@{generateFoobar}@)
+ (dimensions<471,476> ([471,472] (number[472,473]@{1}@) ,[473,474]
(number[474,475]@{1}@) )[475,476])
+ (property_name<477,505> (identifier[477,483]@{matlab}@) .[483,484]
(identifier[484,488]@{lang}@) .[488,489]
(identifier[489,505]@{OnOffSwitchState}@))
+ (default_value<506,513> =[506,507]
+ (string<508,513> "[508,509] (string_content[509,512]@{off}@) "[512,513])))
+ \n[513,514]
+ (property<522,644>
+ name: (property_name<522,547> (identifier[522,532]@{NameValues}@)
.[532,533] (identifier[533,547]@{SecondDocument}@))
+ (dimensions<548,553> ([548,549] (number[549,550]@{1}@) ,[550,551]
(number[551,552]@{1}@) )[552,553])
+ (identifier[554,560]@{string}@)
+ (validation_functions<561,630> {[561,562]
+ (function_call<562,629> name: (identifier[562,574]@{mustBeMember}@)
([574,575]
+ (arguments<575,628>
+ argument: (field_expression<575,600> object:
(identifier[575,585]@{NameValues}@) .[585,586] field:
(identifier[586,600]@{SecondDocument}@))
+ ,[600,601]
+ (matrix<602,628> [[602,603]
+ (row<603,627>
+ (string<603,614> "[603,604] (string_content[604,613]@{Document1}@)
"[613,614])
+ ,[614,615]
+ (string<616,627> "[616,617] (string_content[617,626]@{Document2}@)
"[626,627]))
+ ][627,628]))
+ )[628,629])
+ }[629,630])
+ (default_value<631,644> =[631,632]
+ (string<633,644> "[633,634] (string_content[634,643]@{Document1}@)
"[643,644])))
+ \n[644,645]
+ (property<653,827>
+ name: (property_name<653,669> (identifier[653,663]@{NameValues}@)
.[663,664] (identifier[664,669]@{Level}@))
+ (dimensions<672,677> ([672,673] (number[673,674]@{1}@) ,[674,675]
(number[675,676]@{1}@) )[676,677])
+ (identifier[678,684]@{string}@)
+ (validation_functions<685,816> {[685,686]
+ (function_call<686,815> name: (identifier[686,698]@{mustBeMember}@)
([698,699]
+ (arguments<699,814>
+ argument: (field_expression<699,715> object:
(identifier[699,709]@{NameValues}@) .[709,710] field:
(identifier[710,715]@{Level}@))
+ ,[715,716] (line_continuation[717,721]@{...\n}@)
+ (matrix<782,814> [[782,783]
+ (row<783,813>
+ (string<783,791> "[783,784] (string_content[784,790]@{Lowest}@)
"[790,791])
+ ,[791,792]
+ (string<793,798> "[793,794] (string_content[794,797]@{All}@)
"[797,798])
+ ,[798,799]
+ (string<800,803> "[800,801] (string_content[801,802]@{1}@) "[802,803])
+ ,[803,804]
+ (string<805,808> "[805,806] (string_content[806,807]@{2}@) "[807,808])
+ ,[808,809]
+ (string<810,813> "[810,811] (string_content[811,812]@{3}@)
"[812,813]))
+ ][813,814]))
+ )[814,815])
+ }[815,816])
+ (default_value<817,827> =[817,818]
+ (string<819,827> "[819,820] (string_content[820,826]@{Lowest}@)
"[826,827])))
+ \n[827,828] end[832,835])
+ (block<841,929>
+ (function_call<841,861> name: (identifier[841,845]@{disp}@) ([845,846]
+ (arguments<846,860> argument: (identifier[846,860]@{firstToAnalyze}@))
+ )[860,861])
+ ;[861,862]
+ (function_call<867,879> name: (identifier[867,871]@{disp}@) ([871,872]
+ (arguments<872,878> argument: (identifier[872,878]@{argTwo}@))
+ )[878,879])
+ ;[879,880]
+ (function_call<885,905> name: (identifier[885,889]@{disp}@) ([889,890]
+ (arguments<890,904> argument: (identifier[890,904]@{generateFoobar}@))
+ )[904,905])
+ ;[905,906]
+ (function_call<911,927> name: (identifier[911,915]@{disp}@) ([915,916]
+ (arguments<916,926> argument: (identifier[916,926]@{NameValues}@))
+ )[926,927])
+ ;[927,928] \n[928,929])
+ end[929,932])
+ \n[932,933])
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2.m
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2.m
new file mode 100644
index 0000000000..2033056ba8
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2.m
@@ -0,0 +1,13 @@
+% -*- matlab-ts -*-
+
+% t-utils-test-indent: no-line-by-line-indent - line-by-line typing results in
error nodes
+
+classdef electric_indent_prop2
+ properties
+ abc = true;
+ fubar;
+ b = false;
+ p1
+ lonPropertyName (1,1) double = 1.1;
+ end
+end
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2_expected.txt
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2_expected.txt
new file mode 100644
index 0000000000..06edb209d8
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-electric-indent-files/electric_indent_prop2_expected.txt
@@ -0,0 +1,21 @@
+# -*- t-utils-ts-parse-tree -*-
+(source_file<1,288> (comment[1,20]@{% -*- matlab-ts -*-}@) (comment[22,112]@{%
t-utils-test-indent: no-line-by-line-indent - li...}@) \n[112,114]
+ (class_definition<114,287> classdef[114,122] name:
(identifier[123,144]@{electric_indent_prop2}@) \n[144,145]
+ (properties<149,283> properties[149,159] \n[159,160]
+ (property<168,178> name: (identifier[168,171]@{abc}@)
+ (default_value<172,178> =[172,173] (identifier[174,178]@{true}@)))
+ ;[178,179] \n[179,180]
+ (property<188,193> name: (identifier[188,193]@{fubar}@))
+ ;[193,194] \n[194,195]
+ (property<203,217> name: (identifier[203,204]@{b}@)
+ (default_value<210,217> =[210,211] (identifier[212,217]@{false}@)))
+ ;[217,218] \n[218,219]
+ (property<227,229> name: (identifier[227,229]@{p1}@))
+ \n[229,230]
+ (property<238,274> name: (identifier[238,253]@{lonPropertyName}@)
+ (dimensions<256,261> ([256,257] (number[257,258]@{1}@) ,[258,259]
(number[259,260]@{1}@) )[260,261])
+ (identifier[262,268]@{double}@)
+ (default_value<269,274> =[269,270] (number[271,274]@{1.1}@)))
+ ;[274,275] \n[275,276] end[280,283])
+ \n[283,284] end[284,287])
+ \n[287,288])