-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ark: Should Console code execution trigger a full regeneration of document diagnostics? #1005
Comments
One thing I notice when working on a TypeScript project in a vscode workspace is that changes in one document propagate out to diagnostics for other documents; if I do something bad in one file, it shows me problems I have caused in another file. An alternative to thinking about executing code at the console triggering diagnostics would be using the files in the workspace to do diagnostics. I like that more because what is in the other documents is more "real" than work in the console, and it is more aligned with vscode workspace behavior for other kinds of projects. To be more concrete for this example, maybe the workspace should know that this is an R package, and be able to use what is in another document (in this case |
We maintain a list of open documents, so one approach could be:
The longer delay hopefully avoids any performance issues from running diagnostics on a larger number of files. |
Recent changes have fixed the situation around diagnostics a lot; see #997 and #999. I want to lay out how the experience now works for further consideration. If I open my package totally fresh and starting editing a test file, I see all the testthat functions identified as problems: If I run If I then go back to the file and starting editing again, the testthat problems then resolve: I can get the rest of those problems to resolve by doing There are two aspects of this that still need addressing:
|
To expand on this a bit:
It feels like So, I get that this issue might be mostly about regenerating document diagnostics. But for these two examples, it feels like we should be able to get it right from the very start, i.e. has nothing to do with regenerating diagnostics. |
Some key action items:
|
posit-dev/ark#224 fixes the exact problem that this issue was opened for (i.e. the diagnostics should update after running something in the Console). I have moved the additional comments (which are good ideas) into #2252 |
NICE 🤩 diagostics.movIn Positron 2024.02.0 (Universal) build 1535, I see diagnostics update after I execute code in the console. |
Currently we only regenerate diagnostics within a document if a change is made within the document itself.
But changes at the console can be highly entangled with document diagnostics.
For example, look at this case where
inform()
(from rlang) isn't available until I runload_all()
on the R package I'm working on, which does bring the rlang namespace into session scope. Even though runningload_all()
at the console technically bringsinform()
into scope, I don't actually see that reflected in the diagnostics until I go up and make a change to the document itself (which finally reruns its diagnostics).Screen.Recording.2023-08-09.at.4.08.21.PM.mov
The text was updated successfully, but these errors were encountered: