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

Can't indent inside doc strings #16

Open
danielmatz opened this issue Sep 21, 2023 · 3 comments
Open

Can't indent inside doc strings #16

danielmatz opened this issue Sep 21, 2023 · 3 comments

Comments

@danielmatz
Copy link
Contributor

When inside a multi-line string (like a doc string), julia-mode allows you to manually indent. This is useful for writing signatures in doc strings. With julia-ts-mode, indentation is locked to the beginning of the line of the parent (I think).

For example, in the following case, with point represented by |, trying to indent just keeps point where it's at.

function foo()
    x = """
    |
    """
end
@ronisbr
Copy link
Collaborator

ronisbr commented Sep 21, 2023

Hum, the problem is that the node inside this is just (string_literal). I have no ideia how can we improve this. Ideas?

@ronisbr
Copy link
Collaborator

ronisbr commented Sep 21, 2023

Ah, btw, the fact that you cannot even increase the indentation is related to this issue:

JuliaEditorSupport/julia-emacs#188 (comment)

@danielmatz
Copy link
Contributor Author

Hum, the problem is that the node inside this is just (string_literal). I have no ideia how can we improve this. Ideas?

Re-reading the parser-based indentation info page, I don't see any escape hatch to do a manual tab. I suppose we'd have to bind a special function to TAB that first checks if we are in a string literal, at which point it inserts a tab/spaces, and then otherwise allows the tree sitter indentation to proceed...

Ah, btw, the fact that you cannot even increase the indentation is related to this issue:

JuliaEditorSupport/julia-emacs#188 (comment)

Yes, I actually noticed that, and I set that back to nil. I tend to use C-M-i to trigger completion anyways.

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

No branches or pull requests

2 participants