neoclide / coc.nvim

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

No error squiggles #255

Closed syvsto closed 5 years ago

syvsto commented 5 years ago

Hi, I've been using coc.nvim for TypeScript and JSON and it's been av very pleasant experience. I now tried setting it up for Rust, and while most things work fine, the error squiggles don't display. Using :Denite coc-diagnostic lists the errors, and I can jump to them. coc#status shows that RLS is running and not working, but doesn't display any errors.

CocInfo gives this output.

## versions

vim version: NVIM v0.3.1
node version: v8.9.0
coc.nvim version: 0.0.38
term: undefined
platform: win32

## Error messageserror: Found argument 'active-toolchain' which wasn't expected, or isn't valid in this context

USAGE:
    rustup show

For more information try --help

error: Found argument 'active-toolchain' which wasn't expected, or isn't valid in this context

USAGE:
    rustup show

For more information try --help

I'm running on Windows 10 if that makes any difference.

In advance, thanks for your help!

chemzqm commented 5 years ago

rustup show active-toolchain is available since rustup 1.12.0

Please upgrade your rustup.

syvsto commented 5 years ago

That fixes the error message on startup, but does not fix the lack of inline diagnostics.

Also, I forgot to mention: RLS shows squiggles in VSCode, so I think the issue is on the client side.

chemzqm commented 5 years ago

What's result of b:coc_diagnostic_info in error buffer? Do you have signs and underline highlight within error lines.

syvsto commented 5 years ago

I do not have signs or underline highlighting either.

In the Rust buffer that contains errors, I get an undefined variable error when attempting to echo it. I also tried to do the same thing in a JSON buffer with one error, just to compare, and there it prints properly, in this form: {'information': 0, 'hint': 0, 'warning': 0, 'error': 1}.

By the way, thanks for the quick response!

chemzqm commented 5 years ago

I need LSP communication to know what happened: https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

syvsto commented 5 years ago

Here is the output of CocInfo after enabling verbose output:

## versions

vim version: NVIM v0.3.1
node version: v8.9.0
coc.nvim version: 0.0.38
term: undefined
platform: win32

## Error messages

## Output channel: rust
[Trace - 19:19:04] Sending request 'initialize - (0)'.
Params: {
    "processId": 10064,
    "rootPath": "d:\\Dokumenter\\Rust\\expand",
    "rootUri": "file:///d%3A/Dokumenter/Rust/expand",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": false,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ]
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {
        "omitInitBuild": true,
        "cmdRun": true
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///d%3A/Dokumenter/Rust/expand",
            "name": "expand"
        }
    ]
}

[Trace - 19:19:04] Received response 'initialize - (0)' in 40ms.
Result: {
    "capabilities": {
        "textDocumentSync": 2,
        "hoverProvider": true,
        "completionProvider": {
            "resolveProvider": true,
            "triggerCharacters": [
                ".",
                ":"
            ]
        },
        "definitionProvider": true,
        "implementationProvider": true,
        "referencesProvider": true,
        "documentHighlightProvider": true,
        "documentSymbolProvider": true,
        "workspaceSymbolProvider": true,
        "codeActionProvider": true,
        "codeLensProvider": {
            "resolveProvider": false
        },
        "documentFormattingProvider": true,
        "documentRangeFormattingProvider": false,
        "renameProvider": true,
        "executeCommandProvider": {
            "commands": [
                "rls.applySuggestion-10276",
                "rls.deglobImports-10276"
            ]
        }
    }
}

[Trace - 19:19:04] Sending notification 'initialized'.
Params: {}

[Trace - 19:19:04] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "rust": {
            "trace": {
                "server": "verbose"
            },
            "clear_env_rust_log": true,
            "cfg_test": false,
            "unstable_features": false,
            "wait_to_build": 1500,
            "show_warnings": true,
            "use_crate_blacklist": true,
            "build_on_save": false,
            "features": [],
            "all_features": false,
            "no_default_features": false,
            "goto_def_racer_fallback": false,
            "racer_completion": true,
            "clippy_preference": "opt-in",
            "all_targets": true
        }
    }
}

[Trace - 19:19:04] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/Dokumenter/Rust/expand/src/main.rs",
        "languageId": "rust",
        "version": 1,
        "text": "fn main() {\n    let hello = 0;\n    hello = 1;\n    println!(\"Hello, world!\");\n}\n\nstruct Lol {}\n\nimpl Lol {\n    pub fn new() -> Self {\n        Self { }\n    }       \n}\n\n"
    }
}

[Trace - 19:19:04] Received request 'client/registerCapability - (1)'.
Params: {
    "registrations": [
        {
            "id": "rls-watch",
            "method": "workspace/didChangeWatchedFiles",
            "registerOptions": {
                "watchers": [
                    {
                        "globPattern": "d:\\Dokumenter\\Rust\\expand/Cargo.lock"
                    },
                    {
                        "globPattern": "d:\\Dokumenter\\Rust\\expand/target",
                        "kind": 4
                    },
                    {
                        "globPattern": "d:\\Dokumenter\\Rust\\expand\\Cargo.toml"
                    }
                ]
            }
        }
    ]
}

[Trace - 19:19:04] Sending response 'client/registerCapability - (1)'. Processing request took 119ms
No result returned.

[Trace - 19:19:04] Received request 'client/unregisterCapability - (2)'.
Params: {
    "unregisterations": [
        {
            "id": "rls-range-formatting",
            "method": "textDocument/rangeFormatting"
        }
    ]
}

[Trace - 19:19:04] Sending response 'client/unregisterCapability - (2)'. Processing request took 0ms
No result returned.

[Trace - 19:19:04] Received notification 'window/progress'.
Params: {
    "id": "progress_1",
    "title": "Building"
}

[Trace - 19:19:04] Received notification 'window/progress'.
Params: {
    "id": "progress_1",
    "message": "expand cfg(test)",
    "title": "Building"
}

[Trace - 19:19:04] Received notification 'window/progress'.
Params: {
    "id": "progress_1",
    "message": "expand",
    "title": "Building"
}

[Trace - 19:19:04] Received notification 'window/progress'.
Params: {
    "done": true,
    "id": "progress_1",
    "title": "Building"
}

[Trace - 19:19:04] Received notification 'window/progress'.
Params: {
    "id": "progress_0",
    "title": "Indexing"
}

[Trace - 19:19:04] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "code": "unused_variables",
            "message": "variable `hello` is assigned to, but never used\n\nnote: #[warn(unused_variables)] on by default\nnote: consider using `_hello` instead",
            "range": {
                "end": {
                    "character": 13,
                    "line": 1
                },
                "start": {
                    "character": 8,
                    "line": 1
                }
            },
            "relatedInformation": [],
            "severity": 2,
            "source": "rustc"
        },
        {
            "code": "unused_assignments",
            "message": "value assigned to `hello` is never read\n\nnote: #[warn(unused_assignments)] on by default",
            "range": {
                "end": {
                    "character": 9,
                    "line": 2
                },
                "start": {
                    "character": 4,
                    "line": 2
                }
            },
            "relatedInformation": [],
            "severity": 2,
            "source": "rustc"
        },
        {
            "code": "E0384",
            "message": "cannot assign twice to immutable variable `hello`\n\ncannot assign twice to immutable variable",
            "range": {
                "end": {
                    "character": 13,
                    "line": 2
                },
                "start": {
                    "character": 4,
                    "line": 2
                }
            },
            "relatedInformation": [
                {
                    "location": {
                        "range": {
                            "end": {
                                "character": 13,
                                "line": 1
                            },
                            "start": {
                                "character": 8,
                                "line": 1
                            }
                        },
                        "uri": "file:///D:/Dokumenter/Rust/expand/src/main.rs"
                    },
                    "message": "first assignment to `hello`"
                },
                {
                    "location": {
                        "range": {
                            "end": {
                                "character": 13,
                                "line": 2
                            },
                            "start": {
                                "character": 4,
                                "line": 2
                            }
                        },
                        "uri": "file:///D:/Dokumenter/Rust/expand/src/main.rs"
                    },
                    "message": "cannot assign twice to immutable variable"
                }
            ],
            "severity": 1,
            "source": "rustc"
        }
    ],
    "uri": "file:///D:/Dokumenter/Rust/expand/src/main.rs"
}

[Trace - 19:19:05] Received notification 'window/progress'.
Params: {
    "done": true,
    "id": "progress_0",
    "title": "Indexing"
}
chemzqm commented 5 years ago

It's a path problem on windows, the vscode-uri could give uri as "file:///D%3A/Dokumenter/Rust/expand/src/main.rs" but RLS returns "file:///D:/Dokumenter/Rust/expand/src/main.rs"