zed icon indicating copy to clipboard operation
zed copied to clipboard

why TypeScript tab_size 2

Open 0x2CA opened this issue 1 year ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Why does TypeScript have a tab size of 2 without any settings?

default image

no in languages image

I don't know if it's a misunderstanding, I didn't set it separately in the language, the default is 4, it should be 4.

Of course the active add setting is working, just a quibble image

Environment

Zed: v0.135.1 (Zed Preview) OS: macOS 14.2.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

0x2CA avatar May 11 '24 04:05 0x2CA

I seem to recall that the Typescript LSP tab_size is set to 2 by default.

Moshyfawn avatar May 11 '24 17:05 Moshyfawn

These settings include User Settings, Default Settings, Project Settings, and the lsp settings within these settings, as well as the lsp Default Settings and the EditorConfig file, or any other lsp settings file. Who should tab_size listen to, that overrides that? What is their priority? As it is now I think tab_size=4 in the settings should work unless it's set separately for lsp.

0x2CA avatar May 12 '24 05:05 0x2CA

It's set at the language level: https://github.com/zed-industries/zed/blob/2e8197ce6efb689c17980dee00fec0c7f93f223b/crates/languages/src/typescript/config.toml#L18

maxdeviant avatar May 13 '24 16:05 maxdeviant

In the setup there are languages and language_overrides and language_servers and lsp I can't tell the difference.

0x2CA avatar May 17 '24 09:05 0x2CA

In the setup there are languages and language_overrides and language_servers and lsp I can't tell the difference.

languages and language_overrides are the same; one is just an alias for the other.

language_servers is a setting that controls which language servers should run for a given language (and the order in which they should run, if using multiple). Typically this is set for an individual language.

The lsp setting is used to pass options to a particular language server, like initialization_options. Again, this is generally configured for a particular language.

maxdeviant avatar May 17 '24 14:05 maxdeviant