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

Interactive Playground Refactoring via Extraction does not work #51575

Closed
TclasenITVT opened this issue Jun 11, 2018 · 7 comments
Closed

Interactive Playground Refactoring via Extraction does not work #51575

TclasenITVT opened this issue Jun 11, 2018 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities typescript Typescript support issues verified Verification succeeded workbench-welcome Welcome page issues
Milestone

Comments

@TclasenITVT
Copy link

  • Version 1.24.0
  • Commit 6a6e02c
  • Datum 2018-06-06T17:35:40.560Z
  • Shell 1.7.12
  • Renderer 58.0.3029.110
  • Node 7.9.0
  • Architektur x64
  • OS Version: Microsoft Windows 10 Enterprise 10.0.15063

Steps to Reproduce:

  1. Open Interactive Playground
  2. Scroll down to the Refactoring via Extraction example (All Examples before this one worked)
  3. Select rows 3 to 5
  4. Press CRTL+. shows "no codeactions available"(translated from german text: 'keine Codeaktionen verfügbar')
  5. Press right mouse button select refactorings -> no refactorings available

Does this issue occur when all extensions are disabled?: Yes

@chrmarti chrmarti added this to the June 2018 milestone Jun 11, 2018
@chrmarti chrmarti removed this from the June 2018 milestone Jun 27, 2018
@chrmarti chrmarti assigned mjbvz and unassigned chrmarti Jun 27, 2018
@chrmarti
Copy link
Contributor

This might be a limitation of what the TypeScript service offers for extraction.

@chrmarti chrmarti added the typescript Typescript support issues label Jun 27, 2018
@TclasenITVT
Copy link
Author

Then you should change the example code to work around the limitation or just throw this example out of the interactive playground? I just used the extraction feature with js yesterday. Extracting into a global function, that worked fine.

@mjbvz mjbvz added the workbench-welcome Welcome page issues label Jul 19, 2018
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Sep 18, 2018
@ghost
Copy link

ghost commented Oct 14, 2018

Same issue here on OS X 1.28.1 with all extensions disabled. The Interactive Playground example states:

Refactoring via Extraction
Sometimes you want to refactor already written code into a separate function or constant to reuse it later. Select the lines you want to refactor out and press ⌘. or click the little light bulb and choose one of the respective Extract to... options. Try it by selecting the code inside the if-clause on line 3 or any other common code you want to refactor out.

Selecting typeof el === 'number' && el % 2 === 0 indeed presents the "lightbulb" and ⌘. brings context menu to Extract to inner function, global space or constant. None of the 3 options produce a result.

@mjbvz mjbvz added the help wanted Issues identified as good community contribution opportunities label Dec 15, 2018
@jsejcksn
Copy link

jsejcksn commented Feb 6, 2019

This is quite important for onboarding, yes?

I'm here because I experienced the same behavior described in #55101. My output:

[renderer1] [error] Error: Failed to create file walkThroughSnippet:/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md#4.js
    at new t (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1474:150)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3446:577
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

@kdkd
Copy link

kdkd commented Mar 30, 2019

This is still occurring in 1.32.3 on MacOS, but the error has slightly changed:

ERR m: Failed to create file walkThroughSnippet:/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md#4.js
    at t.scheme.l.Schemas.file._withProvider.then.then.then.e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3300:573)
    at process._tickCallback (internal/process/next_tick.js:68:7)

@themotu
Copy link

themotu commented Apr 11, 2019

Occurs in latest insiders version also

@mjbvz mjbvz added this to the August 2019 milestone Aug 22, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Aug 22, 2019

I'm just going to remove this section from the interactive playground. Our normal documentation covers refactoring in much more detail. I don't think fixing the interactive playground for this case would be simple and we should not highlight a feature that doesn't work properly

@mjbvz mjbvz closed this as completed in c09ef1a Aug 22, 2019
@RMacfarlane RMacfarlane added the verified Verification succeeded label Aug 28, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities typescript Typescript support issues verified Verification succeeded workbench-welcome Welcome page issues
Projects
None yet
Development

No branches or pull requests

7 participants