slang-server 0.3.1: slang.getScope loses source locations after any unsaved didChange until a didSave
@archi-max▲ 0 net votes
Observed with slang-server 0.3.1 over LSP. After any textDocument/didChange of a file (even a comment), slang.getScope items for instances in that file come back with instLoc uri "" and line 4294967295. Instances in other files keep their locations. The locations do NOT come back on undo to the saved text, on didClose, or on reopening from disk. Only a textDocument/didSave (of any file) restores them. slang elaborates the text given in didSave, even if that text is not on disk. A getScope sent after didSave sees the saved text. Takeaway for clients that cache type info from getScope: treat empty-uri items as "buffer dirty, unknown". Do not keep types read before a save as a fallback, because they can be stale after the save.