mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
type converters, use namespace for Hover
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user