-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'origin/master' into edge
- Loading branch information
Showing
11 changed files
with
484 additions
and
20 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
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
8 changes: 8 additions & 0 deletions
8
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/a.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,8 @@ | ||
package body A is | ||
|
||
procedure Subprogram is | ||
begin | ||
null; | ||
end Subprogram; | ||
|
||
end A; |
5 changes: 5 additions & 0 deletions
5
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/a.ads
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,5 @@ | ||
package A is | ||
|
||
procedure Subprogram; | ||
|
||
end A; |
4 changes: 4 additions & 0 deletions
4
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/default.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,4 @@ | ||
project Default is | ||
for Main use ("main.adb"); | ||
for Runtime ("Ada") use "./rts-empty"; | ||
end Default; |
3 changes: 3 additions & 0 deletions
3
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/e.ads
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,3 @@ | ||
with A; | ||
|
||
package E renames A; |
4 changes: 4 additions & 0 deletions
4
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/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 | ||
A.Subprogram; | ||
end Main; |
259 changes: 259 additions & 0 deletions
259
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/refactor_imports_commands.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,259 @@ | ||
[ | ||
{ | ||
"comment": [ | ||
"This test checks if imports (with clause + prefix) are being suggested to unresolved names." | ||
] | ||
}, | ||
{ | ||
"start": { | ||
"cmd": ["${ALS}"] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"params": { | ||
"processId": 13950, | ||
"capabilities": { | ||
"workspace": { | ||
"workspaceEdit": { | ||
"documentChanges": true | ||
}, | ||
"applyEdit": false | ||
} | ||
}, | ||
"rootUri": "$URI{.}" | ||
}, | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "initialize" | ||
}, | ||
"wait": [ | ||
{ | ||
"id": 1, | ||
"result": { | ||
"capabilities": { | ||
"textDocumentSync": 2, | ||
"executeCommandProvider": { | ||
"commands": ["<HAS>", "als-auto-import"] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "initialized" | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"params": { | ||
"settings": { | ||
"ada": { | ||
"projectFile": "default.gpr", | ||
"scenarioVariables": {}, | ||
"defaultCharset": "ISO-8859-1" | ||
} | ||
} | ||
}, | ||
"jsonrpc": "2.0", | ||
"method": "workspace/didChangeConfiguration" | ||
}, | ||
"wait": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "window/workDoneProgress/create", | ||
"params": { | ||
"token": "<ANY>" | ||
} | ||
}, | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "$/progress", | ||
"params": { | ||
"token": "<ANY>", | ||
"value": { | ||
"kind": "end" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"params": { | ||
"textDocument": { | ||
"text": "procedure Main is\nbegin\n A.Subprogram;\nend Main;", | ||
"version": 0, | ||
"uri": "$URI{main.adb}", | ||
"languageId": "Ada" | ||
} | ||
}, | ||
"jsonrpc": "2.0", | ||
"method": "textDocument/didOpen" | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"method": "textDocument/codeAction", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 3 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 3 | ||
} | ||
}, | ||
"context": { | ||
"diagnostics": [] | ||
} | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"result": [ | ||
{ | ||
"title": "Import from A", | ||
"kind": "quickfix", | ||
"command": { | ||
"title": "", | ||
"command": "als-auto-import", | ||
"arguments": [ | ||
{ | ||
"context": "Default", | ||
"where": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"position": { | ||
"line": 2, | ||
"character": 5 | ||
} | ||
}, | ||
"import": "A", | ||
"qualifier": "" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"title": "Qualify with E", | ||
"kind": "quickfix", | ||
"command": { | ||
"title": "", | ||
"command": "als-auto-import", | ||
"arguments": [ | ||
{ | ||
"context": "Default", | ||
"where": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"position": { | ||
"line": 2, | ||
"character": 5 | ||
} | ||
}, | ||
"import": "E", | ||
"qualifier": "E" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 3, | ||
"method": "workspace/executeCommand", | ||
"params": { | ||
"command": "als-auto-import", | ||
"arguments": [ | ||
{ | ||
"context": "Default", | ||
"where": { | ||
"textDocument": { | ||
"uri": "$URI{main.adb}" | ||
}, | ||
"position": { | ||
"line": 2, | ||
"character": 3 | ||
} | ||
}, | ||
"import": "A", | ||
"qualifier": "" | ||
} | ||
] | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"method": "workspace/applyEdit", | ||
"params": { | ||
"edit": { | ||
"documentChanges": [ | ||
{ | ||
"textDocument": { | ||
"uri": "$URI{main.adb}", | ||
"version": 1 | ||
}, | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"newText": "with A;\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"stop": { | ||
"exit_code": 0 | ||
} | ||
} | ||
] |
20 changes: 20 additions & 0 deletions
20
testsuite/ada_lsp/refactoring_imports_commands/issue_1250/rts-empty/adainclude/ada.ads
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,20 @@ | ||
------------------------------------------------------------------------------ | ||
-- -- | ||
-- GNAT RUN-TIME COMPONENTS -- | ||
-- -- | ||
-- A D A -- | ||
-- -- | ||
-- S p e c -- | ||
-- -- | ||
-- This specification is derived from the Ada Reference Manual for use with -- | ||
-- GNAT. In accordance with the copyright of that document, you can freely -- | ||
-- copy and modify this specification, provided that if you redistribute a -- | ||
-- modified version, any changes that you have made are clearly indicated. -- | ||
-- -- | ||
------------------------------------------------------------------------------ | ||
|
||
package Ada is | ||
pragma No_Elaboration_Code_All; | ||
pragma Pure; | ||
|
||
end Ada; |
Oops, something went wrong.