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

Hard-tab support #105

Closed
Xophmeister opened this issue Nov 29, 2022 · 3 comments · Fixed by #376
Closed

Hard-tab support #105

Xophmeister opened this issue Nov 29, 2022 · 3 comments · Fixed by #376
Labels
P3 minor: not priorized type: feature request

Comments

@Xophmeister
Copy link
Member

At the risk of starting a Holy War, (#indent-level! 4) implies soft-tabs; i.e., a number of spaces. Some people prefer hard-tabs (i.e., a single \t at each indentation level) and some codebases -- misguided though they may be -- expect them per their style guide.

I propose updating the format of this directive such that its parameter is either:

  • A digit, representing the number of spaces in a soft-tab (as now);
  • Or a t, say, representing hard-tab indentation.
@Xophmeister Xophmeister added P3 minor: not priorized type: feature request labels Nov 29, 2022
@aspiwack
Copy link
Member

Why not.

It isn't something that is needed for the first release. But when that's done, it will be something to consider.

@figsoda
Copy link
Contributor

figsoda commented Dec 2, 2022

What if we rename it to #indent! and accept arbitrary strings, the word level doesn't make as much sense to me with tabs

we can also rely on the general_predicates instead of regex for parsing queries

a little off-topic but maybe there can also be a placeholder language only for query parsing, and we can have a format for some sort of "header node" like this:

((#language! rust) (#indent! "\t"))
; ...

@haikyuu
Copy link

haikyuu commented Mar 13, 2023

More than a preference, some languages actually require using tabs. i.e imba.
I'm actually working on its tree-sitter grammar and I want to use topiary at some point to format imba code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 minor: not priorized type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants