@@ -46,6 +46,7 @@ interface extensionConfiguration {
46
46
// work in one client, like VSCode, but perhaps not in others, like vim.
47
47
export interface extensionClientCapabilities {
48
48
supportsMarkdownLinks ?: boolean | null ;
49
+ supportsSnippetSyntax ?: boolean | null ;
49
50
}
50
51
let extensionClientCapabilities : extensionClientCapabilities = { } ;
51
52
@@ -680,7 +681,7 @@ function completion(msg: p.RequestMessage) {
680
681
params . position . line ,
681
682
params . position . character ,
682
683
tmpname ,
683
- "true" ,
684
+ Boolean ( extensionClientCapabilities . supportsSnippetSyntax ) ,
684
685
] ,
685
686
msg
686
687
) ;
@@ -947,7 +948,7 @@ function createInterface(msg: p.RequestMessage): p.Message {
947
948
jsonrpc : c . jsonrpcVersion ,
948
949
id : msg . id ,
949
950
result : {
950
- uri : utils . pathToURI ( resiPath )
951
+ uri : utils . pathToURI ( resiPath ) ,
951
952
} ,
952
953
} ;
953
954
return response ;
@@ -1014,7 +1015,7 @@ function openCompiledFile(msg: p.RequestMessage): p.Message {
1014
1015
id : msg . id ,
1015
1016
result : {
1016
1017
uri : utils . pathToURI ( compiledFilePath . result ) ,
1017
- }
1018
+ } ,
1018
1019
} ;
1019
1020
1020
1021
return response ;
@@ -1096,6 +1097,11 @@ function onMessage(msg: p.Message) {
1096
1097
extensionClientCapabilities = extensionClientCapabilitiesFromClient ;
1097
1098
}
1098
1099
1100
+ extensionClientCapabilities . supportsSnippetSyntax = Boolean (
1101
+ initParams . capabilities . textDocument ?. completion ?. completionItem
1102
+ ?. snippetSupport
1103
+ ) ;
1104
+
1099
1105
// send the list of features we support
1100
1106
let result : p . InitializeResult = {
1101
1107
// This tells the client: "hey, we support the following operations".
@@ -1112,7 +1118,9 @@ function onMessage(msg: p.Message) {
1112
1118
codeActionProvider : true ,
1113
1119
renameProvider : { prepareProvider : true } ,
1114
1120
documentSymbolProvider : true ,
1115
- completionProvider : { triggerCharacters : [ "." , ">" , "@" , "~" , '"' , "=" ] } ,
1121
+ completionProvider : {
1122
+ triggerCharacters : [ "." , ">" , "@" , "~" , '"' , "=" ] ,
1123
+ } ,
1116
1124
semanticTokensProvider : {
1117
1125
legend : {
1118
1126
tokenTypes : [
0 commit comments