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

Indentation API is inconsistent #228

Open
LeonMatthesKDAB opened this issue Nov 29, 2024 · 0 comments · May be fixed by #231
Open

Indentation API is inconsistent #228

LeonMatthesKDAB opened this issue Nov 29, 2024 · 0 comments · May be fixed by #231
Labels
⬆️ feature New feature or request 👷 refactor Something needs to change
Milestone

Comments

@LeonMatthesKDAB
Copy link
Collaborator

Currently, we have these indentation functions on TextDocument:

  1. indent (int count)
  2. string indentationAtPosition(int pos)
  3. removeIndent(int count)

The 1. and 3. are consistent, but indentationAtPosition should ideally also return an int, as then you can do things like:
"Indent this line 1 more than this other line".
That would probably require us to add a "indent-spaces" property or some such for each document, that defines how many spaces count as one indentation (or whether it's tab?)

Ideally, an API for working line-based would also be useful.
e.g.:

  1. indentLine(int line, int count)
  2. int indentationAtLine(int line)
@LeonMatthesKDAB LeonMatthesKDAB added ⬆️ feature New feature or request 👷 refactor Something needs to change labels Nov 29, 2024
@LeonMatthesKDAB LeonMatthesKDAB added this to the Release 1.0.0 milestone Nov 29, 2024
@LeonMatthesKDAB LeonMatthesKDAB linked a pull request Dec 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request 👷 refactor Something needs to change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant