Skip to content

Commit a2870a7

Browse files
committed
Merge branch 'topic/syntax-highlighting' into 'master'
Prevent semantic highlighting on unresolved symbols See merge request eng/ide/ada_language_server!1253
2 parents e1c3c28 + fc48ce4 commit a2870a7

File tree

15 files changed

+179
-2681
lines changed

15 files changed

+179
-2681
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ end_of_line = lf
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11+
[*.tokens]
12+
insert_final_newline = false
13+
1114
[*.py]
1215
indent_size = 4
1316

.vscode/launch.json

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@
2525
// debug instance on the same workspace as the development instance.
2626
// So you can checkout a second copy of the ALS repository under
2727
// ../als-rt and use it with the following line.
28-
"${workspaceFolder}/../als-rt"
28+
// "${workspaceFolder}/../als-rt"
29+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
2930
],
30-
"preLaunchTask": "npm: compile"
31+
"preLaunchTask": "npm: compile",
32+
"env": {
33+
// This is necessary to make the "child" vscode inherit the PATH
34+
// variable set in the workspace settings. Without it in some setups
35+
// (e.g. vscode remote) the child vscode does not get visibility
36+
// over the Ada toolchain available in the parent vscode
37+
// environment.
38+
"PATH": "${env:PATH}"
39+
}
3140
},
3241
{
3342
"name": "Extension Tests",
@@ -43,30 +52,21 @@
4352
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
4453
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
4554
],
55+
// Below we make the executables of node modules visible to the tests.
56+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
57+
// tests.
4658
"env": {
59+
// This is necessary to make the "child" vscode inherit the PATH
60+
// variable set in the workspace settings. Without it in some setups
61+
// (e.g. vscode remote) the child vscode does not get visibility
62+
// over the Ada toolchain available in the parent vscode
63+
// environment.
64+
"PATH": "${env:PATH}",
4765
// This is custom env var that we use in
4866
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
4967
// tests when debugging
5068
"MOCHA_TIMEOUT": "0"
5169
},
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-
},
7070
"preLaunchTask": "npm: pretest"
7171
},
7272
{
@@ -83,7 +83,16 @@
8383
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
8484
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
8585
],
86+
// Below we make the executables of node modules visible to the tests.
87+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
88+
// tests.
8689
"env": {
90+
// This is necessary to make the "child" vscode inherit the PATH
91+
// variable set in the workspace settings. Without it in some setups
92+
// (e.g. vscode remote) the child vscode does not get visibility
93+
// over the Ada toolchain available in the parent vscode
94+
// environment.
95+
"PATH": "${env:PATH}",
8796
// This is custom env var that we use in
8897
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
8998
// tests when debugging
@@ -94,24 +103,6 @@
94103
// integration/vscode/ada/test/suite/highlighting.test.ts
95104
"MOCHA_ALS_UPDATE": "1"
96105
},
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-
},
115106
"preLaunchTask": "npm: pretest"
116107
},
117108
{
@@ -121,6 +112,45 @@
121112
"target": ".obj/server/ada_language_server",
122113
"cwd": "${workspaceRoot}",
123114
"valuesFormatting": "parseText"
115+
},
116+
{
117+
"name": "Extension Tests (Test Name Regexp)",
118+
"type": "extensionHost",
119+
"request": "launch",
120+
"runtimeExecutable": "${execPath}",
121+
"outFiles": [
122+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
123+
"!**/node_modules/**"
124+
],
125+
"args": [
126+
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
127+
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
128+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
129+
],
130+
// Below we make the executables of node modules visible to the tests.
131+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
132+
// tests.
133+
"env": {
134+
"MOCHA_GREP": "${input:testPattern}",
135+
// This is necessary to make the "child" vscode inherit the PATH
136+
// variable set in the workspace settings. Without it in some setups
137+
// (e.g. vscode remote) the child vscode does not get visibility
138+
// over the Ada toolchain available in the parent vscode
139+
// environment.
140+
"PATH": "${env:PATH}",
141+
// This is custom env var that we use in
142+
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
143+
// tests when debugging
144+
"MOCHA_TIMEOUT": "0"
145+
},
146+
"preLaunchTask": "npm: pretest"
147+
}
148+
],
149+
"inputs": [
150+
{
151+
"id": "testPattern",
152+
"description": "A regexp of tests to run",
153+
"type": "promptString"
124154
}
125155
]
126156
}

.vscode/settings.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"ada.projectFile": "gnat/lsp_server.gpr",
33
"ada.scenarioVariables": {
44
// Use static linking in local development to enable running the
5-
// ada_language_server executable after relaction into the VS Code
5+
// ada_language_server executable after relocation into the VS Code
66
// extension.
77
"LIBRARY_TYPE": "static"
88
},

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ export ALS=$(ROOTDIR)/.obj/server/ada_language_server
1313
TESTER=$(ROOTDIR)/.obj/tester/tester-run
1414
CODEC_TEST=.obj/codec_test/codec_test
1515

16-
GPRBUILD_FLAGS=-j0
16+
# Env variable to set for update VS Code test references
17+
MOCHA_ALS_UPDATE=
18+
19+
GPRBUILD_EXTRA=
20+
GPRBUILD_FLAGS=-j0 $(GPRBUILD_EXTRA)
1721
GPRBUILD=gprbuild $(GPRBUILD_FLAGS) -XSUPERPROJECT=
18-
GPRCLEAN=gprclean -XSUPERPROJECT=
22+
GPRCLEAN_EXTRA=
23+
GPRCLEAN=gprclean -XSUPERPROJECT= $(GPRCLEAN_EXTRA)
1924

2025
# Installation directory
2126
prefix ?= /usr/local
@@ -147,7 +152,8 @@ endif
147152

148153
vscode-test:
149154
# Run the VS Code integration testsuite.
150-
cd integration/vscode/ada; LD_LIBRARY_PATH= npm run test
155+
echo $(GPR_PROJECT_PATH)
156+
MOCHA_ALS_UPDATE=$(MOCHA_ALS_UPDATE) cd integration/vscode/ada; LD_LIBRARY_PATH= npm run test
151157

152158
vscode-package:
153159
cd integration/vscode/ada; LD_LIBRARY_PATH= $(VSCE) package

integration/vscode/ada/test/TestWorkspace/default.gpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ project Default is
44
("gnatpp.adb",
55
"test.adb");
66

7-
for Source_Dirs use ("src");
7+
for Source_Dirs use ("src", "highlighing");
88
for Object_Dir use "obj";
99
for Main use Tools_Mains;
10-
10+
1111
package Builder is
1212
for Executable ("gnatpp.adb") use "gnatpp";
1313
for Executable ("test.adb") use "gnattest";

0 commit comments

Comments
 (0)