atom-ide-datatip icon indicating copy to clipboard operation
atom-ide-datatip copied to clipboard

Hyperclick inside datatip

Open aminya opened this issue 5 years ago • 3 comments

It would be nice if:

  • [ ] we can click on the types that are shown inside the datatip.
  • [ ] have atom-ide-definitions features in the datatip
  • [x] the URLs are clickable. -> fixed

aminya avatar Apr 03 '20 09:04 aminya

@UziTech Can we make the hyperlink working inside the datatips?

aminya avatar Jul 22 '20 10:07 aminya

hyperclick only observes TextEditors right now. If there was some way to observe when a datatip is created we could observe them too.

UziTech avatar Jul 22 '20 14:07 UziTech

It should possible to observe them. If not we can just make them simple hyperlinks so user can click on!

There are three types of datatip: React, HTML, Snippet. All of them are converted to some HTML in the end for rendering. So we can add Hyperclick capability after the final rendering. We can use renderToStaticMarkup to convert it to text if that is more suitable.

https://github.com/atom-ide-community/atom-ide-datatip/blob/471fe8036b853079530105c63d968ec20eae3d00/lib/datatip-view.js#L148

Instead, we can do this individually for the three types. That might be easier. In that case, we will only need static markup rendering only for the react-dom (which we are already doing it anyway). For HTML and Snippet types, the content is simple.

https://github.com/atom-ide-community/atom-ide-datatip/blob/471fe8036b853079530105c63d968ec20eae3d00/lib/datatip-view.js#L27 https://github.com/atom-ide-community/atom-ide-datatip/blob/471fe8036b853079530105c63d968ec20eae3d00/lib/datatip-view.js#L69 https://github.com/atom-ide-community/atom-ide-datatip/blob/471fe8036b853079530105c63d968ec20eae3d00/lib/datatip-view.js#L103

We might want to fix #60 first though.

aminya avatar Jul 22 '20 17:07 aminya