提交 781520cb 编写于 作者: J Johannes Rieken

type converters, use namespace for Hover

上级 c4729628
......@@ -318,7 +318,7 @@ export class ExtHostApiCommands {
position: position && typeConverters.Position.from(position)
};
return this._commands.executeCommand<modes.Hover[]>('_executeHoverProvider', args)
.then(tryMapWith(typeConverters.toHover));
.then(tryMapWith(typeConverters.Hover.to));
}
private _executeDocumentHighlights(resource: URI, position: types.Position): Thenable<types.DocumentHighlight[]> {
......
......@@ -200,7 +200,7 @@ class HoverAdapter {
value.range = new Range(pos, pos);
}
return typeConvert.fromHover(value);
return typeConvert.Hover.from(value);
});
}
}
......
......@@ -404,15 +404,17 @@ export const location = {
}
};
export function fromHover(hover: vscode.Hover): modes.Hover {
return <modes.Hover>{
range: Range.from(hover.range),
contents: MarkdownString.fromMany(hover.contents)
};
}
export namespace Hover {
export function from(hover: vscode.Hover): modes.Hover {
return <modes.Hover>{
range: Range.from(hover.range),
contents: MarkdownString.fromMany(hover.contents)
};
}
export function toHover(info: modes.Hover): types.Hover {
return new types.Hover(info.contents.map(MarkdownString.to), Range.to(info.range));
export function to(info: modes.Hover): types.Hover {
return new types.Hover(info.contents.map(MarkdownString.to), Range.to(info.range));
}
}
export function toDocumentHighlight(occurrence: modes.DocumentHighlight): types.DocumentHighlight {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册