Skip to content
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

[Bug] "No suggestions." shown when suggestions are provided at end of current token #4553

Open
1 of 2 tasks
slztfn opened this issue Jun 10, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@slztfn
Copy link

slztfn commented Jun 10, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.49.0#XQAAAAJTAwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw4GI5RgmSaumWUF-TBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKirq6H8R1sHX5qayINxsoff0wuywYId6sDsEfNAhivoMXmfLo3VYoGKrnFKqg0QpFSFviH8VIQzHmsC81P5EDM2y-7_NgUUxaeJJWPufd__bJN2aCQ_oVie_u5zVMD2jKACHAtVID4K-rhOe-rixeIsU6ydi2Amw4c0srV6DUXzn4bFLfn1CvC5lEipHbi0CShJSWaLxHokvh1aZhY_oTmy4VmvgNboGdVxq4I75ENgtr4hlFSzwU9SAENLyddXeM666y9HpNfbL6ZLbciuWPVxu_k_6xKkbumgcCf1r-6KUuhlzlzSLnh93kpEkYMwFyTaWGzVcl2i9zXvm6b5hZnHSXZ5q6jVFey3gytCcR4_gxZuAKk3oVlJMqNQrqu5F_dQA_qimwh7f0yM7XSOHuzyJohwwFuMuiX9X9dAaIqQsAo2tN4DHUPcbdFMHIOTOR5Ax0PSJ5PsQ_eF8fkk2MWuUeW3ZajlvhHRPWXG-7qP94CVgA

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `select *
from dd
where a = dd -- no suggestions shown if cursor at end of dd
or a = '89' -- no suggestions shown if cursor is after 9`;


monaco.languages.registerCompletionItemProvider("sql", {
	provideCompletionItems: () => {
		return {
			suggestions: [{
				label: 'aaa89aa',
				insertText: 'aaa89aa',
				filterText: 'aaa89aa',
				kind: monaco.languages.CompletionItemKind["Keyword"],
				range: undefined,
			},{
				label: '::',
				insertText: '::',
				kind: monaco.languages.CompletionItemKind["Keyword"],
				range: undefined,
			}]
		}
	}
})
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "sql",
	automaticLayout: true,
});

Reproduction Steps

place cursor at end of tokens as described and press Ctrl+Enter to trigger suggestions

Actual (Problematic) Behavior

"No suggestions." is shown

image
image

Expected Behavior

Show the provided suggestions

image

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant