in client/src/common/codeConverter.ts [394:467]
triggerKind: asSignatureHelpTriggerKind(context.triggerKind),
activeSignatureHelp: asSignatureHelp(context.activeSignatureHelp)
}
};
}
function asWorkerPosition(position: code.Position): proto.Position {
return { line: position.line, character: position.character };
}
function asPosition(value: code.Position): proto.Position;
function asPosition(value: undefined): undefined;
function asPosition(value: null): null;
function asPosition(value: code.Position | undefined | null): proto.Position | undefined | null;
function asPosition(value: code.Position | undefined | null): proto.Position | undefined | null {
if (value === undefined || value === null) {
return value;
}
return { line: value.line > uinteger.MAX_VALUE ? uinteger.MAX_VALUE : value.line, character: value.character > uinteger.MAX_VALUE ? uinteger.MAX_VALUE : value.character };
}
function asPositions(value: code.Position[]): proto.Position[] {
let result: proto.Position[] = [];
for (let elem of value) {
result.push(asPosition(elem));
}
return result;
}
function asRange(value: code.Range): proto.Range;
function asRange(value: undefined): undefined;
function asRange(value: null): null;
function asRange(value: code.Range | undefined | null): proto.Range | undefined | null;
function asRange(value: code.Range | undefined | null): proto.Range | undefined | null {
if (value === undefined || value === null) {
return value;
}
return { start: asPosition(value.start), end: asPosition(value.end) };
}
function asLocation(value: code.Location): proto.Location;
function asLocation(value: undefined): undefined;
function asLocation(value: null): null;
function asLocation(value: code.Location | undefined | null): proto.Location | undefined | null {
if (value === undefined || value === null) {
return value;
}
return proto.Location.create(asUri(value.uri), asRange(value.range));
}
function asDiagnosticSeverity(value: code.DiagnosticSeverity): proto.DiagnosticSeverity {
switch (value) {
case code.DiagnosticSeverity.Error:
return proto.DiagnosticSeverity.Error;
case code.DiagnosticSeverity.Warning:
return proto.DiagnosticSeverity.Warning;
case code.DiagnosticSeverity.Information:
return proto.DiagnosticSeverity.Information;
case code.DiagnosticSeverity.Hint:
return proto.DiagnosticSeverity.Hint;
}
}
function asDiagnosticTags(tags: undefined | null): undefined;
function asDiagnosticTags(tags: code.DiagnosticTag[]): proto.DiagnosticTag[];
function asDiagnosticTags(tags: code.DiagnosticTag[] | undefined | null): proto.DiagnosticTag[] | undefined;
function asDiagnosticTags(tags: code.DiagnosticTag[] | undefined | null): proto.DiagnosticTag[] | undefined {
if (!tags) {
return undefined;
}
let result: code.DiagnosticTag[] = [];
for (let tag of tags) {
let converted = asDiagnosticTag(tag);
if (converted !== undefined) {