-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Jul 1, 2023
1 parent
a403fbf
commit 8fa2a2a
Showing
6 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>How To · JuliaSyntax.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">JuliaSyntax.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Overview</a></li><li class="is-active"><a class="tocitem" href>How To</a><ul class="internal"><li><a class="tocitem" href="#Use-JuliaSyntax-as-the-default-parser"><span>Use JuliaSyntax as the default parser</span></a></li></ul></li><li><span class="tocitem">Reference</span><ul><li><a class="tocitem" href="../reference/">Syntax Trees</a></li><li><a class="tocitem" href="../api/">API Reference</a></li></ul></li><li><a class="tocitem" href="../design/">Design Discussion</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>How To</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>How To</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaLang/JuliaSyntax.jl/blob/main/docs/src/howto.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="How-To"><a class="docs-heading-anchor" href="#How-To">How-To</a><a id="How-To-1"></a><a class="docs-heading-anchor-permalink" href="#How-To" title="Permalink"></a></h1><p>This section contains brief recipes for particular tasks</p><h2 id="Use-JuliaSyntax-as-the-default-parser"><a class="docs-heading-anchor" href="#Use-JuliaSyntax-as-the-default-parser">Use JuliaSyntax as the default parser</a><a id="Use-JuliaSyntax-as-the-default-parser-1"></a><a class="docs-heading-anchor-permalink" href="#Use-JuliaSyntax-as-the-default-parser" title="Permalink"></a></h2><p>To use JuliaSyntax as the default Julia parser for the REPL and to <code>include()</code> files, parse code with <code>Meta.parse()</code>, etc, put the following in your startup.jl file:</p><pre><code class="language-julia hljs">using JuliaSyntax | ||
JuliaSyntax.enable_in_core!()</code></pre><p>This works well in Julia 1.9 but in Julia 1.8 will cause some startup latency. To reduce that you can create a custom system image by running the code in <code>./sysimage/compile.jl</code> as a Julia script (or directly using the shell, on unix). Then use <code>julia -J $resulting_sysimage</code>.</p><p>Using a custom sysimage has the advantage that package precompilation will also go through the JuliaSyntax parser.</p><h3 id="VSCode"><a class="docs-heading-anchor" href="#VSCode">VSCode</a><a id="VSCode-1"></a><a class="docs-heading-anchor-permalink" href="#VSCode" title="Permalink"></a></h3><p>To use JuliaSyntax as the default parser for Julia within VSCode, add the following to your <code>startup.jl</code> file:</p><pre><code class="language-julia hljs">import JuliaSyntax | ||
JuliaSyntax.enable_in_core!()</code></pre><p>To reduce startup latency you can combine with a custom system as described in the <a href="https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/#Creating-a-sysimage-for-the-active-environment">Julia VScode docs</a>, combined with the precompile execution file in <code>sysimage/precompile_exec.jl</code> in the source tree. For additional detail see the discussion in <a href="https://github.com/JuliaLang/JuliaSyntax.jl/issues/128">issue #128</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../reference/">Syntax Trees »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 17:49">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> | ||
JuliaSyntax.enable_in_core!()</code></pre><p>To reduce startup latency you can combine with a custom system as described in the <a href="https://www.julia-vscode.org/docs/dev/userguide/compilesysimage/#Creating-a-sysimage-for-the-active-environment">Julia VScode docs</a>, combined with the precompile execution file in <code>sysimage/precompile_exec.jl</code> in the source tree. For additional detail see the discussion in <a href="https://github.com/JuliaLang/JuliaSyntax.jl/issues/128">issue #128</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Overview</a><a class="docs-footer-nextpage" href="../reference/">Syntax Trees »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Saturday 1 July 2023 21:10">Saturday 1 July 2023</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.