Skip to content

Commit 15b4eb8

Browse files
authored
Add docs on how to use JuliaSyntax inside VSCode (#132)
1 parent 1bf1787 commit 15b4eb8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,25 @@ system image by running the code in `./sysimage/compile.jl` as a Julia script
125125
Using a custom sysimage has the advantage that package precompilation will also
126126
go through the JuliaSyntax parser.
127127

128+
### VSCode
129+
130+
To use JuliaSyntax as the default parser for Julia within VSCode, add the
131+
following to your `startup.jl` file:
132+
133+
```julia
134+
atreplinit() do repl
135+
@eval begin
136+
import JuliaSyntax
137+
JuliaSyntax.enable_in_core!(true)
138+
end
139+
end
140+
```
141+
142+
To reduce startup latency you can combine with a custom system as described in
143+
the [Julia VScode docs](https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/#Creating-a-sysimage-for-the-active-environment),
144+
combined with the precompile execution file in [sysimage/precompile_exec.jl](sysimage/precompile_exec.jl).
145+
For additional detail see the discussion in [issue #128](https://github.com/JuliaLang/JuliaSyntax.jl/issues/128).
146+
128147
# Parser implementation
129148

130149
Our goal is to losslessly represent the source text with a tree; this may be

0 commit comments

Comments
 (0)