How to registerCompletionItemProvider (and avoid duplicates)?
See original GitHub issueRight now, I’m calling monaco.languages.registerCompletionItemProvider in the editorDidMount method. How would I prevent adding multiple completion providers if this component continuously gets mounted and unmounted? It doesn’t appear that monaco provides a unregister method and editor.dispose doesn’t remove additions made to monaco.languages
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
Duplicate Completion Item Provider - monaco editor
registerCompletionItemProvider is defined. If it is, I do not define it again, eliminating duplicate completions.
Read more >Frontend: Add predefined variables to the linter schema - GitLab
I guess the only option we have now is to duplicate the list of predefined variables in frontend as we do in the...
Read more >Use monaco-editor and registerCompletionItemProvider to ...
Use monaco-editor and registerCompletionItemProvider to register multiple times, which eventually leads to duplicate content of the displayed ...
Read more >VS Code API | Visual Studio Code Extension API
registerCompletionItemProvider (selector: DocumentSelector, provider: ... that cause or related to a diagnostics, e.g. when duplicating a symbol in a scope.
Read more >Show results from both word based suggestions and own ...
That is to avoid duplicates and spam. The doc comment of registerCompletionItemProvider() is still the same, so I don't think anything has ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
nevermind, answered my own question.
registerCompletionItemProviderreturns anIDisposablewith thedisposemethod which I can call on unmountHello @nickav , I ran into the same issue about
registerCompletionItemProvidercreating duplicates of my suggestions. However, I tried saving theIDisposableinto a variable and usingdispose()on unmount, without success.Here is my code :
I get an error
TypeError: completionDisposable.dispose is not a functionanytime I leave the page.Do you remember how you managed to dispose of the completionItemProvider ? Thanks in advance