Skip to content
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

lsp: Auto import and import formatting on save #413

Open
norbusonam opened this issue Jan 10, 2024 · 1 comment
Open

lsp: Auto import and import formatting on save #413

norbusonam opened this issue Jan 10, 2024 · 1 comment
Labels
enhancement New feature or request lsp NeedsInvestigation Issue needs some investigation before being fixed

Comments

@norbusonam
Copy link

I have been using templ for a new project and one of the biggest pain points for me is the lack of auto imports and import formatting (like the ones existing in go's built-in formatter). I keep having to manually look up package names/paths in order to fix undefined errors. Would be great for DX if this could be integrated!

I'm open to helping implement but I have v little experience in developer tools like this.

@alehechka
Copy link
Contributor

Not quite auto-imports on save, but the LSP includes intellisense for imports that can be used to add import statements for new packages to the file. If you're using VSCode, the default would be Ctrl + Space after a package name to pull up the intellisense tooltip which should include a list of matching packages that you can arrow through to select the desired one.

@joerdav joerdav changed the title [Feature Request] Auto import and import formatting on save lsp: Auto import and import formatting on save Jan 19, 2024
@joerdav joerdav added enhancement New feature or request lsp labels Jan 19, 2024
@joerdav joerdav added the NeedsInvestigation Issue needs some investigation before being fixed label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lsp NeedsInvestigation Issue needs some investigation before being fixed
Projects
None yet
Development

No branches or pull requests

3 participants