| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Allow chaining
of single assignment statements.
* test/lisp/progmodes/python-tests.el
(python-font-lock-assignment-statement-20): New test.
(Bug#71093)
|
|
|
|
|
|
| |
* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): If need to skip the tree-sitter
test, do so silently. (Bug#70345)
|
|
|
|
|
|
| |
* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): Skip test instead of
failing. (Bug#70345)
|
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): Move the test to here.
* test/lisp/progmodes/csharp-ts-mode-tests.el: Remove file.
* test/lisp/progmodes/csharp-ts-mode-resources/indent.erts: Move
to test/lisp/progmodes/csharp-mode-resources/indent-ts.erts.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Fix indentation rules for 'if' and 'else'.
* test/lisp/progmodes/csharp-ts-mode-tests.el:
* test/lisp/progmodes/csharp-ts-mode-resources/indent.erts: New
test files.
Copyright-paperwork-exempt: yes
|
|
|
|
|
|
| |
* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Make the
regex same as before, but conditionally check other heuristics rather
than crazy regex shenanigans.
|
|
|
|
|
| |
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts: Add
test.
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Add
handling to not consider ended statements as object init openers.
* test/lisp/progmodes/csharp-mode-resources/indent.erts: New test
resources.
* test/lisp/progmodes/csharp-mode-tests.el: Add test for this particular
issue.
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules):
Support putting the opening brace on a separate line (bug#67556).
* test/lisp/progmodes/java-ts-mode-resources/indent.erts:
Add a test.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
typescript-ts-mode-test-indentation depends on both the tree-sitter
typescript grammar, and the tree-sitter tsx grammar. If only the
typescript is installed, the tests will run and then fail unexpectedly
after tsx fails to load.
* test/lisp/progmodes/typescript-ts-mode-tests.el
(typescript-ts-mode-test-indentation): Skip test if tsx grammar is
missing.
Copyright-paperwork-exempt: yes
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix fontification of strings inside of f-strings interpolation, e.g. for
f"beg {'nested'}" - 'nested' was not fontified as string. Do not
override the face of builtin functions (all, bytes etc.) with the
function call face. Add missing assignment expressions (:= *=).
Fontify built-ins (dict,list,etc.) as types when they are used in type
hints. Highlight union types (type1|type2). Highlight base class names
in the class definition. Fontify class patterns in case statements.
Highlight the second argument as a type in isinstance/issubclass call.
Highlight dotted decorator names.
* lisp/progmodes/python.el (python--treesit-keywords): Add compound
keyword "is not".
(python--treesit-builtin-types): New variable that stores all python
built-in types.
(python--treesit-type-regex): New variable. Regex matches if text is
either built-in type or text starts with capital letter.
(python--treesit-builtins): Extract built-in types to other variable.
(python--treesit-fontify-string): fix f-string interpolation. Enable
interpolation highlighting only if string-interpolation is presented
on the enabled levels of treesit-font-lock-feature-list.
(python--treesit-fontify-string-interpolation): Remove function.
(python--treesit-fontify-union-types): Fontify nested union types.
(python--treesit-fontify-union-types-strict): Fontify nested union
types, only if type identifier matches against
python--treesit-type-regex.
(python--treesit-fontify-dotted-decorator): Fontify all parts of
dotted decorator name.
(python--treesit-settings): Change/add rules. (Bug#67061)
* test/lisp/progmodes/python-tests.el
(python-ts-tests-with-temp-buffer): Function for setting up test
buffer.
(python-ts-mode-compound-keywords-face)
(python-ts-mode-named-assignement-face-1)
(python-ts-mode-assignement-face-2)
(python-ts-mode-nested-types-face-1)
(python-ts-mode-union-types-face-1)
(python-ts-mode-union-types-face-2)
(python-ts-mode-types-face-1)
(python-ts-mode-types-face-2)
(python-ts-mode-types-face-3)
(python-ts-mode-isinstance-type-face-1)
(python-ts-mode-isinstance-type-face-2)
(python-ts-mode-isinstance-type-face-3)
(python-ts-mode-superclass-type-face)
(python-ts-mode-class-patterns-face)
(python-ts-mode-dotted-decorator-face-1)
(python-ts-mode-dotted-decorator-face-2)
(python-ts-mode-builtin-call-face)
(python-ts-mode-interpolation-nested-string)
(python-ts-mode-disabled-string-interpolation)
(python-ts-mode-interpolation-doc-string): Add tests.
|
|
|
|
|
| |
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix indentation for string_array closer.
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/js.el (js--treesit-indent-rules): Add indentation
rules to handle bracketless statements (bug#67758).
* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
New test for js-ts-mode indentation.
* test/lisp/progmodes/js-resources/js-ts-indents.erts: New file
with indentation tests for js-ts-mode.
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Make sure the BSD rules only apply to
opening bracket (compound_statement), then bracketless statements will
fallback to common rules.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: Copy the
bracketless test from indent.erts to here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. In a compund_statement, we indent the first sibling against the
parent, and the rest siblings against their previous sibling. But
this strategy falls apart when the first sibling is not on its own
line. We should regard the first sibling that is on its own line as
the "first sibling"", and indent it against the parent.
2. In linux style, in a do-while statement, if the do-body is
bracket-less, the "while" keyword is indented to the same level as the
do-body. It should be indented to align with the "do" keyword
instead.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--no-prev-standalone-sibling): New function.
(c-ts-mode--indent-styles): Use
c-ts-mode--no-prev-standalone-sibling. Add while keyword indent rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests.
|
|
|
|
|
|
| |
* lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re):
Add grouping around methods from the whitelist.
(ruby-syntax-propertize): Also look for spaces around the slash.
|
| |
|
|
|
|
|
| |
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): Add
indentation rule for switch case and default keywords. (Bug#67488)
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Add indentation for children of
else_clause.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts:
(Name): Add test for else-break. Also make the test such that it
needs to indent correctly from scratch (rather than maintaining the
already correct indentation.)
|
|
|
|
| |
Do not merge to master.
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/java-ts-mode-resources/indent.erts: Use default
indent offset, and tweak the indentation examples.
(cherry picked from commit dbe7803aa1e8249bd70f67f25f19aedabeb9cc22)
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/java-ts-mode-resources/indent.erts: Add new test
case.
(cherry picked from commit 229d0772e235f51812ed8020a31f9a8de366c7ba)
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Support indentation for
conditionals without braces (bug#67031).
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
(Statement indentation without braces): New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/java-ts-mode-resources/indent.erts: New file
with tests for indentation.
* test/lisp/progmodes/java-ts-mode-resources/movement.erts: New file
with tests for movement.
* test/lisp/progmodes/java-ts-mode-tests.el: New tests.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts: New
file with tests for indentation.
* test/lisp/progmodes/typescript-ts-mode-tests.el: New tests.
(cherry picked from commit c8dd37b16c574beda900d4ee48ac7b4ab4a2ee56)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The docstring of 'beginning-of-defun-function' says that the
function shall return non-nil when it found the beginning
of a defun. This is specially important because the calling
code decides when to move point depending on the return value.
* lisp/progmodes/js.el (js-beginning-of-defun)
(js--beginning-of-defun-flat): Return non-nil when the beginning
of a defun is found. (Bug#64283)
* test/lisp/progmodes/js-tests.el (js-mode-end-of-defun): Add a unit
test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 4915ca5dd4245a909c046e6691e8d4a1919890c8.
We have found that there are performance issues when editing a large
file. The issue can be reproduced as follows:
1. emacs -Q
2. Open large Python file (e.g. turtle.py in Python)
3. Near the top of the buffer, enter open paren and some characters.
The above commit extends the region to be font-locked using
`python-nav-end-of-statement'. However, if there are unbalanced
parens, it may move point to the end of the buffer. This causes
almost the entire buffer to be font-locked, which is not acceptable
for large files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-info-docstring-p): Stop using
python-rx string-delimiter.
* test/lisp/progmodes/python-tests.el
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Mark as expected failures
until another bug in 'python-info-docstring-p' is corrected.
(python-info-docstring-p-7): New test. (Bug#63622)
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method):
Reduce the use of 'nreverse' (bug#62761).
* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-singleton-referencing-outer):
New test.
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/eglot-tests.el
(eglot-test-rust-analyzer-watches-files): Bump timeout.
(eglot-test-json-basic): Check for yas-minor-mode before using it,
like other tests do (bug#61637).
|
|
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el (c-ts-base--before-indent): Try to
guess when the parse tree is incomplete, and provide a better node
to indent against (bug#62717).
(c-ts-base-mode): Set up advice for local treesit-indent-function.
|
|
|
|
|
|
|
| |
* test/lisp/progmodes/eglot-tests.el
(eglot-test-eldoc-after-completions): Fix misplaced parenthesis.
(cherry picked from commit 3aedd5c920560fe6456a860a900be40a35e850d2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functionality under test in eglot.el is exactly the same, but use
the clangd server only, as that is used in more tests, and it is much
easier to check if it misbehaves or not.
Tests pass with clangd version 15.
* test/lisp/progmodes/eglot-tests.el (python): Don't require it.
(eglot--call-with-fixture): Simplify.
(eglot--wait-for-clangd): New helper.
(eglot-test-basic-completions)
(eglot-test-non-unique-completions, eglot-test-basic-xref)
(eglot-test-snippet-completions)
(eglot-test-snippet-completions-with-company)
(eglot-test-eldoc-after-completions, eglot-test-multiline-eldoc):
Use clangd, not pylsp.
(eglot-test-formatting): Renamed from
eglot-test-python-autopep-formatting.
(eglot-test-python-yapf-formatting): Remove.
(cherry picked from commit fc8230f3362b12955152f48565a6c670b4c4cc88)
|
|
|
|
|
| |
* test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-imenu-index):
Add check for treesitter.
|
|
|
|
|
| |
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-tramp-test):
Bind `tramp-allow-unsafe-temporary-files' with t. (Bug#62289)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--full-name): Drop '#'
from the end of resulting string when the node is not a method.
Support 'singleton_method' nodes.
(ruby-ts--imenu-helper): Simplify, to create a "flat" list of
entries, rather than a nested one. The previous implementation
had problems (like producing a nested structure of full-qualified
names, thus creating a lot of textual repetition), seems easier to
just follow ruby-mode's example here, at least for Emacs 29's
release.
* test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-imenu-index):
New test.
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-info-dedenter-statement-p): Do not
consider the first "case" in the block as dedenter.
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-7)
(python-info-dedenter-statement-p-6): New tests. (Bug#62092)
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule for case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-syntax--context-compiler-macro)
(python-syntax-context): Add single-quoted-string and
triple-quoted-string as TYPE argument.
(python-info-triple-quoted-string-p): New helper function.
(python-fill-paragraph)
(python-fill-string): Use it.
* test/lisp/progmodes/python-tests.el (python-syntax-context-1)
(python-fill-paragraph-single-quoted-string-1)
(python-fill-paragraph-single-quoted-string-2)
(python-fill-paragraph-triple-quoted-string-1)
(python-info-triple-quoted-string-p-1)
(python-info-triple-quoted-string-p-2)
(python-info-triple-quoted-string-p-3): New tests.
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-rx): Add "case" to dedenter.
(python-info-dedenter-opening-block-positions): Add "case" to pairs.
* test/lisp/progmodes/python-tests.el (python-indent-dedenters-9):
New test.
|
|
|
|
|
|
| |
*
test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-syntax-propertize-symbol):
Add check for treesitter.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query):
Don't match ':' in symbol node text. Or '_', I suppose.
(ruby-ts--syntax-propertize): Make sure to only put the '_' syntax
on punctuation syntax characters, and not on the whole symbol (to
e.g. have symbols like :foo? include text recognized as word).
* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-syntax-propertize-symbol): New test.
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Make the check
stricter. Require that block starts only at indentation.
* test/lisp/progmodes/python-tests.el
(python-indent-after-bare-match): Another test (bug#62031).
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-nav-end-of-statement): Add
searching for corresponding string-quote.
* test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-3)
(python-nav-end-of-statement-4, python-info-current-defun-4): New
tests. (Bug#58780)
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Check that the
supposed block start is not a method call (bug#62031).
* test/lisp/progmodes/python-tests.el (python-indent-after-re-match):
New test.
Co-authored-by: Lele Gaifax <lele@metapensiero.it>
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Handle the empty line case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent-presets): Support null as
a value for NODE-TYPE in the 'match' matcher.
|
|
|
|
|
|
|
|
|
| |
Mentioned in bug#61893.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Handle
"#elif" and "#else".
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: Add an
"#elif" to the test.
|
|
|
|
|
|
|
|
|
|
| |
Mentioned in bug#61893, although not the subject of it.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Fix the child index for preproc_else
and preproc_elif case.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts:
New test.
|
|
|
|
|
|
|
|
| |
Not the subject of it, but mentioned in bug#61893.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Skip
the sibling if it doesn't start on it's own line.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
|