Skip to content

Commit 5382501

Browse files
authored
Merge pull request arduino#28 from arduino/language-server-flags
Update Language Server flags
2 parents 92def71 + 56ca283 commit 5382501

File tree

5 files changed

+63
-36
lines changed

5 files changed

+63
-36
lines changed

Diff for: .github/workflows/build.yml

+4-28
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
name: VS Code Arduino Tools
1+
name: Build
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
workflow_dispatch:
84
pull_request:
95
branches:
106
- main
11-
schedule:
12-
- cron: '0 2 * * *' # run every day at 2AM
137

148
jobs:
15-
169
build:
1710
runs-on: ubuntu-latest
1811
steps:
@@ -22,26 +15,9 @@ jobs:
2215
- name: Install Node.js 12.x
2316
uses: actions/setup-node@v1
2417
with:
25-
node-version: '12.x'
26-
registry-url: 'https://registry.npmjs.org'
18+
node-version: "12.x"
19+
registry-url: "https://registry.npmjs.org"
2720

2821
- name: Build VS Code Extension
2922
run: |
30-
yarn
31-
32-
- name: Upload VS Code Extension [GitHub Actions]
33-
uses: actions/upload-artifact@v2
34-
with:
35-
name: build-artifacts
36-
path: build-artifacts/
37-
38-
- name: Upload VS Code Extension [S3]
39-
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
40-
uses: docker://plugins/s3
41-
env:
42-
PLUGIN_SOURCE: "build-artifacts/*"
43-
PLUGIN_STRIP_PREFIX: "build-artifacts/"
44-
PLUGIN_TARGET: "/vscode-arduino-tools/nightly"
45-
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
46-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
47-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
yarn

Diff for: .github/workflows/deploy.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: "12.x"
22+
registry-url: "https://registry.npmjs.org"
23+
24+
- name: Build VS Code Extension
25+
run: |
26+
yarn
27+
28+
- name: Upload VS Code Extension [GitHub Actions]
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: build-artifacts
32+
path: build-artifacts/
33+
34+
- name: Upload VS Code Extension [S3]
35+
uses: docker://plugins/s3
36+
env:
37+
PLUGIN_SOURCE: "build-artifacts/*"
38+
PLUGIN_STRIP_PREFIX: "build-artifacts/"
39+
PLUGIN_TARGET: "/vscode-arduino-tools"
40+
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
41+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
42+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ In order to ease code reviews and have your contributions merged faster, here is
4242
- Your PR must pass all CI tests before we will merge it. If you're seeing an error and don't think it's your fault, it may not be! The reviewer will help you if there are test failures that seem not related to the change you are making.
4343

4444
## Build
45+
4546
To build the Arduino Tools VS Code extension (VSIX), execute:
47+
4648
```
4749
yarn
4850
```
@@ -54,11 +56,17 @@ Or from the [_Command Palette_](https://code.visualstudio.com/docs/editor/extens
5456
You can also start the extension in debug mode.
5557
Open the `Debug` panel, and select the `Launch Arduino Tools – VS Code Extension` launch configuration.
5658

59+
## Deployments
60+
61+
To deploy a new release of the tools you have to do the following:
62+
63+
- update the `version` in the package.json file
64+
- push a tag to the repo with `v` and the version you spacified in the package.json, for example `v0.0.2-beta.1`
65+
5766
## Donations
5867

5968
This open source code was written by the Arduino team and is maintained on a daily basis with the help of the community. We invest a considerable amount of time in development, testing and optimization. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc/) which is the best way to make sure our effort can continue in the long term.
6069

6170
## License
6271

6372
The code contained in this repository is licensed under the terms of the Apache 2.0 license. If you have questions about licensing please contact us at [[email protected]](mailto:[email protected]).
64-

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vscode-arduino-tools",
33
"private": true,
4-
"version": "0.0.1-beta.1",
4+
"version": "0.0.2-beta.1",
55
"publisher": "arduino",
66
"license": "Apache-2.0",
77
"author": "Arduino SA",

Diff for: src/extension.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { LanguageClient, CloseAction, ErrorAction, InitializeError, Message, Rev
1010

1111
interface LanguageServerConfig {
1212
readonly lsPath: string;
13-
readonly cliPath: string;
14-
readonly cliConfigPath: string;
13+
readonly cliDaemonAddr: string;
14+
readonly cliDaemonInstance: string;
1515
readonly clangdPath: string;
1616
readonly board: {
1717
readonly fqbn: string;
@@ -29,7 +29,8 @@ interface LanguageServerConfig {
2929
}
3030

3131
interface DebugConfig {
32-
readonly cliPath: string;
32+
readonly cliPath?: string;
33+
readonly cliDaemonAddr?: string;
3334
readonly board: {
3435
readonly fqbn: string;
3536
readonly name?: string;
@@ -103,7 +104,7 @@ async function startDebug(_: ExtensionContext, config: DebugConfig): Promise<boo
103104
let rawStdErr: string | undefined = undefined;
104105
try {
105106
const args = ['debug', '-I', '-b', config.board.fqbn, config.sketchPath, '--format', 'json'];
106-
const { stdout, stderr } = spawnSync(config.cliPath, args, { encoding: 'utf8' });
107+
const { stdout, stderr } = spawnSync(config?.cliPath || '.', args, { encoding: 'utf8' });
107108
rawStdout = stdout.trim();
108109
rawStdErr = stderr.trim();
109110
} catch (err) {
@@ -188,8 +189,8 @@ async function startLanguageServer(context: ExtensionContext, config: LanguageSe
188189
}
189190

190191
async function buildLanguageClient(config: LanguageServerConfig): Promise<LanguageClient> {
191-
const { lsPath: command, clangdPath, cliPath, cliConfigPath, board, flags, env, log } = config;
192-
const args = ['-clangd', clangdPath, '-cli', cliPath, '-cli-config', cliConfigPath, '-fqbn', board.fqbn];
192+
const { lsPath: command, clangdPath, cliDaemonAddr, cliDaemonInstance, board, flags, env, log } = config;
193+
const args = ['-clangd', clangdPath, '-cli-daemon-addr', cliDaemonAddr, '-cli-daemon-instance', cliDaemonInstance, '-fqbn', board.fqbn];
193194
if (board.name) {
194195
args.push('-board-name', board.name);
195196
}

0 commit comments

Comments
 (0)