added vscode extensions

This commit is contained in:
tomit4 2021-11-05 11:26:45 -07:00
parent 7cde0829be
commit 26e2a50441
316 changed files with 37301 additions and 0 deletions

View file

@ -0,0 +1,3 @@
node_modules
dist
typings

View file

@ -0,0 +1,4 @@
ui: tdd
color: true
require: 'source-map-support/register'
spec: './dist-test/**/*.test.js'

View file

@ -0,0 +1 @@
message = "Vue Language Server %s"

View file

@ -0,0 +1,64 @@
## Vue Language Server
[VLS](https://www.npmjs.com/package/vls) (Vue Language Server) is a language server implementation compatible with [Language Server Protocol](https://github.com/microsoft/language-server-protocol).
Vetur is the VS Code client consuming `vls`.
It's possible for other LSP compatible editors to build language server clients that consume `vls`.
## Usage
There are two ways to integrate `vls` into editors:
1. As a global executable.
Example Client: https://github.com/autozimu/LanguageClient-neovim
First, install VLS globally.
```bash
npm install vls -g
# or yarn global add vls
```
This will provide you the global `vls` command.
Then, configure LanguageClient to use `vls`. In this example, we write below configuration into `init.vim`.
```vim
let g:LanguageClient_serverCommands = {
\ 'vue': ['vls']
\ }
```
2. As a plugin dependency.
Example: https://github.com/HerringtonDarkholme/atom-vue
First, install vls as a local dependency.
```bash
npm install vls --save
# or yarn add vls
```
Then, require the vls, this would typically look like:
```ts
class VueLanguageClient extends AutoLanguageClient {
startServerProcess () {
return cp.spawn('node', [require.resolve('vls/dist/htmlServerMain')])
}
}
```
3. As extension of [coc.nvim](https://github.com/neoclide/coc.nvim)
Install [coc.nvim](https://github.com/neoclide/coc.nvim) in your vim/neovim.
Then, run vim command
```
:CocInstall coc-vetur
```

View file

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../dist/vueServerMain.js')

View file

@ -0,0 +1,86 @@
{
"name": "vls",
"description": "Vue Language Server",
"version": "0.7.4",
"author": "Pine Wu <octref@gmail.com>",
"license": "MIT",
"main": "dist/vls.js",
"typings": "dist/vls.d.ts",
"bin": {
"vls": "./bin/vls"
},
"engines": {
"node": ">=10"
},
"files": [
"dist",
"bin"
],
"repository": {
"type": "git",
"url": "https://github.com/vuejs/vetur.git"
},
"homepage": "https://github.com/vuejs/vetur/tree/master/server",
"dependencies": {
"eslint": "^7.27.0",
"eslint-plugin-vue": "^7.10.0",
"prettier": "^2.3.0",
"tslint": "6.1.3",
"typescript": "^4.3.2"
},
"resolutions": {
"typescript": "^4.3.2"
},
"devDependencies": {
"@prettier/plugin-pug": "^1.15.2",
"@starptech/prettyhtml": "^0.10.0",
"@types/eslint": "7.2.2",
"@types/eslint-scope": "^3.7.0",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/glob": "^7.1.3",
"@types/js-beautify": "1.13.1",
"@types/lodash": "^4.14.170",
"@types/mocha": "^8.2.2",
"@types/node": "^15.6.1",
"@types/prettier": "^2.2.3",
"@types/read-pkg-up": "^6.0.0",
"@types/resolve": "1.20.0",
"bootstrap-vue-helper-json": "^1.1.1",
"codecov": "^3.8.2",
"core-js": "^3.13.1",
"element-helper-json": "^2.0.6",
"fast-glob": "^3.2.5",
"glob": "^7.1.7",
"gridsome-helper-json": "^1.0.3",
"js-beautify": "^1.13.13",
"lodash": "^4.17.21",
"mocha": "^8.4.0",
"nuxt-helper-json": "^1.0.0",
"nyc": "^15.1.0",
"parse-gitignore": "^1.0.1",
"prettier-eslint": "^12.0.0",
"prettier-tslint": "^0.4.2",
"rollup": "^2.50.5",
"sass-formatter": "^0.7.1",
"source-map-support": "^0.5.19",
"stylus": "^0.54.8",
"stylus-supremacy": "^2.15.0",
"vscode-css-languageservice": "5.1.3",
"vscode-emmet-helper": "2.6.4",
"vscode-languageserver": "7.0.0",
"vscode-languageserver-textdocument": "^1.0.1",
"vscode-languageserver-types": "3.16.0",
"vscode-uri": "^3.0.2",
"vscode-web-custom-data": "^0.3.4",
"vue-eslint-parser": "^7.6.0",
"vue-onsenui-helper-json": "^1.0.2"
},
"scripts": {
"compile": "rollup -c rollup.config.js",
"watch": "rollup -c rollup.config.js -w",
"test": "tsc -p tsconfig.test.json && mocha",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"newVersion": "yarn version --new-version patch -m \"vls %s\"",
"preversion": "yarn compile && yarn test"
}
}

View file

@ -0,0 +1,74 @@
const fs = require('fs-extra');
const path = require('path');
const fg = require('fast-glob');
const { getRootPath, clearDist, external, onwarn, createPlugins } = require('../build/rollup-common-config');
const {
linkVlsInCLI,
bundleVlsWithEsbuild,
watchVlsChange,
generateTypingsVls
} = require('../build/rollup-plugins.js');
const vlsPkg = require('./package.json');
const dts = require('rollup-plugin-dts').default;
const getVLSPath = getRootPath('server');
clearDist(getVLSPath('dist'));
function copySnippets() {
return {
name: 'copy-snippets',
buildEnd() {
fs.copySync(getVLSPath('src/modes/vue/veturSnippets'), getVLSPath('dist/veturSnippets'), {
overwrite: true,
recursive: true
});
}
};
}
function copyTSDefaultLibs() {
return {
name: 'copy-ts-default-libs',
buildEnd() {
const files = fg.sync('node_modules/typescript/lib/lib*.d.ts', {
cwd: getVLSPath(''),
unique: true,
absolute: true
});
files.forEach(file => fs.copySync(file, getVLSPath('dist/' + path.basename(file)), { overwrite: true }));
}
};
}
module.exports = [
// vueServerMain
{
input: getVLSPath('src/vueServerMain.ts'),
output: { file: getVLSPath('dist/vueServerMain.js'), name: vlsPkg.name, format: 'cjs', sourcemap: true },
external,
onwarn,
watch: {
include: getVLSPath('**')
},
plugins: [
watchVlsChange(),
generateTypingsVls(),
bundleVlsWithEsbuild(),
copySnippets(),
// copyTSDefaultLibs(),
linkVlsInCLI(),
...createPlugins(getVLSPath('tsconfig.json'))
]
},
// bundle typings
{
input: getVLSPath('typings/main.d.ts'),
output: {
file: getVLSPath('dist/vls.d.ts'),
format: 'es'
},
onwarn,
plugins: [dts()]
}
];