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

Non-English file names cause the debugger to choke #517

Closed
TradeIdeasPhilip opened this issue Sep 10, 2021 · 5 comments · Fixed by denoland/deno#22582
Closed

Non-English file names cause the debugger to choke #517

TradeIdeasPhilip opened this issue Sep 10, 2021 · 5 comments · Fixed by denoland/deno#22582
Labels

Comments

@TradeIdeasPhilip
Copy link

Describe the bug

If I create a TypeScript file will non-English characters in the filename, the debugger gets confused. As does Intellisense.

I'm pretty sure this is a new problem. I've been using some of these file names for a while.

To Reproduce

debugger

  1. Create a file with a name like ¡Feliz cumpleaños!.ts or ⛔message-from-server.ts.
  2. Try to set a breakpoint in this file.
  3. Initially (before you try to run) the breakpoint will appear as it should.
  4. Run the program.
  5. The breakpoint will disappear.
  6. Try to set the breakpoint again, now that the program is running.
  7. It will disappear immediately
  8. Set a breakpoint somewhere else, and step through your file.
  9. When you get to this file, the debugger will show you the compiled version of the code, e.g. without the TypeScript annotations or the comments.
  10. You can set a breakpoint in the compiled file and that will work.
  11. As soon as you stop running the compiled file will disappear, so you can't easily access it again.

intellisense

  1. Create a file with a name like ¡Feliz cumpleaños!.ts or ⛔message-from-server.ts.
  2. In a different file, reference an item that is exported from the file with the non-English characters in the name.
  3. Intellisense will suggest adding an import. Accept its suggestion.
  4. The line it creates will quote all of the non-English characters like this: import { celebrate1 } from "./%C2%A1Feliz%20cumplea%C3%B1os!.ts";
  5. You can keep that ugly file name with the URL-style quotes or you can change it to the easy to read format. It doesn't make a difference.
  6. Either way the program will run fine.
  7. Either way the debugger will act up like described above.

Expected behavior

VS Code should allow you to use most characters in file names. (Like the TypeScript compiler and the JavaScript runtime.)

The debugger should work like normal. I should be able to set breakpoints in any file. I should be able to see my comments and my TypeScript annotations while I'm stepping though my code.

The suggested line should not try to quote the file name. It's already in double quotes, so you don't need the URL quoting on top of that.

Note that the file export it adds includes the .ts file extension. So I know the Deno extension is involved. Without the Deno extension VS code would remove the file extension before trying to add the import.

Screenshots

Create a file with non-English characters in the file name:
Screenshot (320)

Reference this file from another file. Notice the intellisense recommendation:
Screenshot (319)

Try to set a breakpoint on line 4 of the file:
image

When you step through the code you'll see the the compiled version of the code. Notice that line 4 of the compiled file has a breakpoint, but it does not correspond to line 4 of the source file:
image

Versions

vscode: 1.60.0 deno: xxx extension: v3.8.1

Version: 1.60.0 (user setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

I noticed this shortly after VS Code updated itself. I know VS Code did an update because of an unrelated bug. The Deno extension updates itself automatically, so I don't know if that's new or not.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 10, 2021

Could you provide the output of View | Output and then select Deno Language Server?

@kitsonk kitsonk added bug Something isn't working needs investigation labels Sep 10, 2021
@TradeIdeasPhilip
Copy link
Author

Starting Deno language server...
version: 1.13.2 (release, x86_64-pc-windows-msvc)
executable: C:\Users\Philip Smolen.deno\bin\deno.EXE
Connected to "Visual Studio Code" 1.60.0
Enabling import suggestions for: https://deno.land
language server initialized
Server ready.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 11, 2021

Thank you. It is a bug, I don't think we anticipated it. There are two underlying issues, the debugger and the code actions (the import suggestion). Like there are other issues. We need to deal with some URLs that contain URL encoded characters.

@TradeIdeasPhilip
Copy link
Author

I saw an update to the other bug report I referenced. microsoft/vscode#132150 (comment)

❝I left for vacation and came back to my entire JavaScript debugging setup being borked beyond use. Not only is it opening PowerShell for debug sessions with "integratedTerminal" option, but it is now hitting breakpoints on a new tab to my (already opened) source file in read-only mode. What a mess.❞

The part in bold sounds similar to one of the problems that I mentioned in this bug report. It's hard for me to say if the VS Code bug is responsible for the problem I described, or if it's the Deno extension.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 14, 2021

The intellisense/suggestions/hover/code actions are a seperate issue than the debugging problems, and I have opened denoland/deno#12065 to address that.

@kitsonk kitsonk changed the title Non-English file names cause the debugger to choke and confuses Intellisense. Non-English file names cause the debugger to choke Sep 14, 2021
@bartlomieju bartlomieju added the dx label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants