<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Avoid stale diagnostics in files that have been closed"
href="https://bugs.llvm.org/show_bug.cgi?id=41217">41217</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Avoid stale diagnostics in files that have been closed
</td>
</tr>
<tr>
<th>Product</th>
<td>clang-tools-extra
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>clangd
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zeratul976@hotmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>ibiryukov@google.com, kadircetinkaya.06.tr@gmail.com, llvm-bugs@lists.llvm.org, malaperle@gmail.com, sammccall@google.com
</td>
</tr></table>
<p>
<div>
<pre>Consider the following workflow:
1. User opens file A. File A contains a compiler error, so
clangd sends a diagnostic, which shows up in the editor's
Problems view (assuming it has one).
2. User closes file A. Clangd does not clear diagnostics
for file A, so the error remains in the Problems view.
3. User opens file A in a different (non-LSP) editor, and
fixes the error. The error still remains in the LSP
editor's Problems view, but is now stale.
It would be nice to be able to avoid this. A couple of possible options for
how:
A. Clangd clears diagnostics in a file whenever a file
is closed.
In this case, the user model is that the editor's
Problems view only shows LSP diagnostics that pertain
to open files.
B. Clangd reacts to the workspace/didChangeWatchedFiles
notifications, to detect the change made in step #3
in the workflow above, and updates diagnostics in
response.
In this case, the user model is that the editor's
Problems view shows LSP diagnostics for every file
that has been opened during the LSP session (?), but
they are up to date even if the file is currently
closed and has been modified elsewhere.
Any thoughts on whether a change along these lines would be desirable?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>