-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Completion after Enter or paste #918
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
Comments
You could implement this by:
|
Thanks @alexandrudima ! It's workable to listening How to trigger suggest specific
|
What you show consists of two pieces:
|
Thanks for your reply! Can you give me a simple example how triggering suggestions by I don't know how to trigger |
For each completion item, you would use the At least I think that's how that should work. We can ask @jrieken for further help if it does not. |
Thank @alexandrudima, you helped me find the key to solving the problem! But i still need help because nothing happens when choose any completion item when using this code: resolveCompletionItem(item: monaco.languages.CompletionItem) {
item.command = {
id: 'editor.action.triggerSuggest',
title: '123'
};
return item;
} What should i trigger new suggestion when choose completion items, and set custom suggest items? @jrieken I would like to get your help very much! |
The command id is correct and I know that css uses this successfully. Try setting the command during |
Hello @jrieken , i add provideCompletionItems: () => {
return [{label: 'test', command: {id: 'editor.action.triggerSuggest', title: 123}}]
} |
Something always happens ;-) Is it that your provider isn't called or that your completions aren't showing? Is there an error? You can debug this on |
Thank you for your quick reply, but I'm still in doubt. When trigger |
Yes. You don't trigger the command you tell the editor to trigger the command once a completion is selected and then that will eventually call |
Thanks, i'll try it. |
Thanks @jrieken ! It now works fine! Another question, how can i change point position after a completion is selected? I want both trigger |
Use a |
Thanks @alexandrudima and @jrieken! All works fine for me now! |
@ascoders I'm going through a similar use-case. Would it be possible for you to share some gist on how you used Editor APIs? |
@suhasdeshpande What's your problem? |
@alexandrudima @jrieken |
+1 would love to see a final code example solution for this. I've got a very similar usecase but even though my completionItemProvider is returning suggestions, they are in some cases either not triggering the suggestion widget at all, or if manually triggered, widget displays "No suggestions" even though I can see the suggestions logged to console. Seems it will only actually display the suggestions if there is a space preceding the suggestion trigger. |
How to resolve this problem since |
I was able to generally get this working fine by adding a space to the end of each suggestion item. |
monaco-editor version: 0.13.1
Browser: Chrome
OS: Mac
Steps or JS usage snippet reproducing the issue:
Hello there! If there is a way to make editor request completion items after the "enter" or "cmd+v" was typed?
For dot using
triggerCharacters: ["."]
, but how to trigger completion after "enter" or "cmd+v"?The text was updated successfully, but these errors were encountered: