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

Sveltekit internal paths import suggestions #11607

Closed
PatrickG opened this issue Jan 11, 2024 · 2 comments · Fixed by #11620
Closed

Sveltekit internal paths import suggestions #11607

PatrickG opened this issue Jan 11, 2024 · 2 comments · Fixed by #11620

Comments

@PatrickG
Copy link
Member

Describe the bug

When using ctrl+space to auto import a variable, sveltekit internal paths are suggested.
e.g. base from $app/paths or building from $app/environment

Reproduction

grafik

Expected behaviour

Hide paths starting with __sveltekit/

System Info

  • OS: Linux
  • IDE: VSCode
  • Svelte: 5.0.0-next.33
  • Sveltekit: 2.3.0

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

No response

@PatrickG PatrickG added the bug Something isn't working label Jan 11, 2024
@dummdidumm dummdidumm transferred this issue from sveltejs/language-tools Jan 11, 2024
@dummdidumm dummdidumm added types / typescript and removed bug Something isn't working labels Jan 11, 2024
@dummdidumm
Copy link
Member

I think the better solution is to fix this inside SvelteKit itself and change the imports/exports such that the internal module declarations don't end up in the bundled types.

@Rich-Harris
Copy link
Member

Any thoughts on how we could do that? Would love to fix this, it's annoying

dummdidumm added a commit that referenced this issue Jan 12, 2024
Takes advantage of the fact that dts-buddy doesn't detect the ambient-private.d.ts module declarations (which arguably is a bit weird and could result in buggy behavior, but we can use it to our advantage here).

fixes #11607
Rich-Harris added a commit that referenced this issue Jan 12, 2024
…11620)

* fix: remove internal `__sveltekit/` module declarations from types

Takes advantage of the fact that dts-buddy doesn't detect the ambient-private.d.ts module declarations (which arguably is a bit weird and could result in buggy behavior, but we can use it to our advantage here).

fixes #11607

* lint

* re-export values from internal modules

* move files

* point dts-buddy at facade .d.ts files

* remove some junk we no longer need

---------

Co-authored-by: Rich Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants