Skip to content

Support Julia 1.14-DEV#782

Open
koalazub wants to merge 13 commits into
aviatesk:masterfrom
koalazub:support-julia-1.14-dev
Open

Support Julia 1.14-DEV#782
koalazub wants to merge 13 commits into
aviatesk:masterfrom
koalazub:support-julia-1.14-dev

Conversation

@koalazub

@koalazub koalazub commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

JETLS loads, serves, and analyses on a current Julia 1.14 nightly, given the companion JET support in aviatesk/JET.jl#836. Nothing changes on 1.12 or 1.13; the 1.14 paths are selected at parse time (mostly @static if hasfield(CC.InferenceState, :world) / isdefined(CC, ...) gates), so older Julia lowers exactly as before.

The dev Compiler's API is a moving target underneath: InferenceState dropped its world field (derived via get_inference_world now), ConstCallInfo was removed in favor of CC.InferenceCache, finishinfer! gained an opt_cache argument that silently broke the type annotator's dispatch, and analyze_method_signature! now returns a bare InferenceResult instead of a (analyzer, result) tuple. JET v0.11 stopped taking a cache-refresh keyword, so JETLS no longer passes one. The keyword-completion table no longer assumes every keyword carries documentation. Separately, notebook @markdown/@raw/@typst cells are now masked byte-for-byte before parsing (raw text preserved for formatting) so their prose stops producing bogus syntax/macro diagnostics.

Rebased onto current master; no functional changes since the last push.

Comment thread .gitignore
Project.toml.bak
Manifest.toml
Manifest-*.toml
LocalPreferences.toml

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a simple change that can be merged separately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — split out into #783 so it can be merged on its own. I've also removed it (and the rest of the incidental local-dev scaffolding: the [sources] path, LocalPreferences.toml, and the [compat] churn) from this PR, so #782 is now just the 1.14 Compiler/JET-API adaptations.

@koalazub
koalazub force-pushed the support-julia-1.14-dev branch 3 times, most recently from d764788 to eac3651 Compare June 27, 2026 10:02
koalazub added a commit to koalazub/JETLS.jl that referenced this pull request Jun 28, 2026
Snapshot of local working changes on top of `support-julia-1.14-dev`.
All 1.14 Compiler adaptations are gated (`@static if
hasfield(CC.InferenceState, :world)` / `isdefined(CC, :InferenceCache)`)
so the 1.12/1.13 paths lower unchanged, following the convention of
aviatesk#782.

Gated Compiler API drift (inference + diagnostics paths):
- `ASTTypeAnnotator` local cache aliases to `Compiler.InferenceCache`
  on 1.14, `Vector{InferenceResult}` otherwise (fixes `OverlayCodeCache`
  construction in the default `code_cache`).
- `CC.finishinfer!` gains the 4th `opt_cache` argument on 1.14; without
  the dispatched override `annotate_types!` never ran and type inlay
  hints silently produced no `:type` attributes.
- `CC.abstract_call_gf_by_type` / `CC.abstract_call_opaque_closure`
  (and the OC call site) gain the new `vtypes` argument on 1.14. They
  were silently bypassed otherwise, so the iterator argtype observation
  never ran and the inner variable of a cartesian comprehension
  (`[x+y for x in xs for y in ys]`) inferred as `Any`.
- `slot_type_at` reads `frame.bb_states[bb].vartable` on 1.14,
  `frame.bb_vartables[bb]` otherwise.
- `ConstCallInfo` usages guarded with `@static isdefined(CC, ...)`.
- `JET.set_cache_target!`/`cache_target` widened to
  `Pair{Symbol,<:InferenceState}` lives in the dev'd JET.jl checkout.

Other:
- `document-symbol.jl`: read the module name from `st0[end-1]`, robust
  to the leading `Value` provenance children 1.14 adds to `K"module"`.
- `test/HierarchicalTestSet.jl`: guard removed `Test.FAIL_FAST`.
- `completions.jl`, `test/test_julia114.jl`, `Project.toml`,
  `.gitignore`: local working changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@koalazub
koalazub marked this pull request as ready for review July 1, 2026 15:06
@koalazub
koalazub force-pushed the support-julia-1.14-dev branch from 71251af to 5bfa4da Compare July 1, 2026 23:41
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.53247% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.20%. Comparing base (007509d) to head (e3e47db).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/document-synchronization.jl 57.89% 16 Missing ⚠️
src/analysis/TypeAnnotation.jl 73.07% 7 Missing ⚠️
src/utils/type-annotation-utils.jl 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #782      +/-   ##
==========================================
- Coverage   78.30%   78.20%   -0.10%     
==========================================
  Files          62       62              
  Lines       12928    12992      +64     
==========================================
+ Hits        10123    10161      +38     
- Misses       2805     2831      +26     
Flag Coverage Δ
JETLS.jl 78.20% <67.53%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@koalazub

koalazub commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

The nightly failure is upstream of this diff — the registered Compiler package is stale against the current nightly (UndefVarError: _eval_import at precompile), so JET/JETLS never compile.

@koalazub
koalazub force-pushed the support-julia-1.14-dev branch 3 times, most recently from e3e47db to d4dde45 Compare July 9, 2026 06:27
koalazub and others added 9 commits July 12, 2026 12:26
A keyword absent from Base.Docs.keywords threw a KeyError while building the completion table; look it up defensively and fall back to no documentation.
JET v0.11 refreshes the local cache inside the constructor instead of accepting it as a keyword, so passing it raised a MethodError on every analysis.
The dev Compiler removed the world field. On the nightly, derive the world via get_inference_world, hand binding_world_hints to the partition scan, and call the three-argument update_valid_age!; older Julia keeps sv.world.
The LSInterpreter ToplevelAbstractAnalyzer method dropped the
refresh_local_cache kwarg, but the concurrent signature-analysis call site
still passed it, so every task threw MethodError on all Julia versions. The
cache is still refreshed via JET's positional default in the 2-arg
ToplevelAbstractAnalyzer(::ConcreteInterpreter, ::BitVector).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@markdown/@raw/@typst cell bodies are prose, not Julia; parsing them
produced bogus syntax diagnostics. Blank them out byte-for-byte (offsets
and line numbers preserved) before JuliaSyntax sees the text. Files
without cell markers pass through untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js76HSq1MpJgHhekLahoFH
…piler

Upstream's report_method_error! unwraps CC.ConstCallInfo and
ASTTypeAnnotator carries a Vector{InferenceResult} local cache; the
pinned Compiler (2e0a778b) removed ConstCallInfo and replaced the
inference-cache convention with CC.InferenceCache. Gate both behind
isdefined checks so either Compiler builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js76HSq1MpJgHhekLahoFH
…g states

finishinfer! grew an opt_cache parameter in the pinned Compiler, so the
annotator's 3-arg overload never dispatched and no :type attributes were
ever attached — hover, field completions, and inlay hints all silently
degraded (upstream's own precompile workload warned). Gate the overload on
both arities, gate bb_vartables->bb_states and ConstCallInfo, and teach the
annotator's partition load plus resolve_global_const to unwrap the
AbstractBindingState JET now materializes for non-const globals, so
notebook toplevel bindings hover with concrete types.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js76HSq1MpJgHhekLahoFH
mask_noncode_cells now blanks the @cell/@markdown/@raw/@typst marker
lines and legacy `using NothelixMacros` (byte-length preserving) so the
LSP never reports them as undefined macros — no NothelixMacros package
needed. FileInfo carries the unmasked raw_text; document_text returns it
so whole-document formatting and the test runner see real content while
the parse stream stays masked. Fixes :fmt erasing notebook buffers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js76HSq1MpJgHhekLahoFH
JET's analyze_method_signature! → analyze_method_instance! returns the
InferenceResult directly, not (analyzer, result). The three sites that
destructured it as a 2-tuple threw MethodError: no method matching
iterate(::InferenceResult), silently killing signature analysis (no
method/undef diagnostics fired). Drop the stale `analyzer,` binding —
the analyzer is mutated in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js76HSq1MpJgHhekLahoFH
@koalazub
koalazub force-pushed the support-julia-1.14-dev branch 2 times, most recently from 25a506d to a6be8d3 Compare July 12, 2026 02:36
koalazub added 4 commits July 13, 2026 11:59
Port handle_request_message_or_respond_error from the deployed 1.14 tree:
a throwing request handler now yields an InternalError response instead of
leaving the client hanging. Also guard rename's deferred workDoneProgress
continuation, which runs outside that guard's scope: a throw (or a client
error response to the progress-create request) now sends an error response
for the original rename request id. Tested via do_rename overrides on both
the direct and deferred paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants