question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-English file names cause the debugger to choke

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kitsonkcommented, 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.

1reaction
kitsonkcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Non english file names saved in server shows as?
When i upload non english files from an application deployed in portal server .After the file is saved .The file name changes to...
Read more >
Build & Debug - Sparx Systems
Output. Specifies the full name of the local log file to be written. The folder must exist or no log will be created....
Read more >
Fix Common Runtime Errors in Java With Careful Debugging
If the JVM is choking, it may kick out a runtime error despite the lack of a deficiency in the program's codebase. A...
Read more >
find and rsync both choke on oddly named file
This doesn't explain the "No such file or directory" — by all means, ... in file names" which might be the root cause...
Read more >
Program corrections for the IAR Embedded Workbench
The source browser no longer generates empty .i files in the object directory, ... Enabling the Function Profiler under a debug session can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found