haskell-spotlight icon indicating copy to clipboard operation
haskell-spotlight copied to clipboard

VSCode Extension Feedback

Open visortelle opened this issue 2 years ago • 18 comments

Please check out this comment first: https://github.com/visortelle/hackage-ui/issues/2#issuecomment-1015828207

https://user-images.githubusercontent.com/9302460/150015894-fe62ea7d-9a45-4e31-842a-e60ae8747970.mov

visortelle avatar Jan 18 '22 20:01 visortelle

I've played around with it (simulating some searches I might do during actual development) and it's quite useful! With the combination of Haskell Language Server hover documentation, it improves how quickly I can experiment around with new functions and understand existing code.

There is a bit of a sharp end on the right of function descriptions when it is expanded, meaning some of the text is not visible (and there is no indication that there are more) unless the window is wide enough. Perhaps we can improve this with ellipsis in the text, or a shadow/border in the package list.

https://user-images.githubusercontent.com/60749079/150029987-7a731d12-c3d2-416f-8ebd-44c0cf1249c3.mp4

EDIT: I just realised that the website version also suffers the same problem when the viewport is not wide enough.

yutotakano avatar Jan 18 '22 22:01 yutotakano

@yutotakano thank you for the bug report!

The browser extension, VSCode extension, and the site version use the same React component. Bugs and features across them will be eventually consistent. 😆

visortelle avatar Jan 18 '22 22:01 visortelle

quoting from this reddit comment:

Can you make it so that the Haskell Spotlight tab closes automatically when it loses focus? I generally dislike it when extensions open new tabs that take so much space.

why-not-try-calmer avatar Jan 19 '22 10:01 why-not-try-calmer

For me it would be a good option that if some code was selected when I press Alt-H, it would be instantly hoogled (for example, I see unknown function in code, then I select it, and press Alt-H, without Ctrl-C/etc)

Sorokin-Anton avatar Jan 19 '22 11:01 Sorokin-Anton

I would personally prefer if the extension showed up in a modal (similar to VS Code's Command Palette) rather than in a separate tab.

niekvandepas avatar Jan 19 '22 12:01 niekvandepas

@NiekPas me too, but as I know, it's not possible to implement in VSCode for this moment. The extension is a subproject of the HackageUI project and I don't have enough bandwidth now to reimplement it using native VSCode widgets.

Also, I don't really know examples of any good working extensions with similar functionality for VSCode that use native UI. Not so long time ago I moved from Emacs to VSCode, maybe I missing something. If anyone knows such, please share. 🙂

visortelle avatar Jan 19 '22 12:01 visortelle

@visortelle Ah, I wasn't aware of that limitation. That's unfortunate, and seems like something that would really limit the usefulness of some extensions. Perhaps it's a security restriction of some kind.

I did a quick search of the VS Code issues and found nothing, so perhaps something it could be suggested there --- although I wouldn't expect it to be implement by end-of-day. 😄

In any case, thanks for making this extension! It's good to see some (frankly, much-needed) progress in the Haskell DevEx :)

niekvandepas avatar Jan 19 '22 12:01 niekvandepas

I would personally prefer if the extension showed up in a modal (similar to VS Code's Command Palette) rather than in a separate tab.

Relevant issue: https://github.com/microsoft/vscode/issues/112031

Almost a year ago it has been moved to the backlog. 🤞

Screen Shot 2022-01-21 at 9 29 09 AM

visortelle avatar Jan 21 '22 08:01 visortelle

hi @visortelle, thanks for the extension, I really like it. I have a question though, would you consider adding searching using a local hoogle DB or local pre-built haddock docs?

epicallan avatar Jan 24 '22 15:01 epicallan

hi @epicallan and thank you for feedback!

would you consider adding searching using a local hoogle DB

I didn't consider this option, but it's not hard to implement. Probably it's a good idea.

In the next few weeks, I'll dedicate a day or two to the VSCode extension improvements.

Collecting more feedback. 🙂

visortelle avatar Jan 24 '22 15:01 visortelle

Just tried this out today. I really like it!

My suggestion would be to have a way to open links within VSCode. For example, I wanted to see the Data.Text module. I searched for Data.Text. But then when I clicked, I was taken to my separate browser. Maybe make this somehow user configurable?

Thanks for your work here!

goldfirere avatar Jan 25 '22 17:01 goldfirere

@goldfirere thank you for the feedback! I considered this option. Will implement soon. 🙂

visortelle avatar Jan 25 '22 18:01 visortelle

Not sure if this is the correct place to ask, but would it be possible to publish this extension to open-vsx.org for vs codium users?

mip29 avatar Feb 13 '22 21:02 mip29

@mip29 I tried login in at open-vsx.org, but it wants to read my private profile information 😱

Screen Shot 2022-02-14 at 7 10 00 AM

If you want, you can publish it under your own account.

All you need is NodeJS > 14.x.x. https://nodejs.org/en/download/ Clone the repo, then cd vscode-extension && make build

visortelle avatar Feb 14 '22 06:02 visortelle

I love this extension, an absolute time saver 👍

I have a suggestion. There is a significant delay until all search results appear (up to 2s even on 1Gbs network connection). I find myself searching for the same functions multiple times and it would be nice if the results would be cached, and thanks to caching showed immediately without waiting for an API response.

EDIT: Caching also between "sessions", so even after closing/reopening the spotlight tab. Because, I'm using it in a way of opening, searching and then closing the tab.

KristianBalaj avatar Feb 20 '22 12:02 KristianBalaj

@KristianBalaj, thank you for the feedback.

You are right - latency is probably not as low as it could be. Now each request makes the following trip around the world 🌎🤠:

Your PC (let's say you are in Europe) --> API Proxy to pass CORS (US region) --> haskell.hoogle.org (GeoIP database says it's in Dublin, Ireland. But wouldn't be 100% sure here) --> Your PC (back to Europe)

Caching may be the solution, but instead of dealing with it, I'd rather try to bring API closer to a user and remove extra hops by hosting a Hoogle instance for each region.

I'll think about it later. Right now busy with other activities. 🙂

visortelle avatar Feb 20 '22 14:02 visortelle

Hey! Wondering if it is possible to search in some other Haddock than the official one (Probably a setting where i would input multiple hosts where all of them are used when searching).

I'm interested in the Plutus Haddock - it runs on a separate hosting. It would be nice to have it in the Spotlight along with the types search.

https://playground.plutus.iohkdev.io/doc/haddock/index.html

KristianBalaj avatar Mar 24 '22 12:03 KristianBalaj

@KristianBalaj Hello. It's probably the same request as the request to specify a custom Hoogle instance (or multiple instances) https://github.com/haskell-spotlight/haskell-spotlight/issues/11#issuecomment-1020241531

If Cardano guys have such running Hoogle instance, it would be possible to search over their docs.

The ability to configure Hoogle instances to search over them isn't hard to implement, but I don't have the bandwidth at this moment to do it.

visortelle avatar Mar 24 '22 12:03 visortelle