fix: restore code action incrementality (#8868)

This PR ensures that code actions do not have to wait for the full file
to elaborate. This regression was accidentally introduced in #7665.
This commit is contained in:
Marc Huisinga 2025-06-18 20:00:20 +02:00 committed by GitHub
parent 935aa38603
commit aea8e11d4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ def waitUnknownIdentifierRanges (doc : EditableDocument) (requestedRange : Strin
let text := doc.meta.text
let some parsedSnap := RequestM.findCmdParsedSnap doc requestedRange.start |>.get
| return #[]
let msgLog := Language.toSnapshotTree parsedSnap |>.collectMessagesInRange requestedRange |>.get
let msgLog := Language.toSnapshotTree parsedSnap.elabSnap |>.collectMessagesInRange requestedRange |>.get
let mut ranges := #[]
for msg in msgLog.unreported do
if ! msg.data.hasTag (· == unknownIdentifierMessageTag) then

View file

@ -269,7 +269,7 @@ def findGoalsAt? (doc : EditableDocument) (hoverPos : String.Pos) : ServerTask (
let text := doc.meta.text
findCmdParsedSnap doc hoverPos |>.bindCostly fun
| some cmdParsed =>
let t := toSnapshotTree cmdParsed |>.foldSnaps [] fun snap oldGoals => Id.run do
let t := toSnapshotTree cmdParsed.elabSnap |>.foldSnaps [] fun snap oldGoals => Id.run do
let some stx := snap.stx?
| return .pure (oldGoals, .proceed (foldChildren := false))
let some (pos, tailPos, trailingPos) := getPositions stx

View file

@ -394,7 +394,7 @@ def findCmdDataAtPos
(includeStop : Bool)
: ServerTask (Option (Syntax × Elab.InfoTree)) :=
findCmdParsedSnap doc hoverPos |>.bindCheap fun
| some cmdParsed => toSnapshotTree cmdParsed |>.findInfoTreeAtPos doc.meta.text hoverPos includeStop |>.bindCheap fun
| some cmdParsed => toSnapshotTree cmdParsed.elabSnap |>.findInfoTreeAtPos doc.meta.text hoverPos includeStop |>.bindCheap fun
| some infoTree => .pure <| some (cmdParsed.stx, infoTree)
| none => cmdParsed.elabSnap.infoTreeSnap.task.asServerTask.mapCheap fun s =>
assert! s.infoTree?.isSome