# Refactoring support for inlining variables?

**URL:** https://discourse.julialang.org/t/refactoring-support-for-inlining-variables/132125
**Category:** General Usage
**Tags:** vscode
**Created:** [September 5, 2025, 9:31pm UTC](https://discourse.julialang.org/t/refactoring-support-for-inlining-variables/132125 "2025-09-05T21:31:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ken\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ken_williams/32/5289_2.png) [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)
#### Post date: [September 5, 2025, 9:31pm UTC](https://discourse.julialang.org/t/refactoring-support-for-inlining-variables/132125/1 "2025-09-05T21:31:45Z")

</div>

Are there any convenient solutions for an “inline this variable” refactoring, in VS Code or otherwise? It’s something I used to find really convenient in other IDEs like IntelliJ (for other languages like Python or Java in the old days), and sometimes I miss it when doing Julia.

Assuming it really doesn’t exist (and that I haven’t just overlooked it), what would be required? Something in the Language Server and then the VS Code Julia extension, I assume?

---

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [September 6, 2025, 1:11am UTC](https://discourse.julialang.org/t/refactoring-support-for-inlining-variables/132125/2 "2025-09-06T01:11:06Z")

</div>

I use the ruff linter in vscode for python code, and it reports an error for this pattern

```python
def f():
    x = g()
    return x

```

It will offer to automatically fix the error and replace it with

```python
def f():
    return g()

```

So the Julia extension can probably use the same APIs as ruff to make this kind of transformation, but it can’t do that now, as far as I’m aware.
