neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.47k stars 954 forks source link

Improve autocomplete expandable completions #3754

Closed otavioschwanck closed 2 years ago

otavioschwanck commented 2 years ago

I did some tests on nvim-lspconfig VS CoC and i figured that CoC is not expanding some fields. Example in solargraph:

nvim-lspconfig: Kapture 2022-04-09 at 23 48 21

coc: Kapture 2022-04-09 at 23 50 06

Diff: CoC dont add the ()

-

Other example, in typescript: nvim-lspconfig: Kapture 2022-04-09 at 23 52 44

coc: Kapture 2022-04-09 at 23 54 06

Diff: CoC dont add the ="$0"

chemzqm commented 2 years ago

Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

This is result from latest tyepscript 4.6.3

[Trace  - 05:37:32.837] Response received: completionEntryDetails (20). Request took 17 ms. Success: true 
Result: [
    {
        "name": "id",
        "kindModifiers": "declare,optional",
        "kind": "property",
        "displayParts": [
            {
                "text": "(",
                "kind": "punctuation"
            },
            {
                "text": "property",
                "kind": "text"
            },
            {
                "text": ")",
                "kind": "punctuation"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "React",
                "kind": "moduleName"
            },
            {
                "text": ".",
                "kind": "punctuation"
            },
            {
                "text": "HTMLAttributes",
                "kind": "interfaceName"
            },
            {
                "text": "<",
                "kind": "punctuation"
            },
            {
                "text": "HTMLDivElement",
                "kind": "localName"
            },
            {
                "text": ">",
                "kind": "punctuation"
            },
            {
                "text": ".",
                "kind": "punctuation"
            },
            {
                "text": "id",
                "kind": "propertyName"
            },
            {
                "text": "?",
                "kind": "punctuation"
            },
            {
                "text": ":",
                "kind": "punctuation"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "string",
                "kind": "keyword"
            }
        ],
        "documentation": [],
        "tags": []
    }
]

same behavior on VSCode.

otavioschwanck commented 2 years ago

@chemzqm im using same version of you. (typescript) and also have latest version of typescript-language-server

chemzqm commented 2 years ago

It's expected, the tsserver could be different when working on language server mode. Need fixed on tsserver first.

otavioschwanck commented 2 years ago

@chemzqm im using tsserver too, latest version, the id dont includes ="" like nvim-cmp (lspconfig).

Ill debug

otavioschwanck commented 2 years ago

Server log: https://pastebin.com/EVScjucP Output: https://pastebin.com/AS0WCiBD

otavioschwanck commented 2 years ago

@chemzqm Results:


[
    {
        "name": "id",
        "kindModifiers": "declare,optional",
        "kind": "property",
        "displayParts": [
            {
                "text": "(",
                "kind": "punctuation"
            },
            {
                "text": "property",
                "kind": "text"
            },
            {
                "text": ")",
                "kind": "punctuation"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "HTMLAttributes",
                "kind": "interfaceName"
            },
            {
                "text": "<",
                "kind": "punctuation"
            },
            {
                "text": "HTMLDivElement",
                "kind": "localName"
            },
            {
                "text": ">",
                "kind": "punctuation"
            },
            {
                "text": ".",
                "kind": "punctuation"
            },
            {
                "text": "id",
                "kind": "propertyName"
            },
            {
                "text": "?",
                "kind": "punctuation"
            },
            {
                "text": ":",
                "kind": "punctuation"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "string",
                "kind": "keyword"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "|",
                "kind": "punctuation"
            },
            {
                "text": " ",
                "kind": "space"
            },
            {
                "text": "undefined",
                "kind": "keyword"
            }
        ],
        "documentation": [],
        "tags": []
    }
]```
xiyaowong commented 2 years ago

@otavioschwanck can you test #3756 ?

otavioschwanck commented 2 years ago

@otavioschwanck can you test #3756 ?

@xiyaowong

The problem persists

xiyaowong commented 2 years ago

Alright

@otavioschwanck can you test #3756 ?

@xiyaowong

The problem persists

otavioschwanck commented 2 years ago

Alright

@otavioschwanck can you test #3756 ?

@xiyaowong The problem persists

need some help to fix it ? @xiyaowong