Skip to content

Commit 0445d77

Browse files
Merge branch 'topic/#1663' into 'master'
Remove .gnatdebug support in the ALS See merge request eng/ide/ada_language_server!2013
2 parents 9550e40 + a37c1e0 commit 0445d77

File tree

4 files changed

+96
-5
lines changed

4 files changed

+96
-5
lines changed

source/ada/lsp-ada_driver.adb

-5
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ procedure LSP.Ada_Driver is
342342

343343
ALS_Log_Dir : Virtual_File := LSP.Env.ALS_Log_Dir;
344344
Clean_ALS_Dir : Boolean := False;
345-
GNATdebug : constant Virtual_File := Create_From_Base
346-
(".gnatdebug");
347345

348346
Traces_File : Virtual_File;
349347

@@ -424,7 +422,6 @@ begin
424422
begin
425423
-- Look for a traces file, in this order:
426424
-- - passed on the command line via --tracefile,
427-
-- - in a .gnatdebug file locally
428425
-- - in "traces.cfg" in the ALS home directory
429426
if VSS.Command_Line.Is_Specified (Trace_File_Option) then
430427
Traces_File :=
@@ -436,8 +433,6 @@ begin
436433
GNAT.OS_Lib.OS_Exit (1);
437434
end if;
438435

439-
elsif GNATdebug.Is_Regular_File then
440-
Traces_File := GNATdebug;
441436
else
442437
-- No $HOME/.als directory: create one first
443438
if not ALS_Log_Dir.Is_Directory then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .gnatdebug file that makes the ALS to crash when parsed, since
2+
# it emits logs directly on the standard output
3+
+
4+
PROCESS_MANAGER=yes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[
2+
{
3+
"comment": [
4+
"This test just checks that the ALS does not crash in presence of ",
5+
"a .gnatdebug file in the working directory"
6+
]
7+
},
8+
{
9+
"start": {
10+
"cmd": ["${ALS}"]
11+
}
12+
},
13+
{
14+
"send": {
15+
"request": {
16+
"params": {
17+
"capabilities": {
18+
"workspace": {
19+
"applyEdit": false
20+
}
21+
},
22+
"rootUri": "$URI{.}"
23+
},
24+
"jsonrpc": "2.0",
25+
"id": 1,
26+
"method": "initialize"
27+
},
28+
"wait": [
29+
{
30+
"id": 1,
31+
"result": {
32+
"capabilities": {
33+
"textDocumentSync": 2,
34+
"signatureHelpProvider": {
35+
"triggerCharacters": [",", "("],
36+
"retriggerCharacters": ["\b"]
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}
43+
},
44+
{
45+
"send": {
46+
"request": {
47+
"jsonrpc": "2.0",
48+
"method": "initialized"
49+
},
50+
"wait": []
51+
}
52+
},
53+
{
54+
"send": {
55+
"request": {
56+
"jsonrpc": "2.0",
57+
"method": "workspace/didChangeConfiguration",
58+
"params": {
59+
"settings": {
60+
"ada": {
61+
"defaultCharset": "ISO-8859-1",
62+
"projectFile": "$URI{default.gpr}",
63+
"scenarioVariables": {}
64+
}
65+
}
66+
}
67+
},
68+
"wait": []
69+
}
70+
},
71+
{
72+
"send": {
73+
"request": {
74+
"jsonrpc": "2.0",
75+
"id": 8,
76+
"method": "shutdown"
77+
},
78+
"wait": [
79+
{
80+
"id": 8,
81+
"result": null
82+
}
83+
]
84+
}
85+
},
86+
{
87+
"stop": {
88+
"exit_code": 0
89+
}
90+
}
91+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: 'als.1663.no_crash_when_gnatdebug'

0 commit comments

Comments
 (0)