feat : field completions#615
feat : field completions#615Sypher845 wants to merge 2 commits intoaviatesk:avi/ASTTypeAnnotatorfrom
Conversation
d1194a9 to
23641b8
Compare
|
This PR implements Also, there should be additional points to discuss:
Lastly, please rebase this PR and set #620 as the merge target. |
23641b8 to
b56705b
Compare
b56705b to
3fc3361
Compare
|
@aviatesk i have addressed the main review points,
Current limitation: Please take a look when you have time |
e355af5 to
355440b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## avi/ASTTypeAnnotator #615 +/- ##
========================================================
+ Coverage 69.14% 69.23% +0.09%
========================================================
Files 51 53 +2
Lines 8734 9034 +300
========================================================
+ Hits 6039 6255 +216
- Misses 2695 2779 +84
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1058286 to
609a5c4
Compare
3fc3361 to
8c0b32d
Compare
|
@Sypher845 consolidated feedback before we iterate further — the concrete items from the first review are addressed ( The remaining concern is approach-level. The current PR layers three parallel paths — The unified formulation is: obtain the inferred type (or One way to have caught this earlier is to try to break an approach like the current one on a non-trivial example, e.g. julia> code_typed((Regex,); optimize=false) do r
propertynames(r)
end
1-element Vector{Any}:
CodeInfo(
1 ─ %1 = Main.propertynames::Core.Const(propertynames)
│ %2 = dynamic (%1)(r)::Core.Const((:pattern, :compile_options, :match_options, :regex))
└── return %2
) => NTuple{4, Symbol}The current If you'd like to take this forward, the path is to rework the implementation around this abstract-call design. |
Implement the `ASTTypeAnnotator` pipeline, which takes a `SyntaxTree`, generates `CodeInfo` from it, and performs type annotation via abstract interpretation. By maintaining a reverse mapping from `CodeInfo` back to `SyntaxTree`, we can trace from a specific statement in `CodeInfo` to its source representation. This is needed for implementing type on hover, inlay type hints, and property completions, etc. Marked as WIP since there are still many edge cases and inference result caching is not yet implemented.
609a5c4 to
518d4a6
Compare
|
Thanks for the detailed breakdown. I understand the issue now. I'll look into this and try to rework the implementation around that design. Will update once I have something concrete. |
Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
8c0b32d to
5364533
Compare
98c7b72 to
ef22f68
Compare
This PR adds field completion support to JETLS. When a user types
x.and triggers completions (e.g., viaCtrl+Space), the server now suggests available fields for the inferred type ofx.