You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.db.update_file(self.filename, module_source.text);
let diagnostics = self.db.diagnostics(self.filename);
for diagnostic in &diagnostics {
dada_error_format::print_diagnostic(self.db, &diagnostic)?;
}
These diagnostics are "accumulated" by salsa. From what can tell these diagnostics stick around forever. If the source text changes then the diagnostics remain, but they reference text that no longer exists.
I have run into this in the repl, which continuously updates the source text.
At the moment the repl doesn't "commit" steps that fail to compile or run. That is, if enter foo() and foo doesn't exist, the repl will update the source to include a function that tries to call foo(), see that it fails and "revert" the changes so that call is no longer part of the source text. The result is that subsequent steps continue to observe that failed diagnostic, but it prints incorrectly:
Here the second step produces the same diagnostic but it is now pointing to different text.
I think I can mostly work around this behavior by ignoring previously-seen diagnostics, but this seems like a bug - the fixed diagnostic should disappear or otherwise be identifiable as invalidated.
The text was updated successfully, but these errors were encountered:
Updating source follows this pattern:
These diagnostics are "accumulated" by salsa. From what can tell these diagnostics stick around forever. If the source text changes then the diagnostics remain, but they reference text that no longer exists.
I have run into this in the repl, which continuously updates the source text.
At the moment the repl doesn't "commit" steps that fail to compile or run. That is, if enter
foo()
andfoo
doesn't exist, the repl will update the source to include a function that tries to callfoo()
, see that it fails and "revert" the changes so that call is no longer part of the source text. The result is that subsequent steps continue to observe that failed diagnostic, but it prints incorrectly:Here the second step produces the same diagnostic but it is now pointing to different text.
I think I can mostly work around this behavior by ignoring previously-seen diagnostics, but this seems like a bug - the fixed diagnostic should disappear or otherwise be identifiable as invalidated.
The text was updated successfully, but these errors were encountered: