Skip to content
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

Support for treesit-beginning-of-defun and friends and which-function-mode #13

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

VlachJosef
Copy link
Contributor

Hello,

This PR defines treesit-defun-type-regexp.

Having this regex allow use of treesit-beginning-of-defun and treesit-end-of-defun commands.

There is an issue with treesit-beginning-of-defun in cases when body of a scala function etc. is an indented_block. For example:

  def parseInt: Int =
    input => parse(input)

With out of the box functionality point jumps to the parent of parseInt function.

To fix this issue scala-ts--move-out-of-indented-block advice is run before treesit-beginning-of-defun is executed.

Introducing treesit-defun-type-regexp also make which-function-mode to work correctly.

Copy link
Owner

@KaranAhlawat KaranAhlawat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try and discuss these comments! Thank you very much for your contribution.

@KaranAhlawat
Copy link
Owner

@VlachJosef Thank you again for your contribution. I hope the package has helped you out! :) Will be merging and closing this now.

@KaranAhlawat KaranAhlawat merged commit 38dc7a2 into KaranAhlawat:main Mar 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants