Skip to content

Commit 183ac75

Browse files
authored
Fix experimental typing in meta model (#983)
1 parent 2b4ae18 commit 183ac75

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

protocol/metaModel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8355,7 +8355,7 @@
83558355
"name": "experimental",
83568356
"type": {
83578357
"kind": "reference",
8358-
"name": "T"
8358+
"name": "LSPAny"
83598359
},
83608360
"optional": true,
83618361
"documentation": "Experimental server capabilities."

protocol/src/common/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ export interface ClientCapabilities {
961961
/**
962962
* Experimental client capabilities.
963963
*/
964-
experimental?: object;
964+
experimental?: LSPAny;
965965
}
966966

967967
/**
@@ -1042,7 +1042,7 @@ export namespace WorkDoneProgressOptions {
10421042
* Defines the capabilities provided by a language
10431043
* server.
10441044
*/
1045-
export interface ServerCapabilities<T = any> {
1045+
export interface ServerCapabilities<T = LSPAny> {
10461046

10471047
/**
10481048
* The position encoding the server picked from the encodings offered

tools/src/visitor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,10 @@ export default class Visitor {
948948
if (typeInfo === undefined) {
949949
throw new Error(`Can't parse property ${member.getName()} of structure ${symbol.getName()}`);
950950
}
951-
const property: Property = { name: member.getName(), type: TypeInfo.asJsonType(typeInfo) };
951+
952+
const property: Property = (result.name === 'ServerCapabilities' && member.getName() === 'experimental' && typeInfo.kind === 'reference' && typeInfo.name === 'T')
953+
? { name: member.getName(), type: TypeInfo.asJsonType({ kind: 'reference', name: 'LSPAny', symbol: typeInfo.symbol }) }
954+
: { name: member.getName(), type: TypeInfo.asJsonType(typeInfo) };
952955
if (Symbols.isOptional(member)) {
953956
property.optional = true;
954957
}

0 commit comments

Comments
 (0)