browser-ext-github-monaco
browser-ext-github-monaco copied to clipboard
Mention autocomplete has stopped working
When I try to mention someone in a comment, no usernames show when I type @
. In developer tools I see requests go out when I type @
, and results come back in the response, but no results show in the UI.
I noticed that too. Can you investigate why this doesn't work anymore?
I don't think I'll have the time to do this. Any tips on where to start?
@hediet I'm not sure how I triggered it, but this just worked once just now. Can't get it to work again though
Also fails for mentioning issues/PRs after inputting a pound symbol. Not familiar with Chrome extension development and only slightly more familiar with async generators so haven't had the time to grok exactly how it works but I can at the very least see that issueUrl
may not be being correctly set anymore.
Here is the error I'm seeing when I try to edit a PR in my work repo -- this.api.getIssueSuggestions
appears to be returning undefined
, and i.issueUrl
(i
is some minified identifier) is also undefined.
When I try to invoke the issue mention dropdown in this very comment, the dropdown fails to appear though I see a slightly different error in the console (maybe since this is the Issue page and not the PR page):
Once again issueUrl
is undefined and you can see that in the outgoing request URL to the Github API.
and only slightly more familiar with async generators
@vbarrancos The complied/minified code is using generators, but the source code is just using async/await
here:
https://github.com/hediet/browser-ext-github-monaco/blob/8153bf357b8bd5c96bf9567bfae88afe2872c4ae/src/content-script-main/GitHubCompletionController.ts#L70-L90
If urls.issueUrl
is blank, then there must be an issue with how urls
or its fields are getting set.
Maybe try putting a debugger
statement on line 27 in the block below, to see if registerUrls
is being called and with what arguments:
https://github.com/hediet/browser-ext-github-monaco/blob/8153bf357b8bd5c96bf9567bfae88afe2872c4ae/src/content-script-main/GitHubCompletionController.ts#L23-L28
Interestingly, I can see in the Network tab that calls are being made to the correct URLs, and JSON is getting returned. Are these calls made by the underlying textarea on the GitHub page, rather than by the Monaco text box?
(I'd love to see this fixed; it's my only real issue with the extension.)
Is there anything I can do to help troubleshoot this further? Debugging Chrome extensions isn't really my thing, but I'll do what I can. Would love to see this fixed.
I did some more poking around. In my case, the issue was complicated by the fact that I had enabled the beta Slash Commands feature in GitHub. This seems to change the value of this.editorRoot
to a slash command provider, which is why the mention and issue urls weren't present in dataset
. When I disabled this feature, I was able to see the expected urls, and now registerUrls
is getting called with the expected arguments.
However, I'm still not getting suggestions. I set a breakpoint in provideCompletionItems
, and that breakpoint never gets hit, even though a breakpoint in the constructor for GitHubCompletionController
shows that the trigger characters are getting registered. (And even though the Network tab shows that requests are going out to the suggestions endpoint.)
I can see in the debugger that the text-expander
is still capturing and processing the @
and #
keystrokes.
Okay, time for me to eat crow. After noticing that mention and issue autocomplete was working for me on a different computer, I started comparing extensions, and then comparing settings, and it turns out that on my main machine I had turned off "Suggest on trigger characters" in the settings for this extension. When I turned it back on, the feature started working again. Go figure.
(I think when I first installed the extension I was annoyed by the regular word suggestions that were popping up as I typed, and without a good guide to what the settings all do, I just started turning off things that were related to suggestions.)
I've confirmed that I have Suggest on trigger characters
enabled, but this is still broken for me. I would say this works for me 1 out of 200 times (generally never but sometimes does for some reason). No clue what makes it work sometimes. @vbarrancos Any luck on debugging this?