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

Add "Inline variable" refactoring #90572

Closed
DanielSWolf opened this issue Feb 13, 2020 · 3 comments
Closed

Add "Inline variable" refactoring #90572

DanielSWolf opened this issue Feb 13, 2020 · 3 comments
Assignees

Comments

@DanielSWolf
Copy link

VSCode offers several "Extract to constant" refactorings that move a literal value into a constant. I often need the reverse operation: inlining a value that is currently defined in a constant.

Here are some examples.

// Before:
function add(a: number, b: number) {
  const result = a + b;
  return result;
}

// After inlining `result`:
function add(a: number, b: number) {
  return a + b;
}
// Before:
const message = 'Processing successful.';
console.log(message);

// After inlining `message`:
console.log('Processing successful.');

For reference, here is the documentation of that feature in ReSharper.

@JacksonKearl JacksonKearl assigned mjbvz and unassigned mjbvz Feb 13, 2020
@JacksonKearl
Copy link
Contributor

Please file a request on TypeScript: https://github.com/microsoft/TypeScript/

@DanielSWolf
Copy link
Author

@JacksonKearl Thank you for your fast reply! I'm a bit confused, though. It is my understanding that the code for "Extract to constant" is part of this repository, not TypeScript. Am I missing something?

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 13, 2020

Duplicate of microsoft/TypeScript#18459

@mjbvz mjbvz marked this as a duplicate of microsoft/TypeScript#18459 Feb 13, 2020
@mjbvz mjbvz self-assigned this Feb 13, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants