-
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 'issue_1153_edge' into 'edge'
Fix onTypeFormatting.indentOnly option reading See merge request eng/ide/ada_language_server!1255
- Loading branch information
Showing
9 changed files
with
236 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
with Ada.Text_IO; | ||
procedure Test is | ||
begin | ||
Ada.Text_IO.Put_Line("Hello, World!"); | ||
end Test; |
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 @@ | ||
project Test is | ||
for Main use ("test.adb"); | ||
end Test; |
205 changes: 205 additions & 0 deletions
205
testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/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,205 @@ | ||
[ | ||
{ | ||
"comment": [ | ||
"This test checks that the textDocument/onTypeFormatting request ", | ||
"does not fail on a basic example (one line break added after the ", | ||
"begin keyword." | ||
] | ||
}, | ||
{ | ||
"start": { | ||
"cmd": [ | ||
"${ALS}" | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 0, | ||
"method": "initialize", | ||
"params": { | ||
"rootUri": "$URI{.}", | ||
"capabilities": { | ||
"workspace": { | ||
"applyEdit": true, | ||
"workspaceEdit": { | ||
"documentChanges": true, | ||
"resourceOperations": [ | ||
"create", | ||
"rename", | ||
"delete" | ||
] | ||
}, | ||
"didChangeConfiguration": { | ||
"dynamicRegistration": true | ||
}, | ||
"executeCommand": { | ||
"dynamicRegistration": true | ||
}, | ||
"configuration": true, | ||
"workspaceFolders": true | ||
}, | ||
"textDocument": { | ||
"onTypeFormatting": { | ||
"dynamicRegistration": true | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "workspace/didChangeConfiguration", | ||
"params": { | ||
"settings": { | ||
"ada": { | ||
"projectFile": "$URI{test.gpr}", | ||
"onTypeFormatting": { | ||
"indentOnly": false | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "$/progress", | ||
"params": { | ||
"token": "<ANY>", | ||
"value": { | ||
"kind": "end" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "textDocument/didOpen", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{test.adb}", | ||
"languageId": "ada", | ||
"version": 1, | ||
"text": "with Ada.Text_IO;\nprocedure Test is\nbegin\n Ada.Text_IO.Put_Line(\"Hello, World!\");\nend Test;\n" | ||
} | ||
} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"method": "textDocument/didChange", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{test.adb}", | ||
"version": 2 | ||
}, | ||
"contentChanges": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 3, | ||
"character": 41 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"character": 41 | ||
} | ||
}, | ||
"rangeLength": 0, | ||
"text": "\n" | ||
} | ||
] | ||
} | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"method": "textDocument/onTypeFormatting", | ||
"params": { | ||
"textDocument": { | ||
"uri": "$URI{test.adb}" | ||
}, | ||
"position": { | ||
"line": 4, | ||
"character": 0 | ||
}, | ||
"ch": "\n", | ||
"options": { | ||
"tabSize": 3, | ||
"insertSpaces": true | ||
} | ||
} | ||
}, | ||
"wait": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"result": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 3, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"character": 41 | ||
} | ||
}, | ||
"newText": " Ada.Text_IO.Put_Line (\"Hello, World!\");" | ||
}, | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 4, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"character": 0 | ||
} | ||
}, | ||
"newText": " " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"send": { | ||
"request": { | ||
"jsonrpc": "2.0", | ||
"id": 13, | ||
"method": "shutdown" | ||
}, | ||
"wait": [] | ||
} | ||
}, | ||
{ | ||
"stop": { | ||
"exit_code": 0 | ||
} | ||
} | ||
] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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: 'testi' |