News for hackers. Stuff that matters.
Re:The TypeScript compiler is now implemented internally wit... by mathstuf on Wednesday November 02, 2022 @09:07PM (#33445305)
While that may be true, "spaces for alignment" is nigh unsupported by all editors I've seen. They insist on replacing 8 (or N) spaces with tab even if in an alignment region.

int foobar(int a,

___________int b) // should only ever have spaces (using _ here because HTML)

But good luck finding an editor that won't insert a tab when you use the tab key here (willing to be wrong).

The other issue I have is that diffs break alignment between undented code and anything with tabs because the tabs "eat" the leading space, but unindented lines are offset by one.

Re:The TypeScript compiler is now implemented internally wit... by CoastalCoder on Wednesday November 02, 2022 @09:13PM (#33445377)
I'm curious what editors you've experienced that with.

I've had some editors that made tab-space conversion an option, but it was never mandatory.

Re:The TypeScript compiler is now implemented internally wit... by mathstuf on Thursday November 03, 2022 @05:44PM (#33458176)
When I'm working in Git, Go, or Linux code, Vim (and NeoVim) uses `expandtab` in conjunction with `softtabstop` and converts any `tabstop` spaces into a tab (with `noexpandtab`) regardless of whether or not it is "alignment".

I've not done lots of development with other editors, but Kate didn't do it and the few times I used Visual Studio, it also had similar behaviors (I'm assuming VSCode inherited that stuff).

Re:The TypeScript compiler is now implemented internally wit... by charsi on Wednesday November 02, 2022 @10:30PM (#33446172)
With a .editorconfig[1] file with the correct configs you can get most code editors to insert spaces instead of tabs.

[1] https://editorconfig.org/

Re:The TypeScript compiler is now implemented internally wit... by mathstuf on Wednesday November 09, 2022 @09:17AM (#33531883)
What configuration is necessary for editors to insert spaces in code like this:

https://lore.kernel.org/keyrings/20221109025019.1855-2-linux...

If HN mangles the link, it is the addition of the `key_create` function in this thread: https://lore.kernel.org/keyrings/20221109025019.1855-2-linux...

Re:The TypeScript compiler is now implemented internally wit... by bobbylarrybobby on Thursday November 03, 2022 @12:54AM (#33447173)
Rustfmt, for one, understands how to mix tabs and spaces on the same line. I think the complication is overstated.
Re:The TypeScript compiler is now implemented internally wit... by philliphaydon on Thursday November 03, 2022 @07:07AM (#33449369)
All JetBrains editors will put spaces.