Skip to content

Commit a69bd24

Browse files
author
Akos Kitta
committed
Init.
Signed-off-by: Akos Kitta <[email protected]>
0 parents  commit a69bd24

13 files changed

+6620
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
lib/
3+
bin/
4+
dist/
5+
*.zip
6+
*.vsix

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
"name": "Launch Arduino Language Server – VS Code Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}"
12+
],
13+
"stopOnEntry": false,
14+
"sourceMaps": true,
15+
"outFiles": [
16+
"${workspaceRoot}/lib/**/*.js"
17+
],
18+
"preLaunchTask": "npm"
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"tslint.configFile": "./tslint.json",
3+
"editor.formatOnSave": true,
4+
"files.exclude": {
5+
"**/lib": false
6+
},
7+
"editor.insertSpaces": true,
8+
"editor.detectIndentation": false,
9+
"[typescript]": {
10+
"editor.tabSize": 4
11+
},
12+
"[json]": {
13+
"editor.tabSize": 2
14+
},
15+
"[jsonc]": {
16+
"editor.tabSize": 2
17+
},
18+
"files.insertFinalNewline": true,
19+
"typescript.tsdk": "node_modules/typescript/lib"
20+
}

.vscode/tasks.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "2.0.0",
3+
"command": "npm",
4+
"args": [
5+
"run",
6+
"compile"
7+
],
8+
"isBackground": true,
9+
"problemMatcher": "$tsc-watch"
10+
}

.vscodeignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
src/
2+
lib/
3+
configs/
4+
dist/**/*.map
5+
node_modules/
6+
**/tsconfig.json
7+
yarn.lock
8+
*.zip

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Arduino Language extension for VS Code
2+
3+
### Quick Start
4+
To build the Arduino Language Server VS Code extension (VSIX), execute:
5+
```
6+
yarn
7+
```
8+
9+
It will generate a `vscode-arduino-language-server-x.x.x.vsix` file in the project root.
10+
In VS Code, open the `Extensions` panel, click on the ellipses (`...`) and select `Install from VSIX...`.
11+
Or from the [_Command Palette_](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix).
12+
13+
You can also start the extension in debug mode.
14+
Open the `Debug` panel, and select the `Launch Arduino Language Server VS Code Extension` launch configuration.
15+
16+
### TODOs
17+
- [x] Use `webpack` to bundle the dependencies into a single JS module to reduce the size of the extension.
18+
- [ ] Integrate the VSIX packaging into the GitHub Actions.
19+
- [x] Wire additional language features: `Go to Definition`, `Peak Definition`, `Find All References`, etc...
20+
- [x] Bump up the version of the `vscode` and `vscode-languageclient` dependencies.
21+
- [ ] Discuss `licensing`, `author`, and `publisher`.
22+
- [ ] _Add your item_

configs/webpack.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-check
2+
3+
const path = require('path');
4+
5+
/**
6+
* @type {import('webpack').Configuration}
7+
*/
8+
const config = {
9+
target: 'node',
10+
entry: './lib/extension.js',
11+
output: {
12+
path: path.resolve(__dirname, '..', 'dist'),
13+
filename: 'bundle.js',
14+
libraryTarget: 'commonjs2',
15+
devtoolModuleFilenameTemplate: '../[resource-path]',
16+
},
17+
mode: 'production',
18+
devtool: 'source-map',
19+
externals: {
20+
vscode: 'commonjs vscode'
21+
},
22+
resolve: {
23+
extensions: ['.js']
24+
}
25+
};
26+
module.exports = config;
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": [
5+
"/*",
6+
"*/"
7+
],
8+
},
9+
"brackets": [
10+
[
11+
"{",
12+
"}"
13+
],
14+
[
15+
"[",
16+
"]"
17+
],
18+
[
19+
"(",
20+
")"
21+
]
22+
],
23+
"autoClosingPairs": [
24+
{
25+
"open": "[",
26+
"close": "]"
27+
},
28+
{
29+
"open": "{",
30+
"close": "}"
31+
},
32+
{
33+
"open": "(",
34+
"close": ")"
35+
},
36+
{
37+
"open": "\"",
38+
"close": "\"",
39+
"notIn": [
40+
"string",
41+
"comment"
42+
]
43+
},
44+
{
45+
"open": "\"",
46+
"close": "\"",
47+
"notIn": [
48+
"string"
49+
]
50+
},
51+
{
52+
"open": "/*",
53+
"close": " */",
54+
"notIn": [
55+
"string"
56+
]
57+
}
58+
],
59+
"surroundingPairs": [
60+
{
61+
"open": "{",
62+
"close": "}"
63+
},
64+
{
65+
"open": "[",
66+
"close": "]"
67+
},
68+
{
69+
"open": "(",
70+
"close": ")"
71+
},
72+
{
73+
"open": "\"",
74+
"close": "\""
75+
},
76+
{
77+
"open": "\"",
78+
"close": "\""
79+
},
80+
],
81+
"folding": {
82+
"markers": {
83+
"start": "^\\s*#pragma\\s+region\\b",
84+
"end": "^\\s*#pragma\\s+endregion\\b"
85+
}
86+
}
87+
}

package.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"name": "vscode-arduino-language-server",
3+
"private": true,
4+
"version": "0.0.1",
5+
"publisher": "arduino",
6+
"license": "MIT",
7+
"author": "Arduino SA",
8+
"description": "Arduino Language Server extension for VS Code",
9+
"main": "./dist/bundle",
10+
"engines": {
11+
"vscode": "^1.46.0"
12+
},
13+
"scripts": {
14+
"prepare": "yarn clean && yarn compile && yarn webpack && yarn package",
15+
"clean": "rimraf ./lib",
16+
"compile": "tsc -p ./",
17+
"watch": "tsc -w -p ./",
18+
"webpack": "webpack --config ./configs/webpack.config.js",
19+
"package": "vsce package"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "https://github.com/arduino/vscode-arduino-language-server"
24+
},
25+
"bugs": {
26+
"url": "https://github.com/arduino/vscode-arduino-language-server/issues"
27+
},
28+
"devDependencies": {
29+
"@types/node": "^10.14.9",
30+
"@types/vscode": "^1.41.0",
31+
"rimraf": "^3.0.2",
32+
"typescript": "^3.8.3",
33+
"vsce": "^1.66.0",
34+
"vscode": "^1.1.33",
35+
"webpack": "^4.39.1",
36+
"webpack-cli": "^3.3.6"
37+
},
38+
"dependencies": {
39+
"@types/deep-equal": "^1.0.1",
40+
"deep-equal": "^2.0.3",
41+
"path": "^0.12.7",
42+
"vscode-languageclient": "^6.1.3",
43+
"web-request": "^1.0.7"
44+
},
45+
"keywords": [
46+
"arduino",
47+
"iot",
48+
"ino",
49+
"IntelliSense"
50+
],
51+
"files": [
52+
"src",
53+
"lib",
54+
"syntaxes",
55+
"languages"
56+
],
57+
"categories": [
58+
"Programming Languages",
59+
"Formatters"
60+
],
61+
"galleryBanner": {
62+
"color": "#006468",
63+
"theme": "light"
64+
},
65+
"activationEvents": [
66+
"onCommand:arduino.languageserver.start"
67+
],
68+
"contributes": {
69+
"languages": [
70+
{
71+
"id": "ino",
72+
"aliases": [
73+
"INO",
74+
"Ino",
75+
"ino"
76+
],
77+
"extensions": [
78+
".ino"
79+
],
80+
"configuration": "./languages/ino.language-configuration.json"
81+
}
82+
],
83+
"grammars": [
84+
{
85+
"language": "ino",
86+
"scopeName": "source.ino",
87+
"path": "./syntaxes/ino.tmGrammar.json"
88+
}
89+
],
90+
"commands": [
91+
{
92+
"command": "arduino.languageserver.start",
93+
"title": "Arduino: Start/Restart Language Server",
94+
"description": "Start the language server or restart if there is a running instance"
95+
}
96+
]
97+
}
98+
}

0 commit comments

Comments
 (0)