-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Newline indentation does not follow my tab size setting (in a svelte file) #6861
Comments
I'm also having this problem, really strange |
This is still a bug, but here is a workaround for now. Use |
It is possible to change this option inside of the svelte extension code by adding this inside the fn language_server_workspace_configuration(
&mut self,
_language_server_id: &zed_extension_api::LanguageServerId,
_worktree: &zed_extension_api::Worktree,
) -> Result<Option<serde_json::Value>> {
Ok(Some(serde_json::json!({
"prettier": {
"useTabs": true,
"tabWidth": 4,
}
})))
} But it seems like extensions can't currently access user preference for formatting options. I think it's something the extensions should have access to. |
I have the same issue editing PHP files. The first tab is always 2 spaces, then subsequent tabs are 4. So I have to hit tab, tab, and then backspace twice to get my desired indentation. I've already tried setting "tab_width" in my settings and I'm set to use spaces instead of tabs. Zed is unusable until this is fixed. |
Check for existing issues
Describe the bug / provide steps to reproduce it
In a .svelte file with a typescript script block, Zed doesn't appear to be respecting my tab size setting. I have tab_size set at the root of my settings.json to 4.
Environment
Zed: v0.119.20 (Zed)
OS: macOS 13.6.1
Memory: 32 GiB
Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
In these two screenshots, I have a basic
![Screenshot 2024-01-27 at 7 30 01 AM](https://private-user-images.githubusercontent.com/95944177/300180908-ace24538-7da4-47c0-9a4e-d92596e61804.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzQzNDksIm5iZiI6MTczODk3NDA0OSwicGF0aCI6Ii85NTk0NDE3Ny8zMDAxODA5MDgtYWNlMjQ1MzgtN2RhNC00N2MwLTlhNGUtZDkyNTk2ZTYxODA0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAwMjA0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4NzQzMmIwNzgwZTAxYTE3MTU2ZTgxNmU0NmFlMTcxYzJhNjY1OTEwNWRlNjNiMmQyYWMzNzhjM2ZjN2Q0NzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nuoBW5KrVxNDXUG6MC0LR8cYCMj6kRth3iMnvPY7jWQ)
![Screenshot 2024-01-27 at 7 30 12 AM](https://private-user-images.githubusercontent.com/95944177/300180931-45779d2d-6d58-46d8-98a2-8642cee9c0eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzQzNDksIm5iZiI6MTczODk3NDA0OSwicGF0aCI6Ii85NTk0NDE3Ny8zMDAxODA5MzEtNDU3NzlkMmQtNmQ1OC00NmQ4LTk4YTItODY0MmNlZTljMGViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAwMjA0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViYWRhYWE1NDg2OTExZDkyY2EwZDhjY2MwMmQwYjI5NDViMTczNjZkMGQ4ZjNmMzMyMTQyMGZhZDJkOTk0ZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bhst2YM2Q3jhs1W8Ohu5pyn-mQCq-dzs435SdMAb3Uk)
if
block. I've hit enter to go to the first line inside the block and hit tab 1 time. Zed seems to indent 2 spaces instead of my setting of 4.This is what it looks like if I hit enter and hit space 4 times:
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
The text was updated successfully, but these errors were encountered: