Build system for Sublime Text running Julia in Terminus

This PA is intended for Sublime Text users who would like to run Julia in Terminus within the editor.

Save this into the file Julia-REPL.sublime-build in the folder Data/Packages/User.

{ // This build system simply opens a new interactive Julia REPL 
    // 2023 Petr Krysl
    "title": "Julia REPL",
    "target": "terminus_open",
    "auto_close": false,
    "shell_cmd": "julia -t4", // Assume that PATH is set before invoking the editor
    "cwd": "${file_path:${folder}}",
    // "selector": "source.julia",
    "focus": false,
    "file_regex": "(?:[@](?:\\s\\S[\\w.]*[^@])??|in expression starting at)\\s(\\S+[.]jl):([0-9]+)"
}

Prerequisite: Terminus. For further details see GitHub - PetrKryslUCSD/HowToUseJuliaWithSublimeText3

Extra feature: When there is an error, place the cursor somewhere above the part of the
error message that states the name of the file and the line. Perhaps somewhere within the line that start with [5] in this example.

  Got exception outside of a @test                                                                                                                                                 
  LoadError: ArgumentError: indexed assignment with a single value to possibly many locations is not supported; perhaps use broadcasting `.=` instead?                             
  Stacktrace:                                                                                                                                                                      
    [1] setindex_shape_check(::Bool, ::Int64)                                                                                                                                      
      @ Base .\indices.jl:261                                                                                                                                                      
    [2] _unsafe_setindex!(#unused#::IndexLinear, A::Vector{Bool}, x::Bool, I::Vector{Int64})                                                                                       
      @ Base .\multidimensional.jl:939                                                                                                                                             
    [3] _setindex!                                                                                                                                                                 
      @ .\multidimensional.jl:930 [inlined]                                                                                                                                        
    [4] setindex!                                                                                                                                                                  
      @ .\abstractarray.jl:1344 [inlined]                                                                                                                                          
    [5] __all_behind(xyz::Matrix{Float64}, centroid::Vector{Float64}, c::Vector{Float64}, n::Vector{Float64}, conn::Vector{Int64}, tol::Float64, mask::Vector{Bool})               
      @ FinEtools.MeshModificationModule C:\Users\UserTheUser\Documents\00WIP\FinEtools.jl\src\MeshModificationModule.jl:1127                                                            
    [6] outer_surface_of_solid(fens::FinEtools.FENodeSetModule.FENodeSet, bdry_fes::FinEtools.FESetModule.FESetT6)                                                                 
      @ FinEtools.MeshModificationModule C:\Users\UserTheUser\Documents\00WIP\FinEtools.jl\src\MeshModificationModule.jl:1193                                                            
    [7] test()                

Now press F4. This will take the editor to the line 1127 of the file C:\Users\UserTheUser\Documents\00WIP\FinEtools.jl\src\MeshModificationModule.jl.

This will work not only with error messages, but also with messages produced by JET.jl. For instance:


1

3 Likes