# The VS Code debugger always gets stuck at the quadratic constraint definition of a JuMP model

**URL:** <https://discourse.julialang.org/t/the-vs-code-debugger-always-gets-stuck-at-the-quadratic-constraint-definition-of-a-jump-model/114285>\
**Category:** VS Code\
**Tags:** question, jump, debug, debugger\
**Created:** [May 15, 2024, 7:11am UTC](https://discourse.julialang.org/t/the-vs-code-debugger-always-gets-stuck-at-the-quadratic-constraint-definition-of-a-jump-model/114285 "2024-05-15T07:11:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [May 15, 2024, 7:11am UTC](https://discourse.julialang.org/t/the-vs-code-debugger-always-gets-stuck-at-the-quadratic-constraint-definition-of-a-jump-model/114285/1 "2024-05-15T07:11:44Z")

</div>

The VS Code debugger always gets stuck at the quadratic constraint definition of a `JuMP` model. Please launch the debugger to run the following code in the VS Code in an environment where `JuMP.jl` is installed:

```julia
using Pkg
Pkg.activate(".")

using JuMP
model = Model()
N = 300
P = rand(N, N)
@variable(model, x[1:N])
@constraint(model, con, x' * P * x >= 0) # The debugger will get stuck at here
println("Over")

```

What’s the reason? And, how do you debug in VS Code?

P.S. If `N = 3`, it will not get stuck. But `300` is not too large since one can run the code very fast without launching the debugger.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [May 15, 2024, 9:07am UTC](https://discourse.julialang.org/t/the-vs-code-debugger-always-gets-stuck-at-the-quadratic-constraint-definition-of-a-jump-model/114285/2 "2024-05-15T09:07:15Z")

</div>

The debugger runs in interpreter mode which can be much slower than compiled code. Infiltrator.jl preserves execution speed, though it’s not a full replacement for a stepping debugger, and last time I checked, it has compatibility problems when it’s run in VSCode rather than the terminal REPL.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 15, 2024, 9:29am UTC](https://discourse.julialang.org/t/the-vs-code-debugger-always-gets-stuck-at-the-quadratic-constraint-definition-of-a-jump-model/114285/3 "2024-05-15T09:29:51Z")

</div>

> [@greatpet](#):
>
> it has compatibility problems when it’s run in VSCode rather than the terminal REPL.

True, but you can always work around that by running your code in the integrated terminal instead of using inline evaluation in the editor.
