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

Surprising autocomplete with string literal #17056

Closed
danvk opened this issue Dec 11, 2022 · 2 comments · Fixed by #17225
Closed

Surprising autocomplete with string literal #17056

danvk opened this issue Dec 11, 2022 · 2 comments · Fixed by #17225
Assignees
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@danvk
Copy link
Contributor

danvk commented Dec 11, 2022

Describe the bug

I was working on this Advent of Code problem and had an odd bug where I printed #. instead of . which gave me a wrong answer. Oh well, probably fat fingered it.

For part two of the problem, I spent quite a while debugging my incorrect solution before eventually realizing I'd made the exact same mistake a second time. Now I was suspicious. It turns out it was the VSCode Deno extension's fault. It was quietly changing '.' to '#.' as I typed the former. That string ('#.') never appears on its own elsewhere in my code, only as a substring of larger strings:

Screen.Recording.2022-12-10.at.11.01.05.AM.mov

To Reproduce

  1. Open up this file in VS Code https://github.com/danvk/aoc2022/blob/49917882eb0f2b64f407857eab052c1f674e3551/warmup/y2018day12/y2018day12.ts#L32
  2. Rewrite the '.' by typing ' then . then ' as in the video
  3. Scratch your head as the Deno extension changes the string to '#.'.

The surprising change happens when I type the . character.

Expected behavior

When I type '.', I would expect to get that string in my source code, rather than a different string.

For comparison, the TypeScript playground does exactly what I expect with this same source code.

Screenshots

Here's the video again, where I type ' then . then ':

Screen.Recording.2022-12-10.at.11.01.05.AM.mov

Versions

  • vscode: 1.72.1
  • deno: deno 1.28.3 (release, aarch64-apple-darwin) / v8 10.9.194.5 / typescript 4.8.3
  • extension: v3.14.1
@dsherret dsherret transferred this issue from denoland/vscode_deno Dec 15, 2022
@dsherret dsherret added bug Something isn't working correctly lsp related to the language server labels Dec 15, 2022
@dsherret
Copy link
Member

Thanks for reporting these issues, Dan. The language server has some rough edges (especially related to node compatibility). We're planning on prioritizing fixes for it in the new year.

@bartlomieju
Copy link
Member

I'm working on a fix for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly lsp related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants