Open lmvco opened 4 years ago
It's even easier to reproduce. Just type foo.
into the playground editor directly after the sample code and trigger suggestions https://microsoft.github.io/monaco-editor/playground.html. Since you can't infer anything there (foo
is of type any
as far as the language server is concerned) the editor shows you words used in the document to be at least a little helpful.
I thought these were word-based/quick suggestion but neither wordBasedSuggestions: false
nor quickSuggestions: false
make a difference so I'm actually not sure anymore.
I thought these were word-based/quick suggestion but neither wordBasedSuggestions: false nor quickSuggestions: false make a difference so I'm actually not sure anymore.
Ah, that's because of #1980
Yep, just confirming this is a response from the typescript side:
{"seq":0,"type":"response","command":"completionInfo","request_seq":24,"success":true,"performanceData":{"updateGraphDurationMs":5.120795011520386},"body":{"isGlobalCompletion":false,"isMemberCompletion":true,"isNewIdentifierLocation":false,"entries":[{"name":"alert","kind":"warning","kindModifiers":"","sortText":"7"},{"name":"foo","kind":"warning","kindModifiers":"","sortText":"7"},{"name":"hello","kind":"warning","kindModifiers":"","sortText":"7"}]}}
If someone wants to solve this they'll need to add a flag to the UserPreferences
type in TypeScript which surpasses passing file identifiers JS, get that shipped in a TS release and then have monaco-typescript support setting the new option if wordBasedSuggestions
is false
monaco-editor version: 0.20.0 Browser: Chrome OS: Windows Playground code that reproduces the issue:
I was only able to reproduce this when registering a completion item provider which return completion items with dots in the label/insertText.
Repro steps:
param
and choose the optionparameters.In1
type
Result: The completion menu shows an option "parameters" which was not returned by my provider neither exists in the Javascript language.See the gif below: