You've already forked ada_language_server
mirror of
https://github.com/AdaCore/ada_language_server.git
synced 2026-02-12 12:45:50 -08:00
Wrong attribute definition in GLS external tool
Add a test. Closes eng/ide/gnatstudio#394
This commit is contained in:
committed by
Adrien Boulanger
parent
c6deb70255
commit
31450ac803
@@ -544,8 +544,8 @@ package body LSP.GPR_External_Tools is
|
||||
"list of switches to be used when invoking 'gnatcheck' for a " &
|
||||
"source of the language, if there is no applicable attribute " &
|
||||
"Switches.",
|
||||
Index_Type => PRA.No_Index,
|
||||
Value => Single,
|
||||
Index_Type => PRA.String_Index,
|
||||
Value => List,
|
||||
Value_Case_Sensitive => True);
|
||||
|
||||
Add_Attribute
|
||||
@@ -554,8 +554,8 @@ package body LSP.GPR_External_Tools is
|
||||
Description => "Index is a source file name. Value is " &
|
||||
"the list of switches to be used when invoking 'gnatcheck' for " &
|
||||
"the source.",
|
||||
Index_Type => PRA.No_Index,
|
||||
Value => Single,
|
||||
Index_Type => PRA.String_Index,
|
||||
Value => List,
|
||||
Value_Case_Sensitive => True);
|
||||
|
||||
end Import_GNATcheck_Attributes;
|
||||
|
||||
6
testsuite/gpr_lsp/gnatcheck_attributes/prj.gpr
Normal file
6
testsuite/gpr_lsp/gnatcheck_attributes/prj.gpr
Normal file
@@ -0,0 +1,6 @@
|
||||
project prj is
|
||||
package Check is
|
||||
for Default_Switches ("ada") use ("-j8");
|
||||
for Switches ("ada") use ("-k");
|
||||
end Check;
|
||||
end prj;
|
||||
139
testsuite/gpr_lsp/gnatcheck_attributes/test.json
Normal file
139
testsuite/gpr_lsp/gnatcheck_attributes/test.json
Normal file
@@ -0,0 +1,139 @@
|
||||
[
|
||||
{
|
||||
"comment": [
|
||||
"Test attribute checking for the GNATcheck package"
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": {
|
||||
"cmd": ["${ALS}", "--language-gpr"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"params": {
|
||||
"capabilities": {
|
||||
},
|
||||
"rootUri": "$URI{.}"
|
||||
},
|
||||
"id": 1,
|
||||
"method": "initialize"
|
||||
},
|
||||
"wait": [{
|
||||
"id": 1,
|
||||
"result": {
|
||||
"capabilities": {
|
||||
"textDocumentSync": {
|
||||
"openClose": true,
|
||||
"change": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"method": "initialized"
|
||||
},
|
||||
"wait": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"text": "project prj is\n package Check is\n for Default_Switches (\"ada\") use (\"-j8\");\n for Switches (\"ada\") use (\"-k\");\n end Check;\nend prj;",
|
||||
"version": 0,
|
||||
"uri": "$URI{prj.gpr}",
|
||||
"languageId": "Gpr"
|
||||
}
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "textDocument/didOpen"
|
||||
},
|
||||
"wait": [{
|
||||
"method": "textDocument/publishDiagnostics",
|
||||
"params": {
|
||||
"uri": "$URI{prj.gpr}",
|
||||
"diagnostics": []
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"method": "textDocument/didChange",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "$URI{prj.gpr}",
|
||||
"version": 1
|
||||
},
|
||||
"contentChanges": [
|
||||
{
|
||||
"range": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"character": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"character": 34
|
||||
}
|
||||
},
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"wait": [{
|
||||
"method": "textDocument/publishDiagnostics",
|
||||
"params": {
|
||||
"uri": "$URI{prj.gpr}",
|
||||
"diagnostics": [
|
||||
{
|
||||
"range": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"character": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"character": 6
|
||||
}
|
||||
},
|
||||
"severity": 1,
|
||||
"message": "full associative array expression requires simple attribute reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"id": 7,
|
||||
"method": "shutdown"
|
||||
},
|
||||
"wait": [
|
||||
{
|
||||
"id": 7,
|
||||
"result": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"stop": {
|
||||
"exit_code": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
1
testsuite/gpr_lsp/gnatcheck_attributes/test.yaml
Normal file
1
testsuite/gpr_lsp/gnatcheck_attributes/test.yaml
Normal file
@@ -0,0 +1 @@
|
||||
title: 'gnatcheck_attributes'
|
||||
Reference in New Issue
Block a user