File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed
Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1818
1919### Added
2020
21- - JETLS now automatically runs ` Pkg.instantiate() ` for packages that have not
22- been instantiated yet (e.g., freshly cloned repositories). This allows
23- full analysis to work immediately upon opening such packages. Note that this
24- will automatically create a ` Manifest.toml ` file when the package has not been
25- instantiated yet. This behavior is controlled by the ` full_analysis.auto_instantiate `
21+ - JETLS now automatically runs ` Pkg.resolve() ` and ` Pkg.instantiate() ` for
22+ packages that have not been instantiated yet (e.g., freshly cloned repositories).
23+ This allows full analysis to work immediately upon opening such packages.
24+ When no manifest file exists, JETLS first creates a
25+ [ versioned manifest] ( https://pkgdocs.julialang.org/v1/toml-files/#Different-Manifests-for-Different-Julia-versions )
26+ (e.g., ` Manifest-v1.12.toml ` ).
27+ This behavior is controlled by the ` full_analysis.auto_instantiate `
2628 configuration option (default: ` true ` ). Set it to ` false ` to disable.
2729- When ` full_analysis.auto_instantiate ` is disabled, JETLS now checks if the
2830 environment is instantiated and warns the user if not.
Original file line number Diff line number Diff line change @@ -65,11 +65,12 @@ debounce = 2.0 # Wait 2 seconds after save before analyzing
6565- ** Type** : boolean
6666- ** Default** : ` true `
6767
68- When enabled, JETLS automatically runs ` Pkg.instantiate() ` for packages that have
69- not been instantiated yet (e.g., freshly cloned repositories). This allows full
70- analysis to work immediately upon opening such packages. Note that this will
71- automatically create a ` Manifest.toml ` file when the package has not been
72- instantiated yet.
68+ When enabled, JETLS automatically runs ` Pkg.resolve() ` and ` Pkg.instantiate() ` for
69+ packages that have not been instantiated yet (e.g., freshly cloned repositories).
70+ This allows full analysis to work immediately upon opening such packages.
71+ When no manifest file exists, JETLS first creates a
72+ [ versioned manifest] ( https://pkgdocs.julialang.org/v1/toml-files/#Different-Manifests-for-Different-Julia-versions )
73+ (e.g., ` Manifest-v1.12.toml ` ).
7374
7475``` toml
7576[full_analysis ]
Original file line number Diff line number Diff line change 676676function ensure_instantiated! (server:: Server , env_path:: String )
677677 if get_config (server. state. config_manager, :full_analysis , :auto_instantiate )
678678 try
679+ manifest_name = " Manifest-v$(VERSION . major) .$(VERSION . minor) .toml"
680+ manifest_path = joinpath (dirname (env_path), manifest_name)
681+ if ! isfile (manifest_path)
682+ JETLS_DEV_MODE && @info " Touching versioned manifest file" env_path
683+ touch (manifest_path)
684+ end
685+ JETLS_DEV_MODE && @info " Resolving package environment" env_path
686+ Pkg. resolve ()
679687 JETLS_DEV_MODE && @info " Instantiating package environment" env_path
680688 Pkg. instantiate ()
681689 catch e
You can’t perform that action at this time.
0 commit comments