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
@@ -46,6 +46,7 @@ package body LSP.Ada_Completions.Keywords is
|
||||
begin
|
||||
if Filter.Is_End_Label or else
|
||||
Filter.Is_Numeric_Literal or else
|
||||
Node.Is_Null or else
|
||||
not Libadalang.Common.Is_Trivia (Prev)
|
||||
then
|
||||
-- Propose keyword completion if we are not within an end label
|
||||
|
||||
2
testsuite/ada_lsp/completion.null_node/default.gpr
Normal file
2
testsuite/ada_lsp/completion.null_node/default.gpr
Normal file
@@ -0,0 +1,2 @@
|
||||
project Default is
|
||||
end Default;
|
||||
2
testsuite/ada_lsp/completion.null_node/main.adb
Normal file
2
testsuite/ada_lsp/completion.null_node/main.adb
Normal file
@@ -0,0 +1,2 @@
|
||||
--
|
||||
--
|
||||
188
testsuite/ada_lsp/completion.null_node/test.json
Normal file
188
testsuite/ada_lsp/completion.null_node/test.json
Normal file
@@ -0,0 +1,188 @@
|
||||
[
|
||||
{
|
||||
"comment": ["test PRECONDITION_FAILURE on an empty file editing"]
|
||||
},
|
||||
{
|
||||
"start": {
|
||||
"cmd": ["${ALS}"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"processId": 199714,
|
||||
"rootUri": "$URI{.}",
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": true
|
||||
},
|
||||
"textDocument": {
|
||||
"completion": {
|
||||
"completionItem": {
|
||||
"snippetSupport": true,
|
||||
"documentationFormat": ["markdown", "plaintext"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"window": {
|
||||
"workDoneProgress": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wait": [
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"capabilities": {
|
||||
"textDocumentSync": 2,
|
||||
"completionProvider": {
|
||||
"triggerCharacters": [".", ",", "'", "("],
|
||||
"resolveProvider": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": "--\n--\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"wait": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"method": "workspace/didChangeConfiguration",
|
||||
"params": {
|
||||
"settings": {
|
||||
"ada": {
|
||||
"projectFile": "default.gpr"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wait": [
|
||||
{
|
||||
"method": "$/progress",
|
||||
"params": {
|
||||
"token": "<ANY>",
|
||||
"value": {
|
||||
"kind": "end"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"method": "textDocument/didChange",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "$URI{main.adb}",
|
||||
"version": 2
|
||||
},
|
||||
"contentChanges": [
|
||||
{
|
||||
"range": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"character": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"character": 0
|
||||
}
|
||||
},
|
||||
"rangeLength": 0,
|
||||
"text": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"wait": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"id": 16,
|
||||
"method": "textDocument/completion",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "$URI{main.adb}"
|
||||
},
|
||||
"position": {
|
||||
"line": 2,
|
||||
"character": 1
|
||||
},
|
||||
"context": {
|
||||
"triggerKind": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"wait": [
|
||||
{
|
||||
"id": 16,
|
||||
"result": {
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"send": {
|
||||
"request": {
|
||||
"jsonrpc": "2.0",
|
||||
"id": 44,
|
||||
"method": "shutdown"
|
||||
},
|
||||
"wait": [
|
||||
{
|
||||
"id": 44,
|
||||
"result": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"stop": {
|
||||
"exit_code": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
1
testsuite/ada_lsp/completion.null_node/test.yaml
Normal file
1
testsuite/ada_lsp/completion.null_node/test.yaml
Normal file
@@ -0,0 +1 @@
|
||||
title: 'completion.null_node'
|
||||
Reference in New Issue
Block a user