-
Notifications
You must be signed in to change notification settings - Fork 39
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
Some completions not shown on pressing dot while handling dynamic completions #4855
Comments
As observed in the issue that bothers gopls users, it's not so much that the completion popup is closed on pressing This plugin demonstrates the issue better: import sublime
import sublime_plugin
from sublime import CompletionItem, CompletionList
class CompletionListener(sublime_plugin.ViewEventListener):
def on_query_completions(self, prefix, locations):
if prefix in ('f', 'fm', 'fmt'):
completions = [
CompletionItem('fmt.module', annotation='"fmt"', kind=(3, 'm', 'Method'))
]
elif prefix == '':
completions = [
CompletionItem(kind=(3, 'm', 'Method'), trigger='PASS'),
CompletionItem(kind=(3, 'm', 'Method'), trigger='fmt.ONE_COMPLETIONS_IS_A_FAIL-TWO_IS_A_PASS'),
]
else:
return
completion_list = CompletionList()
completion_list.set_completions(
completions,
flags=sublime.DYNAMIC_COMPLETIONS | sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
return completion_list To trigger the faulty behavior, type Also note that manually triggering completion after the dot triggers both completions. Screen.Recording.2021-11-16.at.21.05.24.mov |
Is there any progress on this bug? This bug has been annoying for more than a year. |
Any progress on this? This has been an issue since at least Aug 2021... |
@alecthomas @pelemarse There's a MR for a fix. |
@quapo merge request |
Fixed in build 4132. |
I'm not able anymore. |
Can you please take a look, @BenjaminSchaaf ? |
Can someone please re-open? |
Is there any plans to reintroduce the fix for the bug? I'm affected by this bug. |
Hey @BenjaminSchaaf, I see there are new Sublime Text releases in October. Would it be possible to prioritize this bug fix? I can't upgrade because this bug still remains in the latest versions, and it's quite an annoying one for UX. |
Description
The completions popup behavior is potentially non-ideal when pressing
.
during handling of the completions shown with theDYNAMIC_COMPLETIONS
flag.This use case is straight from LSP where a server might return completions like
aa.MethodA
but once the user typesaa.
, theon_query_completions
is triggered with empty prefix and then the server returns justMethodA
completion. So in that case it would be natural to be able to see that completion but ST closes the completion popup on pressing the dot.Steps to reproduce
Python
for exampleaa
.
(dot)Expected behavior
That the completion popup opens (or stays open) and shows the
MethodA
item.Actual behavior
The completion popup closes.
Environment
The text was updated successfully, but these errors were encountered: