-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Feature: don't show error peek overlay when navigating over errors (next/prev error by F8 hotkey) #245092
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
base: main
Are you sure you want to change the base?
Feature: don't show error peek overlay when navigating over errors (next/prev error by F8 hotkey) #245092
Conversation
Made error overlay still shown on clicking Hid the hotkey hint in brackets on Open question. I tried to retrieve setting inside MarkerController constructor to cache it for further use, but it seems that MarkerController doesn't get recreated on settings edits. So I made a getter which retrieves it every time. I don't feel it right, but I don't know how to do it properly. Maybe it should be boxed into something adaptive to settings updates? |
I looked at how it was done in other places and added a disposable callback for settings updates. Now it looks correct to me |
@sandy081 check please, it looks complete to me, but maybe I should change it or do it other way? Regarding of adding |
Thanks for the effort here. Tho, we should discussed first if this contribution will be taken. There are not many upvotes on either feature requests and the gist of the F8 feature is to peek into errors, not to navigate across them. Taking a PR always comes with the maintenance cost and the feature you are asking for can also be done as extension ( |
@jrieken I see that my implementation is wrong, it should be done as a different command, instead of as configuration setting. I didn't really think about implementing this as an extension. I guess I can do that. If all the API needed for this is available to extensions, that's a good solution. Thanks But since we're already here. If I can add my two cents to why this might be wanted to be built into editor Why not many upvotesOne of the reasons is that command named not accurate, because it is named as Why someone might not want information about a Problem. Casesa) For overall usage. It would be actually interesting to gather statistics about the percentage ratio of immediately closing peek overlay to keeping it open for more than two seconds. But subjectively the reading frequency will be much lower than 50 percent, since most often the problem is clear because code segment is underlined, or even decorated in an additional way (dimmed, etc.) which gives understanding of the issue faster, than reading error description. But everyone can check himself - how often you hit Esc immediately? It's just not noticeable until you pay attention to this fact Why it is essential, from UX viewEven if peek is useful in less than 50% of cases, it is still good to have it by default, this makes it user-friendly, I understand that. Not a big deal to just close it. But the option to opt out of it is really missing. Since this is not information somewhere on the side that can be ignored. It is a feature that requires action to be taken to reject it. Physical movements to hit Esc and back to initial position of a hand, this takes time. Peek overlay breaks the code where it is inserted and collapses it back when closed. Jumping code is a strain on the eyes and attention. It delays the moment when the code begins to be perceived clearly. This is a cognitive interruption. The ability to skip the peek is a workflow optimization, which is one of the main goals of an editor as I see it. Reducing cognitive noise to maintain attention hygiene. Code, as a first-class editor, imo should provide such options out of the box If this is reasonable enough, I can try to work on it. My proposal is:
If not, I'm fine to create an extension |
@jrieken since decision is taking some time, I have tried to write an extension. Done it, but when I tried to jump to closed file, it failed. Seems like I have also tried to use original Go to commands and execute |
Both, the marker service and getDiagnostics API, use the same data. This forwards all markers from the service into the API. This includes diagnostics from the API as well as from tasks. Tho, there is no guarantee that diagnostics are computed on a project-level, e.g tsserver doesn't do that by default. |
@jrieken thanks for the info, but it doesn't helps. Am I doing something wrong?
Is it working as intended? If yes, how to get full list, the same as |
Mystery. The problems pane is also just fed from the marker service, afaik there is no other way to feed problems into the system and from there everything is pushed back into the extension host |
@jrieken, I just thought that it could be because of monoproject (I'm using tsconfig refs), thought maybe it just discards data coming from 'another' project. But no, it is reproducible in very simple project. Here is repo for testing https://github.com/n-gist/getDiagnostics-test const diagnostics = vscode.languages.getDiagnostics()
for (const d of diagnostics) {
channel.appendLine(`${d[0].toString()}`)
channel.appendLine(`${d[1].length} entries`)
} Reproduce steps:
You can point me to where I can investigate for a chance of finding the source, but I assume my vs code codebase knowledge is not enough to find a fix acceptably fast. Is it there? Or will you take a look at it yourself sometime? |
@jrieken, I just opened the repo I created (in previous comment) through Codespaces extension, installed typescript for watch task, this vsix I made, and it works as intended. Step 4 outputs data for both files. And still outputs as it should after closing files (Step 7). Another difference is that locally there is a tsconfig.json URI entry in getDiagnostics() results, without problems entries (In my other project there is also similar entry for package.json URI) Step 2 (one file is open) I tried disabling all extensions and emptying my settings file. Didn't helped |
@jrieken, I was trying to find the source of issue, so here is what I found First, I found that DiagnosticCollection.set is not called when kicking watch task So, I checked what happens in However, when a file is opened, So, in conclusion, collection is feeded from somewhere by I wanted to check how it behaves through codespaces extension for comparison, but it doesn't connects from OSS build |
Here is one more test I did - if watch task is kicked before opening any file, |
This is a great find. There is something going on with task- and extension-markers. I need to double check but I believe they can share owners so that extension-markers overwrite task-markers but not the other way around. |
Adds ZoneWidget
showOverlay
(true
) option to skip insertion of overlayWidget if set tofalse
Adds
problems.gotoError.showOverlay
setting to make use of it when navigating over errors (next/prev error by F8 hotkey)Fixes #51787
Fixes #63591