microsoft / microsoft/debug-adapter-protocol
Modify or clarify the CompletionItem description to match de facto usage
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 173
- Avg merge
- 7d 7h
- Merged PRs (30d)
- 2
Description
I'm implementing completion in my client, and after testing a bunch of servers have found that the de facto implementation of the DAP client does not seem to match the spec, meaning that just implementing the spec leads to it not working properly.
The spec seems pretty clear that if the start property is not supplied, then the text should be inserted at the position completion was requested:
- If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.
However, in my testing I have found 3 classes of behaviour:
startandlengthare supplied.startis reliable (https://github.com/microsoft/debugpy)- neither
startnorlengthare supplied. The server seems to assume that client will magically decide the completion starts at the beginning for the current word (however that is defined) (https://github.com/microsoft/vscode-node-debug) startis supplied, butlengthis not.startis unreliable (https://github.com/microsoft/vscode-java-debug)
Specific example of 2.: https://github.com/puremourning/vimspector/issues/245#issuecomment-686793337
I believe this is the VSCode code that handles DAP completion items: https://github.com/microsoft/vscode/blob/6f223f2823ae66a2399ee3b03ffaea8fcad393e5/src/vs/workbench/contrib/debug/browser/repl.ts#L156-L177
In particular the overwriteBefore behaviour seems to be incorrect WRT to the current specification. I realise that I could report this as a VScode bug, but my guess is that it's actually a specification error, on the basis that the majority of servers seem to fall in the category of not supplying start/length, but (presumably) working in VScode.
Assuming I understood all of that correctly, could we either:
- confirm that the spec is correct and VSCode and most servers are wrong, or
- update the spec to be clear about what clients should do with CompletionItem
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.