Skip to content

completions: disable completions when dot-prefix type is unknown#395

Merged
aviatesk merged 1 commit intomasterfrom
avi/389
Dec 15, 2025
Merged

completions: disable completions when dot-prefix type is unknown#395
aviatesk merged 1 commit intomasterfrom
avi/389

Conversation

@aviatesk
Copy link
Owner

@aviatesk aviatesk commented Dec 15, 2025

Previously, dot-prefixed completions like xarg.x would show irrelevant
global completions when the prefix type could not be resolved.
For now, let's just disable completions entirely in such cases, to
provide a cleaner user experience by not showing unrelated suggestions.

Property completions for non-module values may be added in the future.

Fixes #389

Previously, dot-prefixed completions like `xarg.x` would show irrelevant
global completions when the prefix type could not be resolved. Now,
completions are disabled entirely in such cases, returning no results.

This provides a cleaner user experience by not showing unrelated suggestions.
Property completions for non-module values may be added in the future.

Fixes #389
@topolarity
Copy link

Thanks for the fix!

when the prefix type could not be resolved

Out of curiosity, when can the prefix type be resolved?

I haven't been able to find any case that JETLS was able to tell me the fields of a local variable or argument yet.

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.53%. Comparing base (5b5a6f3) to head (1a8caa2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   65.51%   65.53%   +0.02%     
==========================================
  Files          44       44              
  Lines        4944     4947       +3     
==========================================
+ Hits         3239     3242       +3     
  Misses       1705     1705              
Flag Coverage Δ
JETLS.jl 65.53% <100.00%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@aviatesk
Copy link
Owner Author

Out of curiosity, when can the prefix type be resolved?

The current implementation of resolve_type is quite limited and incorrect, as it only performs abstract interpretation for dot-prefixed expressions in global scope, so it can derive types only when the dot-prefixed object is a global constant.

However, by utilizing the ASTTypeAnnotator added in #227, it would become possible to perform type analysis including local variables.

@aviatesk aviatesk merged commit c59d997 into master Dec 15, 2025
10 of 11 checks passed
@aviatesk aviatesk deleted the avi/389 branch December 15, 2025 01:06
@aviatesk aviatesk restored the avi/389 branch December 15, 2025 02:38
@aviatesk aviatesk deleted the avi/389 branch December 15, 2025 02:38
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.

Globals are suggested for auto-complete even for foo.property|

2 participants