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

Restart TS server #6

Open
Tobbe opened this issue Jun 23, 2024 · 1 comment
Open

Restart TS server #6

Tobbe opened this issue Jun 23, 2024 · 1 comment

Comments

@Tobbe
Copy link
Member

Tobbe commented Jun 23, 2024

VS code seems to not pick up on imports like src/utils/cn after adding a component.
Restarting the TS server seems to help.
It'd be cool if we could do that automatically after running the rwgc script.

Plan for this right now:

  1. Write a VSCode extension that triggers await vscode.commands.executeCommand("typescript.restartTsServer");
  2. Install the extension by running something like code --install-extension my-extension.name during setup
  3. Figure out a way to communicating with the extensions. Maybe by spinning up an http server. OR we could have it watch for newly added files in web/src/components/ui and automatically restart
  4. Have it trigger typescript.restartTsServer when new components are added (also see above)

References:

  1. https://github.com/qcz/vscode-restart-ts-server-button/blob/master/src/extension.ts#L41C2-L41C69
  2. https://github.com/neotan/vscode-auto-restart-typescript-eslint-servers/blob/master/src/extension.ts
@pantheredeye
Copy link

Sometimes when adding a component, I get this error:

Already included file name 'c:/Users/bburnworth/Documents/Code/swpppGood/web/src/components/ui/Toast.tsx' differs from file name 'c:/Users/bburnworth/Documents/Code/swpppGood/web/src/components/ui/toast.tsx' only in casing.
  The file is in the program because:
    Imported via "src/components/ui/Toast" from file 'c:/Users/bburnworth/Documents/Code/swpppGood/web/src/layouts/AuthenticatedLayout/AuthenticatedLayout.tsx'
    Matched by include pattern 'src' in 'c:/Users/bburnworth/Documents/Code/swpppGood/web/tsconfig.json'

which is weird because the file is actually uppercase. I restarted the TS server and it picked everything up correctly.

I'm not sure where to put this so I stuck it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants