branch: externals/matlab-mode commit 0f13363b9fe865db7dfaa73b7580c951be3dd3bd Author: John Ciolfi <john.ciolfi...@gmail.com> Commit: John Ciolfi <john.ciolfi...@gmail.com>
matlab-ts-mode: add test locking down fcn-call within fcn-call continued --- .../indent_fcn_call_in_fcn_call_cont.m | 10 ++++++++++ .../indent_fcn_call_in_fcn_call_cont_expected.m | 10 ++++++++++ .../indent_fcn_call_in_fcn_call_cont_expected_msgs.m | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont.m b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont.m new file mode 100644 index 0000000000..0d77279db2 --- /dev/null +++ b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont.m @@ -0,0 +1,10 @@ +% -*- matlab-ts -*- + +classdef indent_fcn_call_in_fcn_call_cont + properties (Constant) + tabularDs = tabularTextDatastore(some.namespace.someFunction( ... + 'argument1', 'argument2', 'argument3'), ... + "TreatAsMissing", "NA", "MissingValue", 0, ... + "SelectedVariableNames", {'ArrTime', 'DepDelay'}); + end +end diff --git a/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected.m b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected.m new file mode 100644 index 0000000000..0d77279db2 --- /dev/null +++ b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected.m @@ -0,0 +1,10 @@ +% -*- matlab-ts -*- + +classdef indent_fcn_call_in_fcn_call_cont + properties (Constant) + tabularDs = tabularTextDatastore(some.namespace.someFunction( ... + 'argument1', 'argument2', 'argument3'), ... + "TreatAsMissing", "NA", "MissingValue", 0, ... + "SelectedVariableNames", {'ArrTime', 'DepDelay'}); + end +end diff --git a/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected_msgs.m b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected_msgs.m new file mode 100644 index 0000000000..47928d937b --- /dev/null +++ b/tests/test-matlab-ts-mode-indent-files/indent_fcn_call_in_fcn_call_cont_expected_msgs.m @@ -0,0 +1,10 @@ +% -*- matlab-ts -*- % <{Matched rule: ((lambda (node parent _bol &rest _) (and node (not (string= (treesit-node-type node) "line_continuation")) (equal (treesit-node-type parent) "source_file"))) (lambda (_node _parent bol &rest _) (save-excursion (goto-char bol) (line-beginning-position))) 0)}> + +classdef indent_fcn_call_in_fcn_call_cont % <{Matched rule: ((lambda (node parent _bol &rest _) (and node (not (string= (treesit-node-type node) "line_continuation")) (equal (treesit-node-type parent) "source_file"))) (lambda (_node _parent bol &rest _) (save-excursion (goto-char bol) (line-beginning-position))) 0)}> + properties (Constant) % <{Matched rule: ((node-is "\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'") parent 4)}> + tabularDs = tabularTextDatastore(some.namespace.someFunction( ... % <{Matched rule: ((node-is "\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'") parent 4)}> + 'argument1', 'argument2', 'argument3'), ... % <{Matched rule: ((n-p-gp "\\`arguments\\'" "\\`function_call\\'" "\\`field_expression\\'") grand-parent 4)}> + "TreatAsMissing", "NA", "MissingValue", 0, ... % <{Matched rule: ((parent-is "\\`arguments\\'") parent 0)}> + "SelectedVariableNames", {'ArrTime', 'DepDelay'}); % <{Matched rule: ((parent-is "\\`arguments\\'") parent 0)}> + end % <{Matched rule: ((node-is "\\`\\(?:catch_clause\\|e\\(?:lse\\(?:\\(?:if\\)?_clause\\)\\|nd\\)\\)\\'") parent 0)}> +end % <{Matched rule: ((node-is "\\`\\(?:catch_clause\\|e\\(?:lse\\(?:\\(?:if\\)?_clause\\)\\|nd\\)\\)\\'") parent 0)}>