-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Typescript Language Server Error on "Move to File" in Svelte Project #2222
Comments
This comment has been minimized.
This comment has been minimized.
That was my thought as well. Who owns the upstream TypeScript language server? Is it VSCode maintainers or someone else |
Typescript team https://github.com/microsoft/TypeScript |
I'd like to be able to use this built-in refactor -- what would the fix look like? Some wild guesses:
|
Sorry, I jumped to the conclusion too fast. I didn't realise it only happens in "move to file" and not "move to new files", so I thought I reproduced with an import that ends with .js. This is not related to the js ending thing I mentioned. It is a new issue. It just used the same utility function that caused the previous problem. Looking at the typescript source code, we might be able to work around It, but I'll have to see if the workaround is too hacky and might cause other problems. |
I had this issue when using a more common |
@jasonlyu123 did you ever open an issue at the TypeScript repo asking for this assertion to be removed? |
Yes. microsoft/TypeScript#56749 The refactor source of the feature has also been limited from an arbitrary amount of code to a named block of code. So it probably doesn't make much sense for html-liked files or CSS modules to be a "move to" target anyway. Making TS filter out unknown files should be fine. |
Describe the bug
The new VSCode
Move to file
refactor throws an error in a Svelte project that has*.svelte
component files.Reproduction
src/lib/Component.svelte
+page.svelte file
.ts
file, find a function, and attempt toRefactor > Move to File
Expected behaviour
Ideally, be able to use the
Move to File
refactor to move files between any combination of.ts
and.svelte
files. At the very least, be able to us it to move files between two.ts
files without error.System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
Moved from microsoft/vscode#199785
The text was updated successfully, but these errors were encountered: