Open morten-krogh opened 1 year ago
I'm experiencing a very similar problem, though not only scoped to JS files.
"hard_tabs": true,
in settings.json.
The Zed.log
show some instances of a unhandled notification eslint/noLibrary
info message, not sure if related.
Zed: v0.92.4 (stable) OS: macOS 13.4.1 Memory: 16 GiB Architecture: aarch64
https://github.com/zed-industries/community/assets/192261/b75e46cb-2ef0-444b-9aa8-caa9fb402549
~/Library/Logs/Zed/Zed.log
file to this issue.2023-07-03T12:30:16 [INFO] Opening main db
2023-07-03T12:30:16 [INFO] starting language server name:typescript-language-server, path:"/[Users/gabe/[…]", id:0
2023-07-03T12:30:16 [INFO] starting language server name:eslint, path:"/[Users/gabe/[…]", id:1
2023-07-03T12:30:17 [INFO] unhandled notification eslint/noLibrary:
{
"source": {
"uri": "file:///Users/gabe/[…]/monitoring/logger.ts"
}
}
2023-07-03T12:30:19 [INFO] unhandled notification $/typescriptVersion:
{
"version": "5.1.6",
"source": "user-setting"
}
2023-07-03T12:30:32 [INFO] unhandled notification eslint/noLibrary:
{
"source": {
"uri": "file:///Users/gabe/[…]/analytics/track.ts"
}
}
If this is the same as zed-industries/zed#5082, then it seems like it's the autoformatter's fault.
Has anyone found a fix or a workaround? hard_tabs
not working is a nightmare when working on git repositories that use tabs instead of spaces, because the autoformatter changes all the tabs to spaces, resulting in changes to almost every line.
Zed currently supports prettier formatting in JS files, even if the project itself does not install one, if "formatter": "auto"
(current default) or "formatter": "prettier"
is set in Zed's settings.
As a workaround, the project can install prettier (so it appears in project's node_modules
) and configure it inside the project files, or adjust "prettier"
settings with the configuration needed.
https://prettier.io/docs/en/options.html#tabs shows that "useTabs": true
config could be used.
Just to be perfectly clear. This is the same issue with rust and other languages. Any form of autocomplete will insert spaces instead of tabs even with hard_tabs = true
.
Check for existing issues
Describe the bug / provide steps to reproduce it
I want to use tabs instead of spaces in a JS file.
Setting hard_tabs: true does not seem to do anything. Either it is not working or it is difficult to understand the settings.
Environment
Zed: v0.77.3 (stable) OS: macOS 13.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.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.No response