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.

VS Code variable renaming doesn't work in *new* workspaces when Deno plugin is enabled

See original GitHub issue

Describe the bug VS Code’s F2/Ctrl+Shift+R rename for variables doesn’t work in new workspaces when the Deno plugin is enabled. It works fine in TypeScript projects where I haven’t enabled the Deno plugin.

To Reproduce

  1. Create a new folder and open it in VS Code
  2. Initialize the Deno plugin for the workspace
  3. Create a new TypeScript file
  4. Type some code, e.g. const tmp = 5;
  5. Put the cursor on tmp
  6. Hit F2 (or use Refactor -> rename from the right-click context menu)
  7. Type in the new name

Expected behavior The variable and all occurrences of the variable are renamed (this is what happens in projects where the Deno plugin hasn’t been enabled).

Actual behavior Nothing happens.

Screenshots I can provide them, if needed.

Versions Deno plugin version: v3.9.2

VS Code versions:

Version: 1.63.2 (system setup) Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2021-12-15T09:40:02.816Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19042

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:8

github_iconTop GitHub Comments

2reactions
chmaccommented, Mar 13, 2022

I’m experiencing similar issues. When I export a const from one file, renaming in that file wouldn’t work, but renaming from another file did successfully rename all instances, and after having done that, renaming in the original file now works. I also tried enabling / disabling the settings @jdelarubia shared above, can’t say if this had an impact. Seems like an intermittent bug which will likely be hard to track down.

2reactions
jaredkrinkecommented, Dec 27, 2021

@outloudvi figured out that this happens when you open a new workspace and initialize it for Deno the first time. Updated title and steps to reflect this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio code - How to rename a workspace in vscode?
1. You should probably go to File --> Close Workspace first, and then use your file explorer to rename the workspace file, and...
Read more >
Using Visual Studio Code | Manual
In the panel the setting is Deno: Enable and when manually editing the JSON, the setting is deno. enable . ⚠️ vscode has...
Read more >
VS Code API | Visual Studio Code Extension API
A workspace is the collection of one or more folders that are opened in an editor window (instance). It is also possible to...
Read more >
Language Server Extension Guide - Visual Studio Code
Note: If your extension is compatible with VS Code versions prior to 1.74.0, ... when the `workspace/configuration` request is not supported by the...
Read more >
August 2022 - Visual Studio Code
File rename selection - Pressing F2 selects filename, whole name, or file extension. New Code Action UI - Quickly find the Code Action...
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