neoclide / coc-vetur

Vue language server extension for coc.nvim
219 stars 7 forks source link

Add "vetur.showDoctorInfo" command #70

Open yaegassy opened 3 years ago

yaegassy commented 3 years ago

Description

There is a custom command to output debugging information in "vetur" (vls).

The command name is vetur.showDoctorInfo.

I've ported vetur.showDoctorInfo to coc-vetur.

Related code

DEMO

coc-vetur-doctor-info-command

Example of output

Vetur doctor info ``` { "name": "Vetur doctor info", "fileName": "App.vue", "currentProject": { "vueVersion": null, "rootPathForConfig": null, "projectRootFsPath": null }, "activeProjects": [ "/tmp/vetur-doctor-check" ], "projectConfigs": [ { "vlsFullConfig": { "vetur": { "ignoreProjectWarning": true, "useWorkspaceDependencies": false, "validation": { "template": true, "templateProps": false, "interpolation": true, "style": true, "script": true }, "completion": { "autoImport": true, "tagCasing": "kebab", "scaffoldSnippetSources": { "workspace": "💼", "user": "🗒️", "vetur": "✌" } }, "grammar": { "customBlocks": { "docs": "md", "i18n": "json" } }, "format": { "enable": true, "options": { "tabSize": 2, "useTabs": false }, "defaultFormatter": { "html": "prettier", "pug": "prettier", "css": "prettier", "postcss": "prettier", "scss": "prettier", "sass": "sass-formatter", "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 } }, "scriptInitialIndent": false, "styleInitialIndent": false }, "languageFeatures": { "codeActions": true, "updateImportOnFileMove": true }, "trace": { "server": "off" }, "dev": { "vlsPath": "", "vlsPort": -1, "logLevel": "INFO" }, "experimental": { "templateInterpolationService": true } }, "css": {}, "html": { "suggest": { "angular1": true, "ionic": true, "html5": true }, "enable": true, "execArgv": [], "trace": { "server": "off" }, "filetypes": [ "html", "handlebars", "htmldjango", "blade" ], "format": { "enable": true, "wrapLineLength": 120, "unformatted": "wbr", "contentUnformatted": "pre,code,textarea", "indentInnerHtml": false, "preserveNewLines": true, "indentHandlebars": false, "endWithNewline": false, "extraLiners": "head, body, /html", "wrapAttributes": "auto" }, "validate": { "scripts": true, "styles": true, "html": true }, "autoClosingTags": false }, "javascript": { "format": { "enabled": true, "insertSpaceAfterCommaDelimiter": true, "insertSpaceAfterConstructor": false, "insertSpaceAfterSemicolonInForStatements": true, "insertSpaceBeforeAndAfterBinaryOperators": true, "insertSpaceAfterKeywordsInControlFlowStatements": true, "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, "insertSpaceBeforeFunctionParenthesis": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, "insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false, "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, "insertSpaceAfterTypeAssertion": false, "placeOpenBraceOnNewLineForFunctions": false, "placeOpenBraceOnNewLineForControlBlocks": false, "semicolons": "ignore" }, "showUnused": true, "updateImportsOnFileMove": { "enable": true }, "implementationsCodeLens": { "enable": true }, "referencesCodeLens": { "enable": true }, "preferences": { "importModuleSpecifier": "auto", "importModuleSpecifierEnding": "auto", "quoteStyle": "auto", "useAliasesForRenames": true }, "validate": { "enable": true }, "suggestionActions": { "enabled": true }, "suggest": { "names": true, "enabled": true, "paths": true, "autoImports": true, "completeFunctionCalls": true, "includeAutomaticOptionalChainCompletions": true } }, "typescript": { "tsdk": null, "format": { "enabled": true, "insertSpaceAfterCommaDelimiter": true, "insertSpaceAfterConstructor": false, "insertSpaceAfterSemicolonInForStatements": true, "insertSpaceBeforeAndAfterBinaryOperators": true, "insertSpaceAfterKeywordsInControlFlowStatements": true, "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, "insertSpaceBeforeFunctionParenthesis": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, "insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false, "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false, "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, "insertSpaceAfterTypeAssertion": false, "placeOpenBraceOnNewLineForFunctions": false, "placeOpenBraceOnNewLineForControlBlocks": false, "semicolons": "ignore" }, "showUnused": false, "updateImportsOnFileMove": { "enable": true }, "implementationsCodeLens": { "enable": true }, "referencesCodeLens": { "enable": true }, "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 }, "workspaceSymbols": { "scope": "allOpenProjects" } }, "emmet": { "showExpandedAbbreviation": "always", "showAbbreviationSuggestions": true, "includeLanguages": {}, "variables": {}, "syntaxProfiles": {}, "excludeLanguages": [ "markdown", "php" ], "showSuggestionsAsSnippets": true, "preferences": {}, "optimizeStylesheetParsing": true, "priority": 3 }, "stylusSupremacy": {}, "prettier": { "formatterPriority": 1, "disableLanguages": [ "vue" ], "eslintIntegration": false, "tslintIntegration": false, "stylelintIntegration": false, "requireConfig": false, "onlyUseLocalVersion": false, "disableSuccessMessage": true, "statusItemText": "Prettier", "ignorePath": ".prettierignore", "printWidth": 80, "tabWidth": 2, "singleQuote": false, "trailingComma": "es5", "bracketSpacing": true, "jsxBracketSameLine": false, "jsxSingleQuote": false, "htmlWhitespaceSensitivity": "css", "endOfLine": "lf", "parser": "none", "semi": true, "useTabs": false, "proseWrap": "preserve", "arrowParens": "always" } }, "isExistVeturConfig": false, "rootPathForConfig": "/tmp/vetur-doctor-check", "workspaceFsPath": "/tmp/vetur-doctor-check", "rootFsPath": "/tmp/vetur-doctor-check", "tsconfigPath": "/tmp/vetur-doctor-check/tsconfig.json", "packagePath": "/tmp/vetur-doctor-check/package.json", "snippetFolder": "/tmp/vetur-doctor-check/.vscode/vetur/snippets", "globalComponents": [] } ] } ```

Note

It seems that some values are only output in VSCode, but other values are output correctly, so there is no problem. (For example, vueVersion)