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.

Inline local refactoring

See original GitHub issue

Proposal Add a refactoring to inline a local variable. Example:

function generatePipeName(): string {
	const hexString = makeRandomHexString(40);
	return getPipeName(hexString);
}

The Inline local refactoring on hexString would result in:

function generatePipeName(): string {
	return getPipeName(makeRandomHexString(40));
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:75
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
OliverJAshcommented, Aug 28, 2020

Anyone suggest a VSCode extension that does this in lieu of waiting for official support?

https://github.com/nicoespeon/abracadabra#inline-variable

1reaction
jackriccommented, Jul 7, 2020

Anyone suggest a VSCode extension that does this in lieu of waiting for official support?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline Temp - Refactoring.Guru
Inline local variables are almost always used as part of Replace Temp with Query ... This refactoring technique offers almost no benefit in...
Read more >
Inline | IntelliJ IDEA Documentation - JetBrains
The Inline refactoring lets you reverse the Extract refactoring for a method , constructor, parameter, superclass, anonymous class, ...
Read more >
Inline function refactoring #27070 - microsoft/TypeScript - GitHub
The inline refactoring is very complicated to implement though. Local variables might need to be renamed to prevent accidental shadowing and pattern ...
Read more >
Inline a temporary variable refactoring - Visual Studio
How-to · Highlight or place the text cursor inside the temporary variable to be inlined: C#:. Highlighted code - C# · Next, do...
Read more >
Refactoring source code in Visual Studio Code
Refactoring support for other programming languages is provided through VS Code extensions that contribute language services. The UI and commands for ...
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