-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
VSCode Plugin does not handle symlinks correctly #2364
Comments
The loop is because you create a symlink within the directory itself. Is there any reason why you need this? Or is this an overly simplified reproduction? |
It's a simplified reproduction. The actual project has a lot more dependencies and I'm also running more plugins with it, which makes it hard to see where the problem lies and it took me several hours to track down the cause.
The symlinks it makes are deeply nested inside the output folder for tauri and the paths look something like this: One other interesting thing to take note of is that Regardless of any bug, I'm also wondering if there is some way to tell the plugin to ignore a folder like |
Build output does make a lot more sense. Other tools probably only load the top config, or start searching from the svelte file and walk the directory tree upward. We have a unique situation where we need to load all the config in the workspace upfront. We probably could keep track of visited real paths to eliminate the infinite loop. Or maybe using the gitignore or tsconfig.json include/exclude to exclude searching directories. |
Maybe some new extension settings could work? |
closes #2397 fixes #2364 --------- Co-authored-by: Simon Holthausen <[email protected]>
Describe the bug
The plugin won't initialize when the project folder contains two or more symbolic links that point to the root of the project and as a result no svelte related features like autocompletion work.
This happens for example when using svelte in a tauri project together with the cxx library.
When the project is compiled, cxx creates multiple symbolic links that point to the project root inside the target folder, as described here.
Reproduction
The issue can be reproduced with a newly created svelte project (using the default options):
Ensure svelte vs code plugin is on, then open e.g. Counter.svelte and try using autocompletion on "display_counter." and notice how it still works as expected.
Svelte plugin output at this point:
Next create two symbolic link to the project root using powershell for example:
Afterwards restart the extension host in vscode and try autocompletion again.
It no longer works and only shows "Loading..." forever. The Svelte plugin output looks like this:
After the symbolic links are removed and the extension host is restarted, it works again.
Expected behaviour
The plugin should operate normally, regardless of any symbolic links to the project root.
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
When only one symbolic link exists in the project, The autocompletion works, but the plugin contains some very interesting output, that may explain why it fails to load:
It seems that it looks for svelte.config.js files inside any folder it can find and runs into some infinite loop when there are multiple symbolic links.
The text was updated successfully, but these errors were encountered: