visortelle / haskell-spotlight

VSCode extension for Haskell
https://marketplace.visualstudio.com/items?itemName=visortelle.haskell-spotlight
MIT License
108 stars 3 forks source link

VSCode Extension Feedback #11

Open visortelle opened 2 years ago

visortelle commented 2 years ago

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

yutotakano commented 2 years ago

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.

visortelle commented 2 years ago

@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. 😆

why-not-try-calmer commented 2 years ago

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.

Sorokin-Anton commented 2 years ago

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)

niekvandepas commented 2 years ago

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.

visortelle commented 2 years ago

@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. 🙂

niekvandepas commented 2 years ago

@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 :)

visortelle commented 2 years ago

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
epicallan commented 2 years ago

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?

visortelle commented 2 years ago

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. 🙂

goldfirere commented 2 years ago

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!

visortelle commented 2 years ago

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

mip29 commented 2 years ago

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?

visortelle commented 2 years ago

@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

KristianBalaj commented 2 years ago

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.

visortelle commented 2 years ago

@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. 🙂

KristianBalaj commented 2 years ago

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

visortelle commented 2 years ago

@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.