microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 237 forks source link

Hover popups getting stuck open #760

Open nicoburns opened 3 years ago

nicoburns commented 3 years ago

The (very helpful) TypeScript hover popups are getting stuck open. This doesn't happen every time, but often enough (maybe once every 5 minutes or so) to be really annoying. The only way to get rid of them once they get into this state seems to be to close the entire window (or quit sublime text completely): they persist through scrolling, clicking, pressing escape, and even closing the tab. See the video capture below:

sublime-text-typescript-popups-stuck

I'm running the latest ST4 build (4088) if that is relevant.

turbo commented 3 years ago

Repro'd with ST4 on Ubuntu. Sometimes many (dozens) are stacking over each other when navigating within one function header.

Also, this isn't intermittent. I just need to actually write a function (e.g. .forEach(, console.log( etc), which will of course always trigger the popup which will then get stuck (always).

ro-ka commented 3 years ago

Same on Mac, latest build (4088). Not sure but I think it emerged with build 4087.

See stacking: st4-hints

jamwaffles commented 3 years ago

I've been having this issue for a while too. I left a bug report at sublimehq/sublime_text#3719 which describes a repro case if anybody needs that for testing.

nicoburns commented 3 years ago

For anyone else encountering this issue: I was able to work around it by replacing this TypeScript plugin with lsp, lsp-typescript, and TypeScript-Syntax which combine to give similar functionality. Bonus: this plugin was using ~40% cpu per instance on my MacBook, whereas the lsp version doesn't seem to have that issue.

wbond commented 3 years ago

My hunch would be some interplay with re-displaying the popup in the on_hide callback:

https://github.com/microsoft/TypeScript-Sublime-Plugin/blob/ab51614c07db60dd674d6d9905f74c03d1c35473/typescript/libs/popup_manager.py#L172-L179

If someone has this toolchain setup and wouldn't mind some debugging, that could be useful to know.

Most likely there is some interplay between the code in this plugin and code that is causing these to remain stuck open.

iahu commented 3 years ago

Can i bind a key to hide all popup ?

wbond commented 3 years ago

It did end up being an issue that showing a popup in the hide callback was the issue. We've solved this in core with build 4095.

hrasekj commented 3 years ago

I'm still having this issue on ST4 build 4097.

wbond commented 3 years ago

I'm still having this issue on ST4 build 4097.

If you can open an issue on our issue tracker with exact steps to reproduce, that would be helpful. Please be sure to include steps on how to configure the plugin appropriately and source code that will trigger it. In other words, try to make it so someone who doesn't use TypeScript can reproduce easily.

hrasekj commented 3 years ago

It did end up being an issue that showing a popup in the hide callback was the issue. We've solved this in core with build 4095.

@wbond now I'm not sure if I got correctly what you said.

Are you sayng, that you fixed issue with popup hide callback in ST core build 4095, and hence fixed this issue with hovering popups, or just fixed popup hide callback, so its possible to fix this issue?

Becouse if it's second option my comment have no point at all and there is no need to open issue.

wbond commented 3 years ago

As far as I know, the "stuck" popups were fixed in build 4095. Before build 4095, if a plugin called show_popup() in the on_hide callback, a reference to the popup would be lost, and thus it would be stuck open. The bug I identified should be fixed in build 4095.

Your comment said you've experienced this in build 4097, so I am asking if you can open an issue with a way to reproduce.

Depending on what you are seeing, it could be a Sublime Text issue, or not. If you can get more than one popup open at a time, that would indicate a bug in Sublime Text. If the issue is that in TypeScript it keeps popping the window open, you may be running into the issue that this plugin will re-show its popups in the on_hide handler sometimes.

oprearocks commented 3 years ago

@wbond I managed to get multiple popups to open (and remain stuck) at the same time.

Screenshot 2021-04-07 at 12 37 55 AM

Later edit:

10 minutes after publishing this I got an update to Build 4101 and I can still reproduce the issue.

image

wbond commented 3 years ago

If you want to post an issue with some steps to reproduce on our issue tracker I can help.

oprearocks commented 3 years ago

Thanks for being so quick @wbond . Created this issue ⬆️