-
Notifications
You must be signed in to change notification settings - Fork 3.6k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
I didn't find a way to show some custom suggestion as well as Monaco default suggestion. #1850
Comments
I don't believe 3 is currently doable. But from reading the code here -- https://github.com/microsoft/vscode/blob/8758dc9dddf95f358eb93c969353e5cf245ed1e4/src/vs/editor/contrib/suggest/suggest.ts#L180-L181 -- I can deduce that the word completion provider is in a different group than the custom completion provider and once you return a result, the process stops and it doesn't get invoked. I could not figure out what creates the grouping, but I can see here -- https://github.com/microsoft/vscode/blob/8758dc9dddf95f358eb93c969353e5cf245ed1e4/src/vs/editor/common/services/editorWorkerServiceImpl.ts#L76 -- that the word completion provider is registered with You could potentially try to register your completion provider with |
Thanks for the help. I will look into this. |
hi, akshay-zz, did you find any ways to solve this problem? |
I meet this same problem in my project!wish your repley, thx! |
Right now I'm not working into this. But soon will try to achieve this as per hint given by @alexdima . |
I think something like this could help. I haven't tested the else part. Right now I'm not working on this. But if someone can try to achieve this and share with us, then that would be great. Even thought this trick does not satisfy third case completely. But I think this will help and by doing little work around by summing up word suggestion and server suggestion we can achieve the third case.
Haven't tested else part and quite sure will fail. Just added to give a approach if anyone love to work on this. Else part code is taken from here |
@akshay-zz This code is not working as the 'this' in |
@Pranomvignesh I never said it will work. |
@akshay-zz I just added my point about |
Has any one able to find a solution for this ? I am also stuck looking for a solution for scenario 3. |
I came up with this hack...not the most efficient, but does the job. https://gist.github.com/cnayan/23cfde150a83f33a5e4da3b59284ea2b |
The below simple method (could be a hack ) worked for me without much tweaking and merging. Copy paste to monaco playground to check it in action. I used the "range" property. I had to disable consistent-return of eslint as there is nothing in the else part of the "if" check ( I believe you can return empty array [] there and check ).
There could be some unseen issues, but this could be a good starter for someone looking for a solution. |
Hello,is there a good solution for this issue? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Actually I'm looking into a way in which I can achieve all these following cases.
1 - I can provide only custom suggestions. If no suggestion is present. Then nothing(blank) should be shown as suggestion.
2 - I can provide only Monaco default suggestion(words existing in the editor).
3 - I can provide custom suggestion + Monaco default suggestion(words existing in the editor).
What's the current existing behavior?
1 - I can achieve first case by returning a suggestion or a blank suggestion.
2 - I can achieve second case by not returning any suggestion(not even the blank suggestion object).
Is there's a way to achieve third case?
The text was updated successfully, but these errors were encountered: