Skip to content
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

Suggestions not appearing #4

Closed
borekb opened this issue Jul 23, 2018 · 15 comments
Closed

Suggestions not appearing #4

borekb opened this issue Jul 23, 2018 · 15 comments

Comments

@borekb
Copy link

borekb commented Jul 23, 2018

@TomasHubelbauer

I've tried on a couple of repos, including our public one but also several smaller, and I never get suggestions as in the GIF in README.

I've tried in an empty VSCode with only this extension enabled. Not sure what I could be doing wrong.

VSCode 1.25.1 and 1.26.0-insider
Extension version: 7.0.3 (and also reproducible with previous versions)

@TomasHubelbauer
Copy link
Owner

TomasHubelbauer commented Jul 23, 2018

I can get the list of suggestions to appear. I am not sure what could be the cause of your issue. Would you be willing to install my extension (with log collection added) from a VSIX and send me the log afterwards?

@borekb
Copy link
Author

borekb commented Jul 23, 2018

Yes, sure. I should have noted that I invoke suggestions manually via Ctrl+Space if that matters.

@TomasHubelbauer
Copy link
Owner

I see. This uncovered a bug I will fix, I didn't account for that trigger kind. You end up seeing the default VS Code list of suggestions which only give you keywords picked out from the repository context, right? Like this:

image

@borekb
Copy link
Author

borekb commented Jul 23, 2018

Exactly.

@TomasHubelbauer
Copy link
Owner

TomasHubelbauer commented Jul 23, 2018

I have cut a new release, 7.0.4, you should see it up soon. Ctrl + Space (or any remapped shortcut for the suggestion triggering command) will now work as expected.

Please be aware that this still only triggers after ( (and [ if enabled). I will need to do more work to allow it to work at arbitrary places (both within ( and ) and at any place in the document, where it would recognize no link syntax has been typed yet and would build it up).

It's doable, but will require me to correctly parse out existing paths at the suggestion point (if any) and make the suggestions relative to that path, which is not a use case I have needed yet, so I haven't implemented it for myself.

If you would benefit from that being supported, I will be more than happy to implement it.

Please let me know if 7.0.4 fixed your issue.

@borekb
Copy link
Author

borekb commented Jul 23, 2018

I don't see the new version yet, has it been published already?

@TomasHubelbauer
Copy link
Owner

Mea culpa, please retry.

@borekb
Copy link
Author

borekb commented Jul 23, 2018

I have to admit that our repo is a bit bigger but still, this is the first time I've seen VSCode crash as it was trying to load the path suggestions 😄

image

@borekb
Copy link
Author

borekb commented Jul 23, 2018

On a smaller repo, it works nicely!

@TomasHubelbauer
Copy link
Owner

TomasHubelbauer commented Jul 23, 2018

LOL! I'm sorry about that, I do have a very old to-do item about caching the repository file index and header index, looks like it is high time to resolve it.

Unfortunately VS Code doesn't support loading in the suggestions asynchronously because of unresolved UX questions around that behavior, so I need to materialize the index first.

First-time suggestions experience (before the index is ready) still needs to be taken into account, but I am confident I will find a nice compromise there (say not waiting for the header index and just show file index, which is much faster to generate).

@borekb
Copy link
Author

borekb commented Jul 23, 2018

Does it suggest every file in the workspace? Sort of like quick pick?

@TomasHubelbauer
Copy link
Owner

TomasHubelbauer commented Jul 23, 2018

Yes, it suggests all file and directory paths in the repository and for MarkDown files, it also suggest their headers.

I designed the extension this way, because in my use-case, I often need to just start typing a file name I know is in the repository, but do not want to type the full path for. For that to work with VS Code, I need to generate a list of all possible filter strings, hence the list of all possible files to suggest.

I think it can be made work fast while still preserving this behavior, but if it proves too challenging, I might consider introducing a setting which would allow to suggest from current file's directory only and if the chosen suggestion was a subdirectory path, it would append a / at the end and I would add another trigger character, the / so that new suggestion list would appear with items from the slashed-into subdirectory.

@borekb
Copy link
Author

borekb commented Jul 23, 2018

That sounds great.

For suggesting all files in the workspace, isn't it possible to somehow tap into the quick pick UI and let VSCode do the hard work? Probably not, right?

@TomasHubelbauer
Copy link
Owner

I will make sure to consult the API again now that we have new releases to see if there is a way to get the information I need (or at least portions of it) from VS Code proper, that would make my extension much simpler.

However I don't think there is a way, because the extension API is more high-level than that.

I do need a solution for repository/workspace level caching anyway for my other extensions, so I will make that into a shared component, but I don't think there is a way fully around it.

@TomasHubelbauer
Copy link
Owner

I will close this in favor of a new, better focused, issue #7 I just created to track specifically the performance issue. The problem with the trigger character I believe was resolved. Please feel free to report any further annoyances and I will do my best to fix them speedily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants