Skip to content

Commit 59abd44

Browse files
committed
Init
0 parents  commit 59abd44

32 files changed

+3867
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/**
2+
client/node_modules/**
3+
client/out/**
4+
server/node_modules/**
5+
server/out/**

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**@type {import('eslint').Linter.Config} */
2+
// eslint-disable-next-line no-undef
3+
module.exports = {
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
plugins: [
7+
'@typescript-eslint',
8+
],
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:@typescript-eslint/recommended',
12+
],
13+
rules: {
14+
'semi': [2, "always"],
15+
'@typescript-eslint/no-unused-vars': 0,
16+
'@typescript-eslint/no-explicit-any': 0,
17+
'@typescript-eslint/explicit-module-boundary-types': 0,
18+
'@typescript-eslint/no-non-null-assertion': 0,
19+
}
20+
};

.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 6,
5+
"sourceType": "module"
6+
},
7+
"env": {
8+
"node": true
9+
},
10+
"rules": {
11+
"semi": "error",
12+
"no-extra-semi": "warn",
13+
"curly": "warn",
14+
"quotes": ["error", "single", { "allowTemplateLiterals": true } ],
15+
"eqeqeq": "error",
16+
"indent": ["warn", "tab", { "SwitchCase": 1 } ]
17+
}
18+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
out
2+
node_modules
3+
client/server
4+
.vscode-test

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"dbaeumer.vscode-eslint"
8+
]
9+
}

.vscode/launch.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
{
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"name": "Launch Client",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11+
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
12+
"preLaunchTask": {
13+
"type": "npm",
14+
"script": "watch"
15+
}
16+
},
17+
{
18+
"type": "node",
19+
"request": "attach",
20+
"name": "Attach to Server",
21+
"port": 6009,
22+
"restart": true,
23+
"outFiles": ["${workspaceRoot}/server/out/**/*.js"]
24+
},
25+
{
26+
"name": "Language Server E2E Test",
27+
"type": "extensionHost",
28+
"request": "launch",
29+
"runtimeExecutable": "${execPath}",
30+
"args": [
31+
"--extensionDevelopmentPath=${workspaceRoot}",
32+
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
33+
"${workspaceRoot}/client/testFixture"
34+
],
35+
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
36+
}
37+
],
38+
"compounds": [
39+
{
40+
"name": "Client + Server",
41+
"configurations": ["Launch Client", "Attach to Server"]
42+
}
43+
]
44+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"editor.insertSpaces": false,
3+
"tslint.enable": true,
4+
"typescript.tsc.autoDetect": "off",
5+
"typescript.preferences.quoteStyle": "single",
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": true
8+
}
9+
}

.vscode/tasks.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "compile",
7+
"group": "build",
8+
"presentation": {
9+
"panel": "dedicated",
10+
"reveal": "never"
11+
},
12+
"problemMatcher": [
13+
"$tsc"
14+
]
15+
},
16+
{
17+
"type": "npm",
18+
"script": "watch",
19+
"isBackground": true,
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"presentation": {
25+
"panel": "dedicated",
26+
"reveal": "never"
27+
},
28+
"problemMatcher": [
29+
"$tsc-watch"
30+
]
31+
}
32+
]
33+
}

.vscodeignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode/**
2+
**/*.ts
3+
**/*.map
4+
.gitignore
5+
**/tsconfig.json
6+
**/tsconfig.base.json
7+
contributing.md
8+
.travis.yml
9+
client/node_modules/**
10+
!client/node_modules/vscode-jsonrpc/**
11+
!client/node_modules/vscode-languageclient/**
12+
!client/node_modules/vscode-languageserver-protocol/**
13+
!client/node_modules/vscode-languageserver-types/**
14+
!client/node_modules/semver/**

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# LSP Example
2+
3+
Heavily documented sample code for https://code.visualstudio.com/api/language-extensions/language-server-extension-guide
4+
5+
## Functionality
6+
7+
This Language Server works for plain text file. It has the following language features:
8+
- Completions
9+
- Diagnostics regenerated on each file change or configuration change
10+
11+
It also includes an End-to-End test.
12+
13+
## Structure
14+
15+
```
16+
.
17+
├── client // Language Client
18+
│ ├── src
19+
│ │ ├── test // End to End tests for Language Client / Server
20+
│ │ └── extension.ts // Language Client entry point
21+
├── package.json // The extension manifest.
22+
└── server // Language Server
23+
└── src
24+
└── server.ts // Language Server entry point
25+
```
26+
27+
## Running the Sample
28+
29+
- Run `npm install` in this folder. This installs all necessary npm modules in both the client and server folder
30+
- Open VS Code on this folder.
31+
- Press Ctrl+Shift+B to compile the client and server.
32+
- Switch to the Debug viewlet.
33+
- Select `Launch Client` from the drop down.
34+
- Run the launch config.
35+
- If you want to debug the server as well use the launch configuration `Attach to Server`
36+
- In the [Extension Development Host] instance of VSCode, open a document in 'plain text' language mode.
37+
- Type `j` or `t` to see `Javascript` and `TypeScript` completion.
38+
- Enter text content such as `AAA aaa BBB`. The extension will emit diagnostics for all words in all-uppercase.

0 commit comments

Comments
 (0)