Take a simple usecase:
```
let a = "";
a. // open completion
```
When t…sserver is used directly (in typescript.java), I can display information with signature:
![image](https://user-images.githubusercontent.com/1932211/31268160-58d6bd2c-aa7b-11e7-9716-b5b7b8371aa2.png)
Here the JSON response:
```
{
"seq": 0,
"type": "response",
"command": "completionEntryDetails",
"request_seq": 47,
"success": true,
"body": [
{
"name": "charAt",
"kindModifiers": "declare",
"kind": "method",
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "method",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "String",
"kind": "localName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "charAt",
"kind": "methodName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "pos",
"kind": "parameterName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "string",
"kind": "keyword"
}
],
"documentation": [
{
"text": "Returns the character at the specified index.",
"kind": "text"
}
],
"tags": []
}
]
}
```
When I use lsp typescript-language-server, I have not this signature information:
![image](https://user-images.githubusercontent.com/1932211/31268225-9b88cd04-aa7b-11e7-8869-c5f416aa794e.png)
Here the JSON response:
```
{
"jsonrpc": "2.0",
"id": "20",
"result": {
"label": "charAt",
"kind": 2,
"documentation": "Returns the character at the specified index.",
"data": {
"file": "c:\\Users\\azerr\\WS2\\test-tslint\\a.ts",
"line": 2.0,
"offset": 3.0
}
}
}
```
https://github.com/sourcegraph/javascript-typescript-langserver which supports that returns the LSP JSON response:
```
{
"jsonrpc": "2.0",
"id": "31",
"result": {
"label": "charAt",
"kind": 2,
"detail": "(method) String.charAt(pos: number): string",
"documentation": "Returns the character at the specified index.",
"sortText": "0",
"insertText": "charAt(${1:pos})",
"insertTextFormat": 2
}
}
```
It provides 2 cool features:
* display signature with detail
* support snippet
Here a demo:
![lspcompletionsnippetdemo](https://user-images.githubusercontent.com/1932211/31268394-5d5e0458-aa7c-11e7-897d-69309f01e43d.gif)
It should be cool if typescript-language-serve could support:
* display signature with detail
* support snippet with insertText (perhaps provide a settings to disable it)