-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/project_diagnostics' into 'master'
Fix + test case for project diagnostics See merge request eng/ide/ada_language_server!1527
- Loading branch information
Showing
6 changed files
with
259 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
testsuite/ada_lsp/project_config.multiple_project_diagnostics/a.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
project A is | ||
end A; |
2 changes: 2 additions & 0 deletions
2
testsuite/ada_lsp/project_config.multiple_project_diagnostics/b.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
project B is | ||
end B; |
4 changes: 4 additions & 0 deletions
4
testsuite/ada_lsp/project_config.multiple_project_diagnostics/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
procedure Main is | ||
begin | ||
null; | ||
end Main; |
231 changes: 231 additions & 0 deletions
231
testsuite/ada_lsp/project_config.multiple_project_diagnostics/test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
[ | ||
{ | ||
"comment": [ | ||
"Test the project diagnostics when we have several .gpr files in the ", | ||
"root directory, without having set the 'ada.projectFile' setting.", | ||
"It also checks that we propose a quickfix to set 'ada.projectFile'." | ||
] | ||
}, | ||
{ | ||
"start": { | ||
"cmd": ["${ALS}"] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "initialize", | ||
"params": { | ||
"rootUri": "$URI{.}", | ||
"capabilities": {} | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"id": 1, | ||
"result": { | ||
"capabilities": { | ||
"executeCommandProvider": { | ||
"commands": ["<HAS>", "als-refactor-add-parameters"] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "initialized", | ||
"params": {} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "textDocument/didOpen", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}", | ||
"languageId": "ada", | ||
"version": 1, | ||
"text": "procedure Main is\nbegin\n null;\nend Main;\n" | ||
} | ||
} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"method": "workspace/executeCommand", | ||
"params": { | ||
"command": "als-source-dirs" | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"method": "textDocument/publishDiagnostics", | ||
"params": { | ||
"uri": "$URI{main.adb}", | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"severity": 1, | ||
"source": "project", | ||
"message": "No project was loaded, because more than one project file has been found in the root directory. Please change configuration to point a correct project file." | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 6, | ||
"method": "textDocument/codeAction", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"context": { | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"message": "No project was loaded, because more than one project file has been found in the root directory. Please change configuration to point a correct project file.", | ||
"severity": 1, | ||
"source": "project" | ||
} | ||
], | ||
"triggerKind": 2 | ||
} | ||
} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 13, | ||
"method": "textDocument/codeAction", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"context": { | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"message": "No project was loaded, because more than one project file has been found in the root directory. Please change configuration to point a correct project file.", | ||
"severity": 1, | ||
"source": "project" | ||
} | ||
], | ||
"triggerKind": 2 | ||
} | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"id": 13, | ||
"result": [ | ||
{ | ||
"title": "Open settings for ada.projectFile", | ||
"kind": "quickfix", | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"severity": 1, | ||
"source": "project", | ||
"message": "No project was loaded, because more than one project file has been found in the root directory. Please change configuration to point a correct project file." | ||
} | ||
], | ||
"isPreferred": true, | ||
"command": { | ||
"title": "Open settings for ada.projectFile", | ||
"command": "workbench.action.openSettings", | ||
"arguments": "ada.projectFile" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"stop": { | ||
"exit_code": 0 | ||
} | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
testsuite/ada_lsp/project_config.multiple_project_diagnostics/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
title: 'project_config.multiple_project_diagnostics' |