problemreporter: handle text document URL changes
A text document's URL can be changed when:
- a new Untitled document is saved;
- an open document is saved under a different name (File=>Save As...).
ProblemReporterPlugin
does not listen to
IDocumentController::documentUrlChanged
signal, and therefore keeps
referencing text documents by stale URLs. So when a document is renamed,
then another document is created or opened at its previous URL, the
assertion Q_ASSERT(!m_visualizers.contains(documentUrl));
in
ProblemReporterPlugin::textDocumentCreated()
fails. Another consequence
is that inline problem notes never appear in the renamed document.
Replace the URL key of the renamed document's visualizer and remove the
obsolete URL from m_reHighlightNeeded
set.
When the default problem scope "Current Document" is selected, an active
document is not highlighted right after it is renamed. The user has to
activate another document, then go back to the renamed one for the
highlighting to appear. This is a consequence of another missing
connection to the documentUrlChanged
signal in ProblemModel
. Will be
addressed in a subsequent commit.
BUG: 468595
FIXED-IN: 5.13.231200