Skip to content

Completion response says "isIncomplete": true even when the total number of completion items is two #7649

@bstaletic

Description

@bstaletic

Yesterday (so 11. 02. 2021.) I updated rust-analyzer to the latest version available in rustup. This is a part of the log that shows the completion request/response:

2021-02-11 14:00:01 - DEBUG - TX: Sending message: b'Content-Length: 211\r\n\r\n{"id":22,"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":12,"line":13},"textDocument":{"uri":"file:///home/bstaletic/work/ycmd/ycmd/tests/rust/testdata/common/src/main.rs"}}}'
2021-02-11 14:00:01 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","id":22,"result":{"isIncomplete":true,"items":[{"label":"into","kind":2,"detail":"-> T","documentation":{"kind":"markdown","value":"Performs the conversion."},"deprecated":false,"filterText":"into","insertTextFormat":1,"textEdit":{"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":12}},"newText":"into"},"additionalTextEdits":[]},{"label":"build_rocket","kind":2,"detail":"-> ()","documentation":{"kind":"markdown","value":"Do not try at home"},"deprecated":false,"filterText":"build_rocket","insertTextFormat":1,"textEdit":{"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":12}},"newText":"build_rocket"},"additionalTextEdits":[]},{"label":"build_shuttle","kind":2,"detail":"-> ()","deprecated":false,"filterText":"build_shuttle","insertTextFormat":1,"textEdit":{"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":12}},"newText":"build_shuttle"},"additionalTextEdits":[]}]}}'

The project used for testing: https://github.com/ycm-core/ycmd/tree/master/ycmd/tests/rust/testdata/common
The specific file open: https://github.com/ycm-core/ycmd/blob/master/ycmd/tests/rust/testdata/common/src/main.rs#L14
The expected completions: https://github.com/ycm-core/ycmd/blob/master/ycmd/tests/rust/testdata/common/src/test.rs#L7-L8

The new rust-analyzer does work, but if it is always returning true for isIncomplete, it circumvents ycmd's cache and impacts performance.

On the bright side, this exposed a bug in ycmd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions