browser-ext-github-monaco icon indicating copy to clipboard operation
browser-ext-github-monaco copied to clipboard

Mention autocomplete has stopped working

Open mickmister opened this issue 1 year ago • 11 comments

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.

mickmister avatar Mar 22 '23 14:03 mickmister

I noticed that too. Can you investigate why this doesn't work anymore?

hediet avatar Mar 22 '23 16:03 hediet

I don't think I'll have the time to do this. Any tips on where to start?

mickmister avatar Mar 22 '23 20:03 mickmister

@hediet I'm not sure how I triggered it, but this just worked once just now. Can't get it to work again though

mickmister avatar Apr 03 '23 21:04 mickmister

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

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

Once again issueUrl is undefined and you can see that in the outgoing request URL to the Github API.

vbarrancos avatar Apr 06 '23 14:04 vbarrancos

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

mickmister avatar Apr 14 '23 02:04 mickmister

image

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

asherber avatar Jun 27 '23 19:06 asherber

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.

asherber avatar Jul 21 '23 13:07 asherber

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

asherber avatar Jul 22 '23 13:07 asherber

I can see in the debugger that the text-expander is still capturing and processing the @ and # keystrokes.

asherber avatar Jul 22 '23 18:07 asherber

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

asherber avatar Jul 27 '23 18:07 asherber

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?

mickmister avatar Aug 07 '23 00:08 mickmister