Skip to content

Commit 3f8afdb

Browse files
authored
Modernize (#32)
* Use prettier instead of clang-format We're formatting TypeScript, not C/C++. * Modernize This bumps the version to 0.1.19 because the type of `AbortController` is not backwards compatible. - Remove obsolete dependencies. - abort-controller; `AbortController` is stable since Node 15.4.0. - source-map-support; `--enable-source-maps` is supported since Node 12.12.0. - Update dependencies. - Enable strict mode in `tsconfig.json`. - Use `which(..., {nothrow: true})` and distinguish between binary-not-in-PATH and binary-access-failed. Log an error. - Check for presence of clangd binary in zip archive before extracting. - Use native promises APIs instead of `promisify`. - Assign severity to all logs (no more `console.log`).
1 parent 37ee1af commit 3f8afdb

File tree

10 files changed

+2923
-2168
lines changed

10 files changed

+2923
-2168
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
name: CI
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [master]
55
pull_request:
6-
branches: [ master ]
6+
branches: [master]
77
jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- run: npm ci
13-
- run: npm test
14-
- name: clang-format (diff)
15-
if: github.event_name == 'pull_request'
16-
env:
17-
BASE: ${{ github['base_ref'] }}
18-
run: |
19-
git fetch --no-tags --prune --depth=1 origin +refs/heads/$BASE:refs/remotes/origin/$BASE
20-
npm run git-clang-format -- --diff origin/$BASE |\
21-
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}'
22-
- name: clang-format (project)
23-
if: github.event_name == 'push'
24-
run: |
25-
npm run git-clang-format -- --diff --commit $(git hash-object -t tree /dev/null) |\
26-
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}'
11+
- uses: actions/checkout@v4
12+
- run: npm ci
13+
- run: npm test
14+
- run: npx prettier . --check

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules/
22
out/
3-

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"bracketSpacing": false,
3+
"singleQuote": true
4+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# node-clangd
2+
23
Shared features of vscode-clangd and coc-clangd

0 commit comments

Comments
 (0)