Skip to content

Commit 60f4127

Browse files
author
Tomasz Maciążek
authored
feat: adopt the new language server (#142)
* feat: adopt the new language server Replaced the code and assets with the content of tomaciazek/vscode-ansible. Adjusted the build, run & debug to work with external language server. Added documentation for running & debugging. * fix: add missing dependency for CI
1 parent 21f54f2 commit 60f4127

File tree

81 files changed

+6768
-7995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6768
-7995
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset
12+
charset = utf-8
13+
14+
# Indent with 2 spaces for JavaScript & TypeScript
15+
[*.{js,ts,json}]
16+
indent_style = space
17+
indent_size = 2

.eslintrc.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2+
"$schema": "https://json.schemastore.org/eslintrc",
3+
"env": {
4+
"commonjs": true,
5+
"es2017": true,
6+
"node": true
7+
},
8+
"extends": ["plugin:@typescript-eslint/recommended", "prettier"],
29
"parser": "@typescript-eslint/parser",
310
"parserOptions": {
4-
"ecmaVersion": 6,
11+
"ecmaVersion": 2019,
512
"sourceType": "module"
613
},
7-
"plugins": [
8-
"@typescript-eslint"
9-
],
10-
"root": true,
14+
"plugins": ["@typescript-eslint"],
1115
"rules": {
12-
"@typescript-eslint/naming-convention": "error",
13-
"@typescript-eslint/semi": "error",
14-
"curly": "error",
15-
"eqeqeq": "error",
16-
"no-throw-literal": "error",
17-
"semi": "off"
16+
"eqeqeq": ["error", "smart"],
17+
"prefer-template": "warn",
18+
"quotes": ["warn", "single"]
1819
}
1920
}

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto

.github/ISSUE_TEMPLATE/bug_report.md

-31
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
name: 🐛 Bug report
3+
description: Create a report to help us improve
4+
labels: bug
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >-
10+
**Thanks for taking the time to fill out this bug report!**
11+
12+
13+
⚠ Please, verify first that your issue is not [already reported][issues].
14+
15+
16+
🛈 **Tip:** If you are seeking community support, or want to ask a
17+
question, please consider [starting a discussion][discussions].
18+
19+
20+
[issues]: ../search?q=is%3Aissue&type=issues
21+
22+
[discussions]: ../discussions
23+
24+
- type: textarea
25+
id: summary
26+
attributes:
27+
label: Summary
28+
description: >-
29+
A clear and concise description of what the bug is.
30+
31+
🛈 **Tip:** You can attach images or log files by clicking this area to
32+
highlight it and then dragging files in.
33+
placeholder: |
34+
TLDR: When I do X, VS Code does/shows Y instead of Z.
35+
36+
To elaborate [...]
37+
validations:
38+
required: true
39+
40+
- type: input
41+
id: extension-version
42+
attributes:
43+
label: Extension version
44+
validations:
45+
required: true
46+
47+
- type: input
48+
id: vscode-version
49+
attributes:
50+
label: VS Code version
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
id: ansible-version
56+
attributes:
57+
label: Ansible Version
58+
description: >-
59+
Paste verbatim output from `ansible --version` below.
60+
61+
**This will be automatically formatted into code, so no need for
62+
backticks.**
63+
render: shell
64+
placeholder: |
65+
$ ansible --version
66+
ansible [core 2.11.1]
67+
config file = ~/.ansible.cfg
68+
configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
69+
ansible python module location = ~/venv/ansible4/lib/python3.6/site-packages/ansible
70+
ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections
71+
executable location = ~/venv/ansible4/bin/ansible
72+
python version = 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0]
73+
jinja version = 3.0.1
74+
libyaml = True
75+
validations:
76+
required: true
77+
78+
- type: textarea
79+
id: environment
80+
attributes:
81+
label: OS / Environment
82+
description: >-
83+
Provide all relevant information, including OS, remote extension used
84+
(underlying OS too), `ansible-lint` version etc.
85+
placeholder: Windows 10, WSL (Ubuntu 18.04), ansible-lint 5.0.12
86+
validations:
87+
required: true
88+
89+
- type: textarea
90+
id: logs
91+
attributes:
92+
label: Relevant log output
93+
description: >-
94+
Please copy and paste any relevant log output (from `Output > Ansible
95+
Server`).
96+
97+
**This will be automatically formatted into code, so no need for
98+
backticks.**
99+
render: shell

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: 💡 Feature request
3+
description: Suggest an idea for this project
4+
labels: enhancement
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >-
10+
**Thanks for taking the time to fill out this feature request!**
11+
12+
13+
⚠ Please, verify first that the feature you want is not [already requested][issues].
14+
15+
16+
🛈 **Tip:** If you are seeking community support, or want to ask a
17+
question, please consider [starting a discussion][discussions].
18+
19+
20+
[issues]: ../search?q=is%3Aissue&type=issues
21+
22+
[discussions]: ../discussions
23+
24+
- type: textarea
25+
id: problem
26+
attributes:
27+
label: Problem
28+
description: >-
29+
Is your feature request related to a problem? Please describe.
30+
31+
🛈 **Tip:** You can attach images or log files by clicking this area to
32+
highlight it and then dragging files in.
33+
placeholder: |
34+
A clear and concise description of what the problem is.
35+
Example: I'm always frustrated when [...]
36+
37+
validations:
38+
required: true
39+
40+
- type: textarea
41+
id: solution
42+
attributes:
43+
label: Solution
44+
description: Describe the solution you'd like.
45+
placeholder: A clear and concise description of what you want to happen.
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: alternatives
51+
attributes:
52+
label: Alternatives
53+
description: Describe alternatives you've considered.
54+
placeholder: >-
55+
A clear and concise description of any alternative solutions or features
56+
you've considered.
57+
58+
- type: textarea
59+
id: context
60+
attributes:
61+
label: Additional context
62+
description: Add any other context or screenshots about the feature request.

.github/workflows/ci.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212

1313
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1414
jobs:
15-
1615
build:
1716
# The type of runner that the job will run on
1817
runs-on: ${{ matrix.os }}
@@ -44,11 +43,11 @@ jobs:
4443
- name: Run build
4544
run: npm run compile
4645

47-
# Run tests
48-
- name: Run test
49-
uses: GabrielBB/[email protected]
50-
with:
51-
run: npm test
46+
# # Run tests
47+
# - name: Run test
48+
# uses: GabrielBB/[email protected]
49+
# with:
50+
# run: npm test
5251

5352
- name: Run package
5453
run: npm run package

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
out
2-
dist
1+
**/.ignore
32
node_modules
4-
.vscode-test/
53
*.vsix
6-
vscode-plugin.code-workspace
4+
out

.pass

-1
This file was deleted.

.pre-commit-config.yaml

+48-40
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
11
---
22
repos:
3-
- repo: https://github.com/pre-commit/pre-commit-hooks.git
4-
rev: v4.0.1
5-
hooks:
6-
- id: end-of-file-fixer
7-
- id: trailing-whitespace
8-
exclude: >
9-
(?x)^(
10-
examples/playbooks/(with-skip-tag-id|unicode).yml|
11-
examples/playbooks/example.yml
12-
)$
13-
- id: mixed-line-ending
14-
- id: check-byte-order-marker
15-
- id: check-executables-have-shebangs
16-
- id: check-merge-conflict
17-
- id: check-json
18-
- id: pretty-format-json
19-
exclude: >
20-
(?x)^(
21-
package-lock.json
22-
)$
23-
args: ['--autofix']
24-
- id: debug-statements
25-
language_version: python3
26-
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
27-
rev: v5.0.0
28-
hooks:
29-
- id: commitlint
30-
stages: [commit-msg]
31-
- repo: https://github.com/pre-commit/mirrors-eslint
32-
rev: v7.31.0
33-
hooks:
34-
- id: eslint
35-
additional_dependencies:
36-
- "@typescript-eslint/eslint-plugin"
37-
- "@typescript-eslint/parser"
38-
- eslint
39-
- typescript
40-
- typescript-eslint
41-
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
42-
types: [file]
3+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
4+
rev: v4.0.1
5+
hooks:
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
exclude: >
9+
(?x)^(
10+
examples/playbooks/(with-skip-tag-id|unicode).yml|
11+
examples/playbooks/example.yml
12+
)$
13+
- id: mixed-line-ending
14+
- id: check-byte-order-marker
15+
- id: check-executables-have-shebangs
16+
- id: check-merge-conflict
17+
- id: check-json
18+
# does not support JSON with comments
19+
exclude: >
20+
(?x)^(
21+
jinja-language-configuration.json|
22+
ansible-language-configuration.json
23+
)$
24+
# Prettier does much better job and doesn't sort the entries alphabetically
25+
# - id: pretty-format-json
26+
# exclude: >
27+
# (?x)^(
28+
# package-lock.json
29+
# )$
30+
# args: ['--autofix']
31+
- id: debug-statements
32+
language_version: python3
33+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
34+
rev: v5.0.0
35+
hooks:
36+
- id: commitlint
37+
stages: [commit-msg]
38+
- repo: https://github.com/pre-commit/mirrors-eslint
39+
rev: v7.31.0
40+
hooks:
41+
- id: eslint
42+
additional_dependencies:
43+
- "@typescript-eslint/eslint-plugin"
44+
- "@typescript-eslint/parser"
45+
- eslint
46+
- eslint-config-prettier
47+
- typescript
48+
- typescript-eslint
49+
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
50+
types: [file]

0 commit comments

Comments
 (0)