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

Not seeing refactorings try to intelligently expand based on the current selection #41469

Closed
mjbvz opened this issue Nov 10, 2020 · 0 comments · Fixed by #42770
Closed

Not seeing refactorings try to intelligently expand based on the current selection #41469

mjbvz opened this issue Nov 10, 2020 · 0 comments · Fixed by #42770
Assignees
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 10, 2020

TypeScript Version: 4.2.0-dev.20201109

Search Terms:

  • refactor / refactoring
  • discoverability

Repro
From #37895

  1. With a JS file:
const a = document.createElement('a')
  1. Select ent.createElement('a')
  2. Explicitly trigger refactorings (you can use the right click menu in VS Code to do this)

Expected
Based on the discussions in #37895, I'd expect this to return an extract function refactoring that extracts the entire document.createElement('a') expression to a function

Actual
No such refactoring returned. I confirmed that we tell TS that this refactoring was explicitly requested:

[Trace  - 03:33:16.867] <semantic> Sending request: getApplicableRefactors (92). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/san/b.js",
    "startLine": 1,
    "startOffset": 12,
    "endLine": 1,
    "endOffset": 38,
    "triggerReason": "invoked"
}

/cc @jessetrinity

@jessetrinity jessetrinity added this to the TypeScript 4.2.0 milestone Nov 10, 2020
@jessetrinity jessetrinity added Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol labels Nov 10, 2020
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants