Coder Social home page Coder Social logo

coc-vetur's Introduction

coc-vetur

Vue language server extension for coc.nvim.

Using vue-language-server

Note: latest vetur have changed filepath of server, make sure upgrade to latest vetur if you're using vetur.dev.vlsPath configuration.

Supporting

If you like my extension, consider supporting me on Patreon or PayPal:

Patreon donate button PayPal donate button

Install

In your vim/neovim, run command:

:CocInstall coc-vetur

Note you have to install eslint and eslint-plugin-vue by:

npm i eslint eslint-plugin-vue -D

in your project root for this extension to work.

Make sure your workspace root is correct by :echo g:WorkspaceFolders

Features

Language server features provided by vue-language-server.

Configuration options

  • vetur.ignoreProjectWarning: Vetur will warn about not setup correctly for the project. You can disable it., default: false

  • vetur.useWorkspaceDependencies: Use dependencies from workspace. Currently only for TypeScript., default: false

  • vetur.completion.autoImport: Include completion for module export and auto import them, default: true

  • vetur.completion.useScaffoldSnippets: Enable/disable Vetur's built-in scaffolding snippets, default: true

  • vetur.completion.tagCasing: Casing conversion for tag completion, default: "kebab" Valid options: ["initial","kebab"]

  • vetur.grammar.customBlocks: Mapping from custom block tag name to language name. Used for generating grammar to support syntax highlighting for custom blocks, default: {"docs":"md","i18n":"json"}

  • vetur.validation.template: Validate vue-html in using eslint-plugin-vue, default: true

  • vetur.validation.templateProps: Validate props usage in region. Show error/warning for not passing declared props to child components and show error for passing wrongly typed interpolation expressions, default: false

  • vetur.validation.interpolation: Validate interpolations in region using TypeScript language service, default: true

  • vetur.validation.style: Validate css/scss/less/postcss in <style>, default: true

  • vetur.validation.script: Validate js/ts in <script>, default: true

  • vetur.format.enable: Enable/disable the Vetur document formatter., default: true

  • vetur.format.options.tabSize: Number of spaces per indentation level. Inherited by all formatters., default: 2

  • vetur.format.options.useTabs: Use tabs for indentation. Inherited by all formatters., default: false

  • vetur.format.defaultFormatter.html: Default formatter for region, default: "prettier" Valid options: ["none","prettyhtml","js-beautify-html","prettier"]

  • vetur.format.defaultFormatter.pug: Default formatter for region, default: "prettier" Valid options: ["none","prettier"]

  • vetur.format.defaultFormatter.css: Default formatter for <style> region, default: "prettier" Valid options: ["none","prettier"]

  • vetur.format.defaultFormatter.postcss: Default formatter for <style lang='postcss'> region, default: "prettier" Valid options: ["none","prettier"]

  • vetur.format.defaultFormatter.scss: Default formatter for <style lang='scss'> region, default: "prettier" Valid options: ["none","prettier"]

  • vetur.format.defaultFormatter.sass: Default formatter for <style lang='sass'> region, default: "sass-formatter" Valid options: ["none","sass-formatter"]

  • vetur.format.defaultFormatter.less: Default formatter for <style lang='less'> region, default: "prettier" Valid options: ["none","prettier"]

  • vetur.format.defaultFormatter.stylus: Default formatter for <style lang='stylus'> region, default: "stylus-supremacy" Valid options: ["none","stylus-supremacy"]

  • vetur.format.defaultFormatter.js: Default formatter for <script> region, default: "prettier" Valid options: ["none","prettier","prettier-eslint","vscode-typescript"]

  • vetur.format.defaultFormatter.ts: Default formatter for <script> region, default: "prettier" Valid options: ["none","prettier","prettier-tslint","vscode-typescript"]

  • vetur.format.defaultFormatterOptions: Options for all default formatters, default: {"js-beautify-html":{"wrap_attributes":"force-expand-multiline"},"prettyhtml":{"printWidth":100,"singleQuote":false,"wrapAttributes":false,"sortAttributes":false}}

  • vetur.format.styleInitialIndent: Whether to have initial indent for <style> region, default: false

  • vetur.format.scriptInitialIndent: Whether to have initial indent for <script> region, default: false

  • vetur.languageFeatures.codeActions: Whether to enable codeActions, default: true

  • vetur.languageFeatures.updateImportOnFileMove: Whether to automatic updating import path when rename or move a file, default: true

  • vetur.trace.server: Traces the communication between VS Code and Vue Language Server., default: "off" Valid options: ["off","messages","verbose"]

  • vetur.dev.vlsPath: Path to VLS for Vetur developers. There are two ways of using it.

    1. Clone vuejs/vetur from GitHub, build it and point it to the ABSOLUTE path of /server.
    2. yarn global add vue-language-server and point Vetur to the installed location (yarn global dir + node_modules/vue-language-server)
  • vetur.dev.vlsPort: The port that VLS listens to. Can be used for attaching to the VLS Node process for debugging / profiling, default: -1

  • vetur.dev.logLevel: Log level for VLS, default: "INFO" Valid options: ["INFO","DEBUG"]

  • vetur.experimental.templateInterpolationService: Enable template interpolation service that offers diagnostics / hover / definition / references., default: false

  • vetur.underline.refValue: Enable underline .value when using composition API., default: true

  • Trigger completion in coc-settings.json to get full list of options.

    Troubleshooting

    • Add "vetur.trace.server": "verbose" to your coc-settings.json (opened by command :CocConfig) for verbose messages. coc-settings.json
    • Restart coc server by command :CocRestart
    • Make the issue happen.
    • Open tsserver output channel by command :CocCommand workspace.showOutput vetur.

    License

    MIT

coc-vetur's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

coc-vetur's Issues

How can I use snippet with vue

Hello everyone, sorry for that dummy question, but there is no such answer for that in net. When I was in vscode, I could use div.wrapper and that would be like this <div class="wrapper"></div>. How can I do that in vim using coc-vetur?

Vue formater unexpected behaviors

First of all, thanks for adding the support of vue formater.

My setup is vue formater and eslint on vue files, is order to format and lint on save.

The first strange behavior is that my cursor jump to the end of the last line of the script section, every time i save.

And the second one is that the content of the copy buffer is modified, and it contain the template and script sections, until the ending script tag.

I got this line in my vimrc if it can help, set clipboard=unnamedplus.

GotoDefinition support?

Hi team,

awesome work, this plugin is great!

One thing I notice is there is not available jump to definition with functions defined in .vue files or in .js files for that matter that are in a vue project directory.

Is there a way to get support for this?

Vue files not formatted

I added this line "coc.preferences.formatOnSaveFiletypes": ["cpp", ".vue"], to my coc-settings.json to format my vue files on save but nothing is happening.

Here are vls logs after saving and manually sending a document/formatting request :

[Trace - 10:37:32 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 11168,
    "rootPath": "D:\\Documents\\Projets\\bematrix3d",
    "rootUri": "file:///d%3A/Documents/Projets/bematrix3d",
    "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": true,
                    "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"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "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
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {
        "config": {
            "vetur": {
                "completion": {
                    "autoImport": true,
                    "useScaffoldSnippets": true,
                    "tagCasing": "kebab"
                },
                "grammar": {
                    "customBlocks": {
                        "docs": "md",
                        "i18n": "json"
                    }
                },
                "validation": {
                    "template": true,
                    "style": true,
                    "script": true
                },
                "format": {
                    "options": {
                        "tabSize": 2,
                        "useTabs": false
                    },
                    "defaultFormatter": {
                        "html": "prettyhtml",
                        "css": "prettier",
                        "postcss": "prettier",
                        "scss": "prettier",
                        "less": "prettier",
                        "stylus": "stylus-supremacy",
                        "js": "prettier",
                        "ts": "prettier"
                    },
                    "defaultFormatterOptions": {
                        "js-beautify-html": {
                            "wrap_attributes": "force-expand-multiline"
                        },
                        "prettyhtml": {
                            "printWidth": 100,
                            "singleQuote": false,
                            "wrapAttributes": false,
                            "sortAttributes": false
                        }
                    },
                    "styleInitialIndent": false,
                    "scriptInitialIndent": false
                },
                "trace": {
                    "server": "verbose"
                }
            },
            "emmet": {},
            "html": {},
            "javascript": {
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": true
                },
                "referencesCodeLens": {
                    "enable": true
                },
                "preferences": {
                    "importModuleSpecifier": "non-relative",
                    "noSemicolons": false,
                    "quoteStyle": "single"
                },
                "validate": {
                    "enable": true
                },
                "suggestionActions": {
                    "enabled": false
                },
                "suggest": {
                    "names": true,
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true
                },
                "format": {
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false
                }
            },
            "typescript": {
                "useBatchedBufferSync": true,
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": true
                },
                "referencesCodeLens": {
                    "enable": true
                },
                "preferences": {
                    "importModuleSpecifier": "non-relative",
                    "noSemicolons": false,
                    "quoteStyle": "single"
                },
                "suggestionActions": {
                    "enabled": true
                },
                "validate": {
                    "enable": true
                },
                "suggest": {
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true
                },
                "format": {
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false
                }
            },
            "prettier": {},
            "stylusSupremacy": {}
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///d%3A/Documents/Projets/bematrix3d",
            "name": "bematrix3d"
        }
    ]
}


[Trace - 10:37:33 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Loaded bundled [email protected]."
}


Loaded bundled [email protected].
[Trace - 10:37:33 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Vetur initialized"
}


Vetur initialized
[Trace - 10:37:33 PM] Received response 'initialize - (0)' in 1344ms.
Result: {
    "capabilities": {
        "textDocumentSync": 1,
        "completionProvider": {
            "resolveProvider": true,
            "triggerCharacters": [
                ".",
                ":",
                "<",
                "\"",
                "'",
                "/",
                "@",
                "*"
            ]
        },
        "signatureHelpProvider": {
            "triggerCharacters": [
                "("
            ]
        },
        "documentFormattingProvider": false,
        "hoverProvider": true,
        "documentHighlightProvider": true,
        "documentLinkProvider": {
            "resolveProvider": false
        },
        "documentSymbolProvider": true,
        "definitionProvider": true,
        "referencesProvider": true,
        "codeActionProvider": true,
        "colorProvider": true
    }
}


[Trace - 10:37:33 PM] Sending notification 'initialized'.
Params: {}


[Trace - 10:37:33 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "vetur": {
            "completion": {
                "autoImport": true,
                "useScaffoldSnippets": true,
                "tagCasing": "kebab"
            },
            "grammar": {
                "customBlocks": {
                    "docs": "md",
                    "i18n": "json"
                }
            },
            "validation": {
                "template": true,
                "style": true,
                "script": true
            },
            "format": {
                "options": {
                    "tabSize": 2,
                    "useTabs": false
                },
                "defaultFormatter": {
                    "html": "prettyhtml",
                    "css": "prettier",
                    "postcss": "prettier",
                    "scss": "prettier",
                    "less": "prettier",
                    "stylus": "stylus-supremacy",
                    "js": "prettier",
                    "ts": "prettier"
                },
                "defaultFormatterOptions": {
                    "js-beautify-html": {
                        "wrap_attributes": "force-expand-multiline"
                    },
                    "prettyhtml": {
                        "printWidth": 100,
                        "singleQuote": false,
                        "wrapAttributes": false,
                        "sortAttributes": false
                    }
                },
                "styleInitialIndent": false,
                "scriptInitialIndent": false
            },
            "trace": {
                "server": "verbose"
            }
        },
        "emmet": {},
        "html": {},
        "javascript": {
            "showUnused": true,
            "updateImportsOnFileMove": {
                "enable": true
            },
            "implementationsCodeLens": {
                "enable": true
            },
            "referencesCodeLens": {
                "enable": true
            },
            "preferences": {
                "importModuleSpecifier": "non-relative",
                "noSemicolons": false,
                "quoteStyle": "single"
            },
            "validate": {
                "enable": true
            },
            "suggestionActions": {
                "enabled": false
            },
            "suggest": {
                "names": true,
                "enabled": true,
                "paths": true,
                "autoImports": true,
                "completeFunctionCalls": true
            },
            "format": {
                "insertSpaceAfterCommaDelimiter": true,
                "insertSpaceAfterConstructor": false,
                "insertSpaceAfterSemicolonInForStatements": true,
                "insertSpaceBeforeAndAfterBinaryOperators": true,
                "insertSpaceAfterKeywordsInControlFlowStatements": true,
                "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                "insertSpaceBeforeFunctionParenthesis": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                "insertSpaceAfterTypeAssertion": false,
                "placeOpenBraceOnNewLineForFunctions": false,
                "placeOpenBraceOnNewLineForControlBlocks": false
            }
        },
        "typescript": {
            "useBatchedBufferSync": true,
            "showUnused": true,
            "updateImportsOnFileMove": {
                "enable": true
            },
            "implementationsCodeLens": {
                "enable": true
            },
            "referencesCodeLens": {
                "enable": true
            },
            "preferences": {
                "importModuleSpecifier": "non-relative",
                "noSemicolons": false,
                "quoteStyle": "single"
            },
            "suggestionActions": {
                "enabled": true
            },
            "validate": {
                "enable": true
            },
            "suggest": {
                "enabled": true,
                "paths": true,
                "autoImports": true,
                "completeFunctionCalls": true
            },
            "format": {
                "insertSpaceAfterCommaDelimiter": true,
                "insertSpaceAfterConstructor": false,
                "insertSpaceAfterSemicolonInForStatements": true,
                "insertSpaceBeforeAndAfterBinaryOperators": true,
                "insertSpaceAfterKeywordsInControlFlowStatements": true,
                "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                "insertSpaceBeforeFunctionParenthesis": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                "insertSpaceAfterTypeAssertion": false,
                "placeOpenBraceOnNewLineForFunctions": false,
                "placeOpenBraceOnNewLineForControlBlocks": false
            }
        },
        "prettier": {},
        "stylusSupremacy": {}
    }
}


[Trace - 10:37:33 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/Documents/Projets/bematrix3d/src/modules/ui/src/components/left-menu.vue",
        "languageId": "vue",
        "version": 1,
        "text": "my-code"
    }
}


[Trace - 10:37:36 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///d%3A/Documents/Projets/bematrix3d/src/modules/ui/src/components/left-menu.vue",
    "diagnostics": []
}

Nothing is received by the server.

I compared those logs to the one produced by the vs-code and something caught my attention.

Vscode logs contains this request :

[Trace - 10:43:08 PM] Received request 'client/registerCapability - (0)'.
Params: {
    "registrations": [
        {
            "id": "19355936-1576-4207-9652-8168d62c9f13",
            "method": "textDocument/formatting",
            "registerOptions": {
                "documentSelector": [
                    "vue"
                ]
            }
        }
    ]
}

I'm pretty sure this is why i got formatting working in vs-code by not in vim.

Do you know why this request isn't sent by coc-vetur at initialization ?

vetur 2307 cannot find module @/api/xxx

正确配置了 webpack alias in vue.config.js & tsconfig.js#paths,为什么还是提示找不到这种类似 alias 引用的依赖 ~ VSCode 可以,求大神帮忙看看 ~ 万分感激 !

Errors show up delayed, only after first write

I noticed a new strange behavior that it will only display errors after first write. So when I open a file no error is displayed until I do a :w. Then it shoes up instantly. And I have to wait some seconds, probably because the linter boots up. If I hit :w too early, no errors are displayed (and will not until I hit :w again).

This all started after updating @vue/eslint-config-typescript to 5.0.0 and with it @typescript-eslint/parser to 2.7.0.

Go to file doesn't work when I use alias import module


When I use go to file in vue file with alias import module, that doesn't work


Example

import Home from '@/pages/Home'

That returns

E447: Can't find file "/pages/Home" in path

This is my jsconfig.json

{
    "compilerOptions": {
      "baseUrl": ".",
      "paths": {
        "@/*": [
          "src/*"
        ]   
      }   
    }
  }

VLS hangs on starting stage but works if vetur.dev.vlsPath specified

Description

Hi everyone and thanks for this extension! I couldn't work without it ❤️.

The problem is the extension is not working by default but works setting the vetur.dev.vlsPath to the VLS directory. I mean, the same VLS directory installed by the coc-vetur extension.

Looks like coc-vetur launches the vls.js by default but the vueServerMain.js when vetur.dev.vlsPath is set. The VSCode looks running vueServerMain.js as well.

Is this a bug? Or I'm doing something wrong? See below the steps I've done and the logs output.

What is happening

The :CocInfo shows VLS is starting but never changes to running. The autocomplete for .vue files does not work at all.

CocInfo Logs

## versions
vim version: NVIM v0.4.4
node version: v12.19.0
coc.nvim version: 0.0.79-53f8a1d52b
coc.nvim directory: /home/earenas/.config/nvim/plugged/coc.nvim
term: xterm-color
platform: linux

## Log of coc.nvim

2020-11-13T18:23:53.371 INFO (pid:1658836) [services] - registered service "eslint"
2020-11-13T18:23:53.373 INFO (pid:1658836) [services] - eslint langserver state change: stopped => starting
2020-11-13T18:23:53.384 INFO (pid:1658836) [services] - registered service "json"
2020-11-13T18:23:53.384 INFO (pid:1658836) [services] - Json language server state change: stopped => starting
2020-11-13T18:23:53.395 INFO (pid:1658836) [services] - registered service "vetur"
2020-11-13T18:23:53.396 INFO (pid:1658836) [services] - Vetur Language Server state change: stopped => starting
2020-11-13T18:23:53.398 INFO (pid:1658836) [plugin] - coc.nvim 0.0.79-53f8a1d52b initialized with node: v12.19.0 after 98ms
2020-11-13T18:23:53.409 INFO (pid:1658836) [language-client-index] - eslint started with 1658851
2020-11-13T18:23:53.416 INFO (pid:1658836) [language-client-index] - json started with 1658858
2020-11-13T18:23:53.420 INFO (pid:1658836) [language-client-index] - vetur started with 1658864
2020-11-13T18:23:53.469 INFO (pid:1658836) [services] - eslint langserver state change: starting => running
2020-11-13T18:23:53.473 INFO (pid:1658836) [services] - service eslint started
2020-11-13T18:23:53.499 INFO (pid:1658836) [services] - Json language server state change: starting => running
2020-11-13T18:23:53.502 INFO (pid:1658836) [services] - service json started

What should happen

The VLS should change from starting to running, and autocomplete from LS should work.

What I have tested so far

I have downloaded veturpack and followed the instructions to install coc-vetur.

✔️ The autocomplete works fine for .ts and .js files but not working at all for .vue files.

Inspecting the processes I see coc-vetur launches the vls.js file as follows:

/home/earenas/.nvm/versions/node/v12.19.0/bin/node /home/earenas/.config/coc/extensions/node_modules/vls/dist/vls.js --node-ipc --clientProcessId=1658836

✔️ Changing the vetur.dev.vlsPath as follows SOLVES the issue for me:

{
  "eslint.autoFixOnSave": true,
  "eslint.filetypes": ["javascript", "typescript", "vue"],
  "vetur.validation.template": false,
  "vetur.trace.server": "verbose",
  "vetur.dev.logLevel": "DEBUG",
  "vetur.dev.vlsPath": "/home/earenas/.config/coc/extensions/node_modules/vls"
}

And, in this case, the launched process is vueServerMain.js:

/home/earenas/.nvm/versions/node/v12.19.0/bin/node /home/earenas/.config/coc/extensions/node_modules/vls/dist/vueServerMain.js --node-ipc --clientProcessId=1674163

And :CocInfo shows the process in running state:

CocInfo Logs

vim version: NVIM v0.4.4
node version: v12.19.0
coc.nvim version: 0.0.79-53f8a1d52b
coc.nvim directory: /home/earenas/.config/nvim/plugged/coc.nvim
term: xterm-color
platform: linux

## Log of coc.nvim

2020-11-13T18:34:01.140 INFO (pid:1674163) [services] - registered service "eslint"
2020-11-13T18:34:01.142 INFO (pid:1674163) [services] - eslint langserver state change: stopped => starting
2020-11-13T18:34:01.153 INFO (pid:1674163) [services] - registered service "json"
2020-11-13T18:34:01.154 INFO (pid:1674163) [services] - Json language server state change: stopped => starting
2020-11-13T18:34:01.164 INFO (pid:1674163) [services] - registered service "vetur"
2020-11-13T18:34:01.164 INFO (pid:1674163) [services] - Vetur Language Server state change: stopped => starting
2020-11-13T18:34:01.166 INFO (pid:1674163) [plugin] - coc.nvim 0.0.79-53f8a1d52b initialized with node: v12.19.0 after 98ms
2020-11-13T18:34:01.178 INFO (pid:1674163) [language-client-index] - eslint started with 1674180
2020-11-13T18:34:01.187 INFO (pid:1674163) [language-client-index] - json started with 1674187
2020-11-13T18:34:01.193 INFO (pid:1674163) [language-client-index] - vetur started with 1674193
2020-11-13T18:34:01.243 INFO (pid:1674163) [services] - eslint langserver state change: starting => running
2020-11-13T18:34:01.249 INFO (pid:1674163) [services] - service eslint started
2020-11-13T18:34:01.273 INFO (pid:1674163) [services] - Json language server state change: starting => running
2020-11-13T18:34:01.276 INFO (pid:1674163) [services] - service json started
2020-11-13T18:34:02.514 INFO (pid:1674163) [services] - Vetur Language Server state change: starting => running
2020-11-13T18:34:02.516 INFO (pid:1674163) [services] - service vetur started

Failed to load plugin 'vue'

Hello,
coc-vetur throws this error when opening a Vue file (with TS):

Error: Failed to load plugin 'vue' declared in 'CLIOptions': Cannot find module 'eslint-plugin-vue'
Require stack:
- /home/xx/repo/__placeholder__.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.resolve (internal/modules/cjs/helpers.js:33:19)
    at Object.resolve (/home/xx/.config/coc/extensions/node_modules/vls/node_modules/eslint/lib/shared/relative-module-resolver.js:44:50)

I tried installing the eslint plugin manually, but that didn't work out.
Did anyone else encouter this?

Not working in .vue file within script tag

I'm not sure if it's my setup, but the language server is not returning intelligent results in .vue files within the <script> tags.

Everything works fine in a .js file, just not in .vue files.

Screen:

kapture 2019-01-09 at 14 21 12

Is this an issue with vetur, coc-vetur, or did I not set things properly?

Note: I'm also running coc-tsserver. Is it ok to be using both?

Support organize imports in vue files with typescript

Using organize imports in a .ts file with coc-tsserver is working great. However, if I try to use it in a .vue. file with a <script lang="ts"> section it's not working.

I have tried to run :CocCommand tsserver.organizeImports, but I either get the error [coc.nvim] Command: tsserver.organizeImports not found if I haven't had .ts file open previously, or if I have, nothing happens. If I try to run :CocCommand editor.action.organizeImport, I get the error [coc.nvim] Orgnize import action not found..

Could this be supported?

templateInterpolationService not showing diagnostics in the latest version

Hey! I upgraded to the new version of coc-vetur (version 1.13.0) and it seems like the diagnostics in templates are not shown anymore when I've enabled vetur.experimental.templateInterpolationService. I can see that the type information is correctly shown (hovering works), but errors are not shown anymore.

Here's a screenshot illustrating a problem side-by-side with VSCode:

image

On the left picture is coc-vetur which doesn't show the type error and on the right is VSCode which shows the correct error.

I can temporarily downgrade coc-vetur to version 1.12.0 to fix this.


Here's the example code (project generated with Vue CLI):

<template>
  <div>{{ count.length }}</div>
</template>

<script lang="ts">
import { ref } from "vue";

export default {
  setup() {
    const count = ref(0);
    return { count };
  }
};
</script>
Here's the verbose log output if it helps.
[Trace - 9:17:03 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 6390,
    "rootPath": "",
    "rootUri": "file:///",
    "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
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                }
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "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"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "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
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": 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,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "workDoneProgress": true
        }
    },
    "initializationOptions": {
        "config": {
            "vetur": {
                "useWorkspaceDependencies": false,
                "completion": {
                    "autoImport": true,
                    "useScaffoldSnippets": true,
                    "tagCasing": "kebab"
                },
                "validation": {
                    "template": true,
                    "style": true,
                    "script": true
                },
                "format": {
                    "enable": true,
                    "options": {
                        "tabSize": 2,
                        "useTabs": false
                    },
                    "defaultFormatter": {
                        "html": "prettyhtml",
                        "css": "prettier",
                        "postcss": "prettier",
                        "scss": "prettier",
                        "less": "prettier",
                        "stylus": "stylus-supremacy",
                        "js": "prettier",
                        "ts": "prettier"
                    },
                    "defaultFormatterOptions": {
                        "js-beautify-html": {
                            "wrap_attributes": "force-expand-multiline"
                        },
                        "prettyhtml": {
                            "printWidth": 100,
                            "singleQuote": false,
                            "wrapAttributes": false,
                            "sortAttributes": false
                        }
                    },
                    "styleInitialIndent": false,
                    "scriptInitialIndent": false
                },
                "trace": {
                    "server": "verbose"
                },
                "dev": {
                    "logLevel": "INFO"
                },
                "experimental": {
                    "templateInterpolationService": true
                }
            },
            "emmet": {
                "showExpandedAbbreviation": "always",
                "showAbbreviationSuggestions": true,
                "includeLanguages": {
                    "htmldjango": "html"
                },
                "variables": {},
                "syntaxProfiles": {},
                "excludeLanguages": [
                    "markdown"
                ],
                "showSuggestionsAsSnippets": true,
                "preferences": {},
                "optimizeStylesheetParsing": true,
                "priority": 3
            },
            "html": {},
            "javascript": {
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": false
                },
                "referencesCodeLens": {
                    "enable": false
                },
                "preferences": {
                    "importModuleSpecifier": "auto",
                    "importModuleSpecifierEnding": "auto",
                    "quoteStyle": "single",
                    "useAliasesForRenames": true
                },
                "validate": {
                    "enable": true
                },
                "suggestionActions": {
                    "enabled": true
                },
                "suggest": {
                    "names": true,
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true,
                    "includeAutomaticOptionalChainCompletions": true
                },
                "format": {
                    "enabled": true,
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false,
                    "semicolons": "ignore"
                }
            },
            "typescript": {
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": false
                },
                "referencesCodeLens": {
                    "enable": false
                },
                "preferences": {
                    "importModuleSpecifier": "auto",
                    "importModuleSpecifierEnding": "auto",
                    "quoteStyle": "auto",
                    "useAliasesForRenames": true
                },
                "suggestionActions": {
                    "enabled": true
                },
                "validate": {
                    "enable": true
                },
                "suggest": {
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true,
                    "includeAutomaticOptionalChainCompletions": true
                },
                "format": {
                    "enabled": true,
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false,
                    "semicolons": "ignore"
                },
                "workspaceSymbols": {
                    "scope": "allOpenProjects"
                }
            },
            "prettier": {
                "formatterPriority": 1,
                "disableLanguages": [
                    "vue"
                ],
                "eslintIntegration": true,
                "tslintIntegration": false,
                "stylelintIntegration": false,
                "requireConfig": false,
                "onlyUseLocalVersion": true,
                "disableSuccessMessage": false,
                "statusItemText": "Prettier",
                "ignorePath": ".prettierignore",
                "printWidth": 80,
                "tabWidth": 2,
                "singleQuote": true,
                "trailingComma": "all",
                "bracketSpacing": true,
                "jsxBracketSameLine": false,
                "jsxSingleQuote": false,
                "htmlWhitespaceSensitivity": "css",
                "endOfLine": "lf",
                "parser": "none",
                "semi": false,
                "useTabs": false,
                "proseWrap": "preserve",
                "arrowParens": "always"
            },
            "stylusSupremacy": {}
        },
        "globalSnippetDir": "/Library/Application Support/Code/User/snippets/vetur"
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///",
            "name": ""
        }
    ],
    "clientInfo": {
        "name": "coc.nvim",
        "version": "0.0.78"
    }
}

[Trace - 9:17:04 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "Loaded bundled [email protected]."
}

Loaded bundled [email protected].
[Trace - 9:17:04 PM] Received notification 'window/logMessage'.
Params: {
"type": 4,
"message": "Vetur initialized"
}

Vetur initialized
[Trace - 9:17:04 PM] Received response 'initialize - (0)' in 756ms.
Result: {
"capabilities": {
"textDocumentSync": 1,
"completionProvider": {
"resolveProvider": true,
"triggerCharacters": [
".",
":",
"<",
""",
"'",
"/",
"@",
"*",
" "
]
},
"signatureHelpProvider": {
"triggerCharacters": [
"("
]
},
"documentFormattingProvider": false,
"hoverProvider": true,
"documentHighlightProvider": true,
"documentLinkProvider": {
"resolveProvider": false
},
"documentSymbolProvider": true,
"definitionProvider": true,
"referencesProvider": true,
"codeActionProvider": true,
"colorProvider": true,
"executeCommandProvider": {
"commands": [
"vetur.applyRefactorCommand"
]
},
"foldingRangeProvider": true
}
}

[Trace - 9:17:04 PM] Sending notification 'initialized'.
Params: {}

[Trace - 9:17:04 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": {
"vetur": {
"useWorkspaceDependencies": false,
"completion": {
"autoImport": true,
"useScaffoldSnippets": true,
"tagCasing": "kebab"
},
"validation": {
"template": true,
"style": true,
"script": true
},
"format": {
"enable": true,
"options": {
"tabSize": 2,
"useTabs": false
},
"defaultFormatter": {
"html": "prettyhtml",
"css": "prettier",
"postcss": "prettier",
"scss": "prettier",
"less": "prettier",
"stylus": "stylus-supremacy",
"js": "prettier",
"ts": "prettier"
},
"defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline"
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
},
"styleInitialIndent": false,
"scriptInitialIndent": false
},
"trace": {
"server": "verbose"
},
"dev": {
"logLevel": "INFO"
},
"experimental": {
"templateInterpolationService": true
}
},
"emmet": {
"showExpandedAbbreviation": "always",
"showAbbreviationSuggestions": true,
"includeLanguages": {
"htmldjango": "html"
},
"variables": {},
"syntaxProfiles": {},
"excludeLanguages": [
"markdown"
],
"showSuggestionsAsSnippets": true,
"preferences": {},
"optimizeStylesheetParsing": true,
"priority": 3
},
"html": {},
"javascript": {
"showUnused": true,
"updateImportsOnFileMove": {
"enable": true
},
"implementationsCodeLens": {
"enable": false
},
"referencesCodeLens": {
"enable": false
},
"preferences": {
"importModuleSpecifier": "auto",
"importModuleSpecifierEnding": "auto",
"quoteStyle": "single",
"useAliasesForRenames": true
},
"validate": {
"enable": true
},
"suggestionActions": {
"enabled": true
},
"suggest": {
"names": true,
"enabled": true,
"paths": true,
"autoImports": true,
"completeFunctionCalls": true,
"includeAutomaticOptionalChainCompletions": true
},
"format": {
"enabled": true,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterTypeAssertion": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore"
}
},
"typescript": {
"showUnused": true,
"updateImportsOnFileMove": {
"enable": true
},
"implementationsCodeLens": {
"enable": false
},
"referencesCodeLens": {
"enable": false
},
"preferences": {
"importModuleSpecifier": "auto",
"importModuleSpecifierEnding": "auto",
"quoteStyle": "auto",
"useAliasesForRenames": true
},
"suggestionActions": {
"enabled": true
},
"validate": {
"enable": true
},
"suggest": {
"enabled": true,
"paths": true,
"autoImports": true,
"completeFunctionCalls": true,
"includeAutomaticOptionalChainCompletions": true
},
"format": {
"enabled": true,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceBeforeFunctionParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterTypeAssertion": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore"
},
"workspaceSymbols": {
"scope": "allOpenProjects"
}
},
"prettier": {
"formatterPriority": 1,
"disableLanguages": [
"vue"
],
"eslintIntegration": true,
"tslintIntegration": false,
"stylelintIntegration": false,
"requireConfig": false,
"onlyUseLocalVersion": true,
"disableSuccessMessage": false,
"statusItemText": "Prettier",
"ignorePath": ".prettierignore",
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"parser": "none",
"semi": false,
"useTabs": false,
"proseWrap": "preserve",
"arrowParens": "always"
},
"stylusSupremacy": {}
}
}

[Trace - 9:17:04 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:////src/components/Counter.vue",
"languageId": "vue",
"version": 1,
"text": "\n

{{ count.length }}
\n\n\n<script lang="ts">\nimport { ref } from "vue";\n\nexport default {\n setup() {\n const count = ref(0);\n return { count };\n }\n};\n</script>\n"
}
}

[Trace - 9:17:04 PM] Received request 'client/registerCapability - (0)'.
Params: {
"registrations": [
{
"id": "dde97465-9fe6-45fb-8732-cd14a42bbcc8",
"method": "textDocument/formatting",
"registerOptions": {
"documentSelector": [
"vue"
]
}
}
]
}

[Trace - 9:17:04 PM] Sending response 'client/registerCapability - (0)'. Processing request took 1ms
No result returned.

[Trace - 9:17:05 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:////src/components/Counter.vue",
"diagnostics": []
}

Warning accessing non-existant property

Hi!

I am running into this output each time coc-vetur loads:

Output channel: vetur

[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
[Error - 6:39:45 PM] (node:6835) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
Loaded bundled [email protected].
Vetur initialized

Cannot get linting and formating to work

I installed coc-vetur and coc-eslint extensions and vim-vue but i can't get neither linting or fixing to work on vue files, however completion is working correctly.

My coc-settins.json

{
    "eslint.packageManager": "npm",
    "eslint.validate": [
        {
            "language": "javascript",
            "autoFix": true
        },
        {
            "language": "vue",
            "autoFix": true
        },
    ],
    "eslint.autoFixOnSave": true
}

My .eslintrc.json

{
    "root": true,
    "extends": [
        "airbnb-base",
        "plugin:vue/recommended"
    ],
}

I tried the same stufff with vscode and errors are shown.

Are typescript code actions in vue files supported?

I can't get code actions (like adding missing import statements) to work inside <script lang="ts"> tags.
I get the message [coc.nvim] CodeAction not found. Should they work or are they not supported?

When I use vetur in vscode or vls with nvim-lsp (in the neovim 0.5 nightly with lsp support) the actions work fine so the language server definitely supports it.

cannot make coc-vetur working

I installed coc-vetur by running:

:CocInstall coc-vetur

Then I installed dev dependencies in my vue project

yarn add eslint eslint-plugin-vue --dev

BTW, I installed vim-vue also, I can see the filtype is correct.

Then I tried to open a vue file, it still gives me the message:

Parsing error: unexpected token <

How do I get this to work?

Installed coc-vetur in neovim, fedora 32, also installed coc-eslint, coc-json, coc-tsserver, coc-prettier and coc-css

I installed, separately, vls (as vue-language-server isn't maintained), but vetur crashes on start.

Can't access the vetur channel to get specific diagnostic information, but if you need something, I think I can get the full coc log for you.

Latest coc-vetur still not working

After install coc-vetur, open a .vue file which containing explicit lint errors with Vim, but no linter message shows up.

Also when Vim opened the .vue file, I can observe high CPU usage of a node process, not sure if there's something crashed and keep restarting. Is there any other way we can diagnose this?

Output of :CocOpenLog:

2020-07-17T16:36:29.686 INFO (pid:65470) [services] - registered service "languageserver.ccls"
2020-07-17T16:36:29.689 INFO (pid:65470) [services] - registered service "languageserver.golang"
2020-07-17T16:36:29.715 INFO (pid:65470) [services] - registered service "eslint"
2020-07-17T16:36:29.715 INFO (pid:65470) [services] - eslint langserver state change: stopped => starting
2020-07-17T16:36:29.778 INFO (pid:65470) [language-client-index] - eslint started with 65520
2020-07-17T16:36:29.888 INFO (pid:65470) [services] - registered service "tsserver"
2020-07-17T16:36:29.909 INFO (pid:65470) [plugin] - coc.nvim 0.0.78-c250e18604 initialized with node: v14.5.0 after 328ms
2020-07-17T16:36:29.919 INFO (pid:65470) [services] - eslint langserver state change: starting => running
2020-07-17T16:36:29.923 INFO (pid:65470) [services] - service eslint started
2020-07-17T16:36:29.975 INFO (pid:65470) [services] - service tsserver started
2020-07-17T16:36:31.812 INFO (pid:65470) [services] - registered service "vetur"
2020-07-17T16:36:31.813 INFO (pid:65470) [services] - Vetur Language Server state change: stopped => starting
2020-07-17T16:36:31.824 INFO (pid:65470) [language-client-index] - vetur started with 65551

Output of :CocCommand workspace.showOutput vetur:

[Trace - 4:39:20 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 66036,
    "rootPath": "/Users/rainux/devel/kokkoro-notes",
    "rootUri": "file:///Users/rainux/devel/kokkoro-notes",
    "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
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                }
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "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"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "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
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": 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,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "workDoneProgress": true
        }
    },
    "initializationOptions": {
        "config": {
            "vetur": {
                "useWorkspaceDependencies": false,
                "completion": {
                    "autoImport": true,
                    "useScaffoldSnippets": true,
                    "tagCasing": "kebab"
                },
                "validation": {
                    "template": true,
                    "style": true,
                    "script": true
                },
                "format": {
                    "enable": true,
                    "options": {
                        "tabSize": 2,
                        "useTabs": false
                    },
                    "defaultFormatter": {
                        "html": "prettyhtml",
                        "css": "prettier",
                        "postcss": "prettier",
                        "scss": "prettier",
                        "less": "prettier",
                        "stylus": "stylus-supremacy",
                        "js": "prettier",
                        "ts": "prettier"
                    },
                    "defaultFormatterOptions": {
                        "js-beautify-html": {
                            "wrap_attributes": "force-expand-multiline"
                        },
                        "prettyhtml": {
                            "printWidth": 100,
                            "singleQuote": false,
                            "wrapAttributes": false,
                            "sortAttributes": false
                        }
                    },
                    "styleInitialIndent": false,
                    "scriptInitialIndent": false
                },
                "trace": {
                    "server": "verbose"
                },
                "dev": {
                    "logLevel": "DEBUG"
                },
                "experimental": {
                    "templateInterpolationService": false
                }
            },
            "emmet": {},
            "html": {},
            "javascript": {
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": true
                },
                "referencesCodeLens": {
                    "enable": true
                },
                "preferences": {
                    "importModuleSpecifier": "auto",
                    "importModuleSpecifierEnding": "auto",
                    "quoteStyle": "auto"
                },
                "validate": {
                    "enable": true
                },
                "suggestionActions": {
                    "enabled": true
                },
                "suggest": {
                    "names": true,
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true,
                    "includeAutomaticOptionalChainCompletions": true
                },
                "format": {
                    "enabled": true,
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false,
                    "semicolons": "ignore"
                }
            },
            "typescript": {
                "showUnused": true,
                "updateImportsOnFileMove": {
                    "enable": true
                },
                "implementationsCodeLens": {
                    "enable": true
                },
                "referencesCodeLens": {
                    "enable": true
                },
                "preferences": {
                    "importModuleSpecifier": "auto",
                    "importModuleSpecifierEnding": "auto",
                    "quoteStyle": "auto"
                },
                "suggestionActions": {
                    "enabled": true
                },
                "validate": {
                    "enable": true
                },
                "suggest": {
                    "enabled": true,
                    "paths": true,
                    "autoImports": true,
                    "completeFunctionCalls": true,
                    "includeAutomaticOptionalChainCompletions": true
                },
                "format": {
                    "enabled": true,
                    "insertSpaceAfterCommaDelimiter": true,
                    "insertSpaceAfterConstructor": false,
                    "insertSpaceAfterSemicolonInForStatements": true,
                    "insertSpaceBeforeAndAfterBinaryOperators": true,
                    "insertSpaceAfterKeywordsInControlFlowStatements": true,
                    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
                    "insertSpaceBeforeFunctionParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
                    "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
                    "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
                    "insertSpaceAfterTypeAssertion": false,
                    "placeOpenBraceOnNewLineForFunctions": false,
                    "placeOpenBraceOnNewLineForControlBlocks": false,
                    "semicolons": "ignore"
                },
                "workspaceSymbols": {
                    "scope": "allOpenProjects"
                }
            },
            "prettier": {},
            "stylusSupremacy": {}
        },
        "globalSnippetDir": "/Users/rainux/Library/Application Support/Code/User/snippets/vetur"
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///Users/rainux/devel/kokkoro-notes",
            "name": "kokkoro-notes"
        }
    ],
    "clientInfo": {
        "name": "coc.nvim",
        "version": "0.0.78"
    }
}


[Trace - 4:39:21 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "Loaded bundled [email protected]."
}


Loaded bundled [email protected].

Issue with Emmet completion

This plugin is almost perfect, but when I try to use it for emmet completions, the completion menu displaying emmet options will appear and then disappear on each additional keypress.

I'm not too sure how to debug this. I thought I'd just see if any one has experience anything similar. I've also tried installing the coc-emmet plugin along with coc-vetur, it didn't seem to make a difference with this bug.

coc-emmet-issue-demo

Failed module lookup if parent folder has a .git folder

I have the following structure

.
├── .git
├── .gitattributes
├── .gitignore
├── .prettierrc
└── web
    ├── .eslintrc.js
    ├── .gitignore
    ├── README.md
    ├── babel.config.js
    ├── jest.config.js
    ├── node_modules
    ├── package.json
    ├── postcss.config.js
    ├── public
    ├── src
    ├── tsconfig.json
    ├── vue.config.js
    └── yarn.lock

And when I cd web and launch vim, if I open a .vue file it cannot resolve any modules that I have defined in paths. Example:

import Me from '@m/Me'

However, if I delete the .git folder module resolution now works fine.


This is my paths section in tsconfig.json

    "paths": {
      "@/*": ["src/*"],
      "@common/*": ["src/common/src/*"],
      "@t/*": ["src/common/src/types/*"],
      "@m/*": ["src/common/src/models/*"],
      "@c/*": ["src/common/src/components/*"],
      "@a/*": ["src/common/src/assets/*"]
    },

Not sure if this is relevant, but this is part of my vue.config.js

    resolve: {
      symlinks: false,
      alias: {
        '@common': path.resolve('./src/common/src'),
        '@t': path.resolve('./src/common/src/types'),
        '@m': path.resolve('./src/common/src/models'),
        '@c': path.resolve('./src/common/src/components'),
        '@a': path.resolve('./src/common/src/assets'),
      },
    },

My coc.vim version:

## versions

vim version: NVIM v0.5.0-144-g568900806
node version: v12.5.0
coc.nvim version: 0.0.74-9796d96780
term: iTerm.app
platform: darwin

coc-vetur not working: vls keeps stopping

Hi,

OS: Ubuntu 18
Node: v13

Error (:CocOpenLog):

2020-05-14T01:50:05.279 INFO (pid:20661) [language-client-index] - vetur started with 20719
   17 2020-05-14T01:50:05.813 INFO (pid:20661) [services] - Vetur Language Server state change: starting => running
   18 2020-05-14T01:50:06.033 INFO (pid:20661) [services] - Vetur Language Server state change: running => stopped
   19 2020-05-14T01:50:06.033 INFO (pid:20661) [services] - Vetur Language Server state change: stopped => starting
....

I freshly installed neovim, then coc.nvim, then multiple coc extensions, but with coc-vetur I'm facing a problem. When I open a .vue file nothing is working, except a very basic completion on the current file. I checked the coc's logs and I discovered that vls was stopping again and again (5 times max).

I already tried to install vls globally and edit the path in the coc configuration but it's not working, even putting a wrong path isn't triggering anything, still having this start/stop thing.

Do you have any idea of what could be happening?

Thank you

Vetur won't read my prettier configs

Hi, I have a problem with my Vetur.
I don't know if I'm missing something or it's a bug.

My vetur is working fine (thanks, is awesome), but it won't alert me of rules like no comma dangle or singleQuotes.
I tried to configure prettier on my coc-settings.json and on the project folder with .prettierrc.js and .prettierrc.
I'm kinda lost with.

Here are my configs.

module.exports = {
  trailingComma: 'none',
  tabWidth: 2,
  semi: false,
  singleQuote: true
}

Thanks

Error when installing coc-vetur

I'm getting an error when installing coc-vetur, coc-prettier and coc-tsserver
this seems to be linked to the dependency on @chemzqm/tslint-config as shown here:
image

Everywhere: [Vetur 2683] [E] 'this' implicitly has type 'any' because it does not have a type annotation

I don't know if this is a Vetur problem or a coc-vetur problem, or a problem with my config, though I have the problem it does not work anymore when I open . It worked some time ago, but now when I open such a .vue file in my project:

<template>
  <div />
</template>

<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  name: "bla"
})
</script>

... it marks the first line (<template>) and gives ...

1 test.vue|1 col 1 error| [Vetur 2683] 'this' implicitly has type 'any' because it does not have a type annotation. [E]
2 test.vue|1 col 1 error| [Vetur 2345] Argument of type 'boolean' is not assignable to parameter of type 'new (...args: any[]) => any'. [E]

On bigger .vue files it marks a lot of more places, mostly giving 'this' implicitly has type 'any' error.

After I modify the file and save it, the error goes away though. It is really annoying, because on first open (of any .vue file) vim is really slow and takes a while.

I think I need to trace this down further, any idea how to debug this?

Outline view isn't retrieving all of the symbols

Problem

*Hey there, I love the plug-in. Really helpful. It works great except for one minor issue, I've noticed that I can't access a lot of the symbols compared to something like vs-codes outline view. For instance, when I inspect the symbols in outline view I get all of the class names and everything in the template but for some reason, it seems to completely skip everything in the script tag except for the default object. Here are some screenshots to further explain what I mean.

Examples

Some test code in Vue

Screenshot 2020-06-30 at 15 40 48

The symbols in the outline view in vim:

Screenshot 2020-06-30 at 15 41 22

Screenshot 2020-06-30 at 15 41 53

The outline view with symbols in vs code looks further into the script methods and properties

Screenshot 2020-06-30 at 15 44 02

If you need any more information or if I wasn't descriptive enough let me know

Extra spacing before closing tabs when using snippets

Hi everyone,
I use Vim 8 and installed coc-vetur successfully. The problem is that when I use vetur snippets, there is an extra amount of space before closing tags that don't seem right.

spacing-before-format

Even when I use :Format command to format my code, things get worse.

spacing-after-format

I checked out the configurations but didn't find anything that might be related to this issue.

Cannot add filetypes

I am trying to set vetur to work in .ts files. Readme said:
vetur.filetypes filetypes for vetur, default ['vue']

But when I'm adding this property into coc-settings.json it doesn't work.

Also it is not shown in coc-settings.json autocomplete and it has error when adding manually:

Screenshot from 2019-04-26 17-13-43

Module not found - 'vscode-css-languageservice/lib/umd/data/browsers'

Hello! I just installed the extension but I'm getting issue. I'm not sure if this is related to the current extension but this is the output when I run :CocCommand workspace.showOutput

Error: Cannot find module 'vscode-css-languageservice/lib/umd/data/browsers'
Require stack:

  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/completion-item.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/index.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/embeddedSupport/languageModes.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/services/vls.js
  • /home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/vueServerMain.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js:7:17)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/css-browser-data.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/completion-item.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/modes/style/stylus/index.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/embeddedSupport/languageModes.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/services/vls.js',
    '/home/USER/.config/coc/extensions/node_modules/coc-vetur/node_modules/vue-language-server/dist/vueServerMain.js'
    ]

[coc.nvim] vetur complete error: TypeError: Cannot read property 'hasOwnProperty' of null

I get this error when working with template markup:

[coc.nvim] vetur complete error: TypeError: Cannot read property 'hasOwnProperty' of null

To reproduce, use with coc-html. Create an html element within the <template> and start typing the inner text.

Example:

<template>
<p>Start typing...</p> #<-- while typing within the <p> tag you will get this error.
</template>

npm-run-all: not found

npm-run-all is not in the dependencies.
If you don't have it installed globally it will not work.
You should probably add it to the dependencies.

> [email protected] prepare PATH_TO_PLUGIN_DIR/neoclide/coc-vetur
> npm-run-all clean build

sh: 1: npm-run-all: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] prepare: `npm-run-all clean build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    *LOG_PATH_HERE*

Component: Argument of type ... not assignable

This might also be an issue with vetur (#10), but since I am using coc-vim I don't even know which version of vetur I am using, so I report it here first, maybe you can help.

When I import any component, for example like this:

<template>
  <div />
</template>

<script lang="ts">
import Vue from 'vue'

import Component from "@/components/Logo.vue"

export default Vue.extend({
  name: "bla",
  components: { Component }
})
</script>

It give me:

test.vue|10 col 27 error| [Vetur 2345] Argument of type '{ name: string; components: { Component: boolean; }; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>>'. [E]

Somehow it thinks the component is of type boolean.

I'd report this to vetur directly (if this i a vetur problem), but how can I see the version of vetur being used?

vue import go to definition fail

Hello.
I recently installed coc and coc-vetur.
But I faced a problem with go to definiton feature. It does not work in my project with imports like this:
import withForm from "@/mixins/withForm";

Can you help me with it?
Thanks

coc-vetur doesn't update diagnostics

Thanks for your work!

Coc-vetur doesn't update diagnostics in vue applications with typescript and imported external typescript modules. I have created minimal vue application with vue create as an example of this issue: https://github.com/andbar-ru/test-app

File https://github.com/andbar-ru/test-app/blob/master/src/components/HelloWorld.vue has error "[Vetur 2322] [E] Type '{ a: string; b: string; c: string; }' is not assignable to type 'ITestObject'." on the line 50 ("c: 'c',") But if I uncomment line 4 in the file https://github.com/andbar-ru/test-app/blob/master/src/components/types.ts to resolve this error, Vetur doesn't update diagnostic info and continues to show this error. Editing and saving file or reloading it doesn't help. Only reloading extension with the command :call CocAction('reloadExtension', 'coc-vetur') makes coc-vetur to update diagnostics. The same happens if then comment line 4 in the file types.ts -- coc-vetur doesn't show error in the file HelloWorld.vue until reloading extension. This issue happens in the last gvim and neovim (appImages)

VSCode's vetur updates diagnostics without problems.

Installed coc extensions:
coc-tsserver
coc-vetur
coc-eslint
coc-prettier
coc-json
coc-css

coc-settings.json:

{
  "coc.preferences.colorSupport": false,
  "coc.preferences.currentFunctionSymbolAutoUpdate": false,
  "codeLens.enable": true,
  "diagnostic.errorSign": "E",
  "diagnostic.warningSign": "W",
  "diagnostic.infoSign": "I",
  "diagnostic.hintSign": "H",
  "diagnostic.virtualText": false,
  "suggest.autoTrigger": "none",
  "suggest.noselect": false,
  "eslint.run": "onSave",
  "eslint.filetypes": ["javascript", "typescript", "vue"],
}

If you need more info, I will provide.

Server Vetur Language Server failed to start: Request initialize failed with message: The "path" argument must be of type string. Received type undefined

First off: Thanks for the great tool.

I found an issue with release version 1.1.4. Below is the output of :CocInfo.


versions

vim version: NVIM v0.3.4
node version: v12.7.0
coc.nvim version: 0.0.74-c97d41aa1e
term: screen
platform: linux

Messages

[coc.nvim] Request initialize failed with message: The "path" argument must be of type string. Received type undefined
[coc.nvim] Server Vetur Language Server failed to start: Request initialize failed with message: The "path" argument must be of type string. Received type undefined


Downgrading to release version 1.1.3 fixes the issue.

Export `vetur.completion.scaffoldSnippetSources.*` options for use in `coc-settings.json`

coc-vetur version: 1.1.7 (8c55c4b)

It seems that vetur uses emoji to display completion item type. I use console nvim and font I use doesn't support emoji.

As a result, I see missing character glyph instead of actual icon:

I found a workaround to specify vetur.completion.scaffoldSnippetSources.vetur in coc-settings.json:

While it works good, I now see warning messages in coc-settings.json:

So, I think it would be nice to support this options to be specified in coc-settings.json.

Crashes on load

Error: Cannot find module 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:534:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1278:46)
    at Function.Module._load (module.js:464:25)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1157:31)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/pear/.config/coc/extensions/node_modules/vue-language-server/dist/services/vls.js:4:43)
    at Module._compile (module.js:633:30)
    at Module._compile (pkg/prelude/bootstrap.js:1213:32)
    at Object.Module._extensions..js (module.js:644:10)
[Info  - 12:33:31] Connection to server got closed. Server will restart.
pkg/prelude/bootstrap.js:1176
      throw error;
      ^

Vue cannot find methods that are async

This plugin works right out of the box the only things that I'm not sure if there's some configuration that I need to do or if it's the limitation of the underlying protocol. But if I have an async method I cannot find the definition using find references or go to definition in a .vue file.

for instance I have the following
image

None of the methods that have async will be found. Everything else working as expected simply. The error I get is

[coc.nvim] Definition not found.

vetur.dev.vlsPath not working

Hi, I'm trying to use the global vue-language-server package, however vetur.dev.vlsPath makes coc throw an error: ... vetur server module "/home/username/.config/yarn/global/node_modules/vue-language-server/dist/client/vueMain.js" not found!

There's no client directory in the dist directory, but there is a vueServerMain.js file, is that what it's looking for?

  • using version 0.0.57 of vue-language-server
  • in coc-settings.json:
    "vetur.dev.vlsPath": "/home/username/.config/yarn/global/node_modules/vue-language-server"

Thank you!

Edit: I got here while trying to debug a different error I'm getting about the SFC I'm in not being a module:

coc-vetur error

Edit 2: Deleting the name from the export, and adding it back seems to fix it, very weird.

tsserver only works in 1 buffer

OS: Windows 10
Neovim version: 0.5.0-305

Everything else is updated at the latest release version.
For some reason, the first vue buffer I open has typescript support, but if I open a new buffer and hide the old one (I have set hidden in my config), the new buffer is always missing the typescript features while everything else works.

I looked at vetur's verbose output of CocCommand workspace.showOutput and nothing looks out of the ordinary. The completion request is sent, but I receive nothing.

I tried the same with VSCode, but everything worked perfectly on there.

Any idea on what is happening? What can I do to test it/get more information?
I didn't test with a clean config yet, but I don't think that would be the issue since everything else works (css and html work fine).
Maybe this is a vue-language-server issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.