Skip to content

Commit 1bd2095

Browse files
committed
Merge branch 'topic/syntax-highlighting' into 'master'
Improve syntactic and semantic highlighting See merge request eng/ide/ada_language_server!1222
2 parents 1ee77f6 + 2edab84 commit 1bd2095

Some content is hidden

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

50 files changed

+60144
-2934
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ insert_final_newline = true
1010

1111
[*.py]
1212
indent_size = 4
13+
14+
[*.ts]
15+
indent_size = 4

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"ms-python.black-formatter",
4+
"ms-python.flake8",
5+
"editorconfig.editorconfig",
6+
"dbaeumer.vscode-eslint",
7+
"esbenp.prettier-vscode"
8+
]
9+
}

.vscode/launch.json

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,77 @@
4141
"args": [
4242
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
4343
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
44-
"${workspaceFolder}/integration/vscode/ada/test/SampleProject"
44+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
4545
],
46+
"env": {
47+
// This is custom env var that we use in
48+
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
49+
// tests when debugging
50+
"MOCHA_TIMEOUT": "0"
51+
},
52+
// Below we make the executables of node modules visible to the tests.
53+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
54+
// tests.
55+
"windows": {
56+
"env": {
57+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin;${env:PATH}"
58+
}
59+
},
60+
"osx": {
61+
"env": {
62+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
63+
}
64+
},
65+
"linux": {
66+
"env": {
67+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
68+
}
69+
},
70+
"preLaunchTask": "npm: pretest"
71+
},
72+
{
73+
"name": "Extension Tests (Update Test Refs)",
74+
"type": "extensionHost",
75+
"request": "launch",
76+
"runtimeExecutable": "${execPath}",
77+
"outFiles": [
78+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
79+
"!**/node_modules/**"
80+
],
81+
"args": [
82+
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
83+
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
84+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
85+
],
86+
"env": {
87+
// This is custom env var that we use in
88+
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
89+
// tests when debugging
90+
"MOCHA_TIMEOUT": "0",
91+
// Setting this environment variable causes the tests to overwrite
92+
// previous test references when they are stored in files. See
93+
// assertEqualToFileContent in
94+
// integration/vscode/ada/test/suite/highlighting.test.ts
95+
"MOCHA_ALS_UPDATE": "1"
96+
},
97+
// Below we make the executables of node modules visible to the tests.
98+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
99+
// tests.
100+
"windows": {
101+
"env": {
102+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin;${env:PATH}"
103+
}
104+
},
105+
"osx": {
106+
"env": {
107+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
108+
}
109+
},
110+
"linux": {
111+
"env": {
112+
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
113+
}
114+
},
46115
"preLaunchTask": "npm: pretest"
47116
},
48117
{

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"ada.projectFile": "gnat/lsp_server.gpr",
3+
"ada.scenarioVariables": {
4+
// Use static linking in local development to enable running the
5+
// ada_language_server executable after relaction into the VS Code
6+
// extension.
7+
"LIBRARY_TYPE": "static"
8+
},
39
"python.analysis.extraPaths": ["testsuite"],
10+
"python.linting.enabled": true,
11+
"python.linting.mypyEnabled": true,
12+
"python.linting.flake8Enabled": true,
13+
"flake8.args": ["--max-line-length", "88"],
14+
"python.formatting.provider": "black",
15+
"[python]": {
16+
// Use the same line length as black and flake8
17+
"vim.textwidth": 88
18+
},
419
"terminal.integrated.env.osx": {
520
// Dependencies can be provided under the subprojects/ directory. They
621
// would automatically be included in GPR_PROJECT_PATH by the following

.vscode/tasks.json

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"label": "build",
6-
"type": "shell",
7-
"command": "gprbuild",
8-
"args": [
9-
"-p",
10-
"-P",
11-
"${config:ada.projectFile}",
12-
"-cargs",
13-
"-gnatef"
14-
],
15-
"problemMatcher": [
16-
"$ada"
17-
],
18-
"group": {
19-
"kind": "build",
20-
"isDefault": true
21-
}
22-
},
23-
{
24-
"label": "Run tests",
25-
"type": "shell",
26-
"command": "make check",
27-
"problemMatcher": [
28-
"$ada"
29-
],
30-
"group": "test"
31-
},
32-
{
33-
"type": "npm",
34-
"script": "compile",
35-
"path": "integration/vscode/ada",
36-
"group": "build",
37-
"problemMatcher": [],
38-
"label": "npm: compile",
39-
"detail": "node ./node_modules/typescript/bin/tsc",
40-
"presentation": {
41-
"echo": true,
42-
"reveal": "silent",
43-
"focus": false,
44-
"panel": "shared",
45-
"showReuseMessage": true,
46-
"clear": false
47-
}
48-
}
49-
]
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"type": "shell",
7+
"command": "gprbuild",
8+
"args": ["-p", "-P", "${config:ada.projectFile}", "-cargs", "-gnatef"],
9+
"problemMatcher": ["$ada"],
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
}
14+
},
15+
{
16+
"label": "Run tests",
17+
"type": "shell",
18+
"command": "make check",
19+
"problemMatcher": ["$ada"],
20+
"group": "test"
21+
},
22+
{
23+
"type": "npm",
24+
"script": "compile",
25+
"path": "integration/vscode/ada",
26+
"group": "build",
27+
"problemMatcher": [],
28+
"label": "npm: compile",
29+
"detail": "node ./node_modules/typescript/bin/tsc",
30+
"presentation": {
31+
"echo": true,
32+
"reveal": "silent",
33+
"focus": false,
34+
"panel": "shared",
35+
"showReuseMessage": true,
36+
"clear": false
37+
}
38+
},
39+
{
40+
"type": "npm",
41+
"script": "pretest",
42+
"path": "integration/vscode/ada",
43+
"problemMatcher": [],
44+
"label": "npm: pretest",
45+
"detail": "npm run compile",
46+
"presentation": {
47+
"echo": true,
48+
"reveal": "silent",
49+
"focus": false,
50+
"panel": "shared",
51+
"showReuseMessage": true,
52+
"clear": false
53+
}
54+
}
55+
]
5056
}

integration/vscode/ada/.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ node_modules
22
.vsix
33
out
44
.vscode-test
5-
**/obj
5+
**/obj
6+
7+
# Paths of ALS executables
8+
/linux/
9+
/windows/
10+
/darwin/

0 commit comments

Comments
 (0)