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

.svelte typescript definitions not updating live #4598

Closed
1 task done
MatthiasGrandl opened this issue Jul 24, 2023 · 5 comments
Closed
1 task done

.svelte typescript definitions not updating live #4598

MatthiasGrandl opened this issue Jul 24, 2023 · 5 comments
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors stale Label used by `stale` action svelte Svelte framework support

Comments

@MatthiasGrandl
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Just tried out the preview channel for the Svelte support. So far things are working mostly fine, however when I add a new export to an existing file and then try to import this new export in an open .svelte file, it says "file has no exported members.

To reproduce:

Create 2 files:

// exports.ts
export const foo = "foo";
<script lang="ts">
// test.svelte
import { foo } from "./export.ts"
</script>

save the files and keep the buffers open. Then add another export to exports.ts

export const bar = "bar";

Now when you try to add the import for bar in test.svelte you will see the error: Module './export.ts' has no exported member 'bar'.

Environment

Zed: v0.96.2 (preview)
OS: macOS 13.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

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

@MatthiasGrandl MatthiasGrandl added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jul 24, 2023
@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors svelte Svelte framework support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 26, 2023
@chrisbrown-io
Copy link

chrisbrown-io commented Jul 27, 2023

Encountering the same issue using 0.96.2.

After a bit of preliminary digging, this seems like a problem within the svelte-language-server itself (sveltejs/language-tools#550).

It seems as though the svelte-vscode plugin that uses the language server has an additional option to allow loading the plugin, which supposedly fixes this.

I tried fiddling around with the Zed lsp settings to see if I could load the plugin, but to no avail.

The following is my hypothesis, although the lsp side of things is far outside my expertise, so I am prepared to be told otherwise:

As svelte files use the svelte-language-server instead of the typescript-language-server in Zed, you can't make use of the plugins option within the ts language server and it doesn't seem as though the svelte one exposes any similar initialisation option that could be hooked into through Zed?

@chrisbrown-io
Copy link

chrisbrown-io commented Jul 27, 2023

Further to the above, it seems as though svelte-language-server might support passing typescript language server configuration/options, that could presumably be passed via the "lsp" setting in Zed?

The language server also accepts configuration for Emmet (key: emmet; settings reference), Prettier (key: prettier), CSS (key: css / less / scss; settings reference) and TypeScript (keys: javascript and typescript for JS/TS config; settings reference).

After a few different attempts/configrations though, I still can't get it to load the plugin.

These lines in the svelte-language-server seem most of interest:
https://github.com/sveltejs/language-tools/blob/master/packages/language-server/src/server.ts#L130

@mikayla-maki
Copy link
Contributor

mikayla-maki commented Jul 27, 2023

Thanks for the links @chrisbrown-io. Unfortunately, it looks like all of the behavior you're referencing is implemented at the VSCode plugin level, instead of in either of the relevant LSPs. We currently don't have the bandwidth to implement these kinds of cross-language one-off patches so it might be a bit before we can get to this :)

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
Copy link

Hi there! 👋
We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in a week. Feel free to open a new issue if you're seeing this message after the issue has been closed.
Thanks for your help!

@github-actions github-actions bot added the stale Label used by `stale` action label Sep 24, 2024
Copy link

github-actions bot commented Oct 8, 2024

This issue was closed due to inactivity; feel free to open a new issue if you're still experiencing this problem!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors stale Label used by `stale` action svelte Svelte framework support
Projects
None yet
Development

No branches or pull requests

4 participants