-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Prototype of treesit.el support for ruby #47
base: master
Are you sure you want to change the base?
WIP: Prototype of treesit.el support for ruby #47
Commits on Jan 4, 2023
-
Prototype of treesit.el support for ruby
This commit is a prototype exploring what it would mean to make the minor mode work with the built in `treesit.el` treesitter support in Emacs 29. I've modified many of the functions and fold rules specific to the ruby language, and have tested locally with a few ruby code files to confirm things are working The actual work consists mostly of ... * swapping out functions for their `treesit.el` equivalents * replacing symbols for node types with strings * Modifying `(alist-get...` usages to support string keys
Configuration menu - View commit details
-
Copy full SHA for db244a6 - Browse repository at this point
Copy the full SHA db244a6View commit details
Commits on Jan 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 708c5f7 - Browse repository at this point
Copy the full SHA 708c5f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for de098df - Browse repository at this point
Copy the full SHA de098dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for f51f807 - Browse repository at this point
Copy the full SHA f51f807View commit details
Commits on Feb 2, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3bd91f1 - Browse repository at this point
Copy the full SHA 3bd91f1View commit details -
Check that
treesit-buffer-root-node
is definedNot sure why this is needed but I get startup errors without these. Perhaps an ordering issue.
Configuration menu - View commit details
-
Copy full SHA for ad62bc7 - Browse repository at this point
Copy the full SHA ad62bc7View commit details -
`(car fold-range)` is not a sequence, it's a symbol, at least in my C++ buffers. This patch converts it using `symbol-name`.
Configuration menu - View commit details
-
Copy full SHA for b9d44b6 - Browse repository at this point
Copy the full SHA b9d44b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae7643e - Browse repository at this point
Copy the full SHA ae7643eView commit details -
Fix ts-fold-indicators: treesit-query-compile needs list, not vector
For simplicity I just converted the `patterns` vector to a list, but there are probably simpler ways to do this.
Configuration menu - View commit details
-
Copy full SHA for e838f1c - Browse repository at this point
Copy the full SHA e838f1cView commit details -
Handle errors from treesit-buffer-root-node
It seems `treesit-buffer-root-node` returns an error when there is no parser for a given buffer. In my case, this happens when trying to get doc for an elisp variable; `ts-fold--tree-sitter-trigger` runs in an elisp-mode "*temp*" buffer, and `treesit-buffer-root-node` raises an error. If I just ignore the error around that call, `ts-fold--tree-sitter-trigger` still runs `(ts-fold-mode -1)`. Seems like the simplest thing is to just do nothing in that case. To repro the problem, enable ts-fold mode globally and do `C-H v emacs-version`.
Configuration menu - View commit details
-
Copy full SHA for 526987c - Browse repository at this point
Copy the full SHA 526987cView commit details
Commits on Feb 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 38f646c - Browse repository at this point
Copy the full SHA 38f646cView commit details -
This is not perfect; when folding a node with children, it shows the first character of the node, then the fold indicator, then the colon. Ideally it would show the whole name of the key, and then the fold indicator. Not sure how to do that.
Configuration menu - View commit details
-
Copy full SHA for 3c0f46f - Browse repository at this point
Copy the full SHA 3c0f46fView commit details -
- Use a better ts-fold-range function for yaml - Remove "block_sequence" fold-parser; don't think that's useful. - Fix ts-fold--get-nth-child: `(treesit-node-children) is a list, not an array.
Configuration menu - View commit details
-
Copy full SHA for 59da027 - Browse repository at this point
Copy the full SHA 59da027View commit details
Commits on Feb 4, 2023
-
Merge pull request #1 from garyo/garyo/treesit-el-patches
treesit.el patches
Configuration menu - View commit details
-
Copy full SHA for 473ed37 - Browse repository at this point
Copy the full SHA 473ed37View commit details
Commits on Mar 13, 2023
-
Some c-preproc-if have no 'else' branch and 'alternative' node. For example: CODE: #if THREAD_SIZE >= PAGE_SIZE void __init __weak thread_stack_cache_init(void) { } #endif TREE: (preproc_if #if condition: (binary_expression left: (identifier) operator: >= right: (identifier)) \n (declaration type: (primitive_type) declarator: (identifier) type: ;) (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list ( (parameter_declaration type: (primitive_type)) ))) body: (compound_statement { })) #endif) So we use last child node(i.e. "#endif") instead of 'alternative' node in this case.
Configuration menu - View commit details
-
Copy full SHA for a7bb833 - Browse repository at this point
Copy the full SHA a7bb833View commit details
Commits on Mar 16, 2023
-
Merge pull request #2 from norris-young/norris/treesit-ts-fold-fix
Fix folding of c-preproc-if
Configuration menu - View commit details
-
Copy full SHA for 5253d0c - Browse repository at this point
Copy the full SHA 5253d0cView commit details