-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
JS/TS always use absolute import paths #6115
Comments
I'm not sure this is something Zed can address. Zed delegates most language-specific features to the specific language server. For JavaScript/TypeScript, it's typescript-language-server. Perhaps you could tweak it to your liking by adjusting |
@posthardcode did you find a solution to your problem? |
@hovsater I did face the same problem, which in other IDEs e.g. VSCode setting the property you mentioned to "lsp": {
"typescript-language-server": {
"initialization_options": {
"preferences": {
"importModuleSpecifier": "relative"
}
}
}
} on my |
@reloadedhead I'm pretty sure the key must be |
@hovsater Indeed, my bad. Caffeine levels were low 😅 can confirm it works like a charm! Extremely happy with Zed :) |
For posterity, to get this working, you need to provide a configuration like this: {
"lsp": {
"vtsls": {
"settings": {
"typescript": {
"preferences": {
"importModuleSpecifier": "non-relative"
}
}
}
}
}
} |
Check for existing issues
Describe the feature
For JavaScript/TypeScript files, Zed currently automatically adds an import when typing a variable name and pressing tab - which is awesome.
It also seems to respect
tsconfig
and use absolute import paths - but not always. If the module to be imported is at the same level, or a level above, relative paths are used.Is there a way to force absolute paths to always be used? If not, is this on your roadmap?
Thanks!
If applicable, add mockups / screenshots to help present your vision of the feature
No response
The text was updated successfully, but these errors were encountered: