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
Providing ISingleEditOperation in CompletionItem #81
Comments
(I'm aware that the above might not quite provide enough information about the issue - I'm hoping that Monaco experts might immediately spot what I'm doing wrong - but if no, let me know and I can try to create a simple shareable repro.) |
The text edit you return is a single edit operation - so you are on the right path. By default, when you don't give a text edit, we basically build an edit from the current word range until position and the label of the suggestion. Then, the editor compares the text that got selected by the edit and compares that against the label or filterText. In your case it like this: |
Well, this is is embarrassing. So it was all just off-by-one error. Works great now. If you want to see it in action, click on "source" in any of the visualizations here: http://rio2016.thegamma.net 👍 |
@tpetricek I saw the website a couple of days ago! Very cool! 👍 |
I'm trying to implement
CompletionItemProvider.provideCompletionItems
and I would like to explicitly specify the edit operation - this is because the language allows identifiers with spaces and so the completion needs to replace text in a range that may include spaces (the default mechanism does not seem to work in this case - it probably searches for the last space and inserts the text there (?)).However, no matter what I do, I get "No suggestions":
The completion items that I'm returning look like this:
When I do not set
textEdit
, the completion list shows possible completions just fine (but it inserts text badly when the completion involves spaces). In the screenshot, I setfilterText
andinsertText
, but when I do not do that, the result is the same.Am I doing something obviously wrong here? Is there a working sample of using
textEdit
somewhere?PS: Also, is this the right place to ask questions like this, or do you have another recommended channel?
The text was updated successfully, but these errors were encountered: