fix proposed module not found

This commit is contained in:
chemzqm 2019-06-12 19:50:37 +08:00
parent 58d6fc756d
commit 8b3a276e18

View file

@ -5,11 +5,25 @@
import * as Proto from '../protocol'
import { ITypeScriptServiceClient } from '../typescriptService'
import { TextDocument, Position, CancellationToken } from 'vscode-languageserver-protocol'
import { SelectionRange } from 'vscode-languageserver-protocol/lib/protocol.selectionRange.proposed'
import { TextDocument, Range, Position, CancellationToken } from 'vscode-languageserver-protocol'
import * as typeConverters from '../utils/typeConverters'
import { SelectionRangeProvider } from 'coc.nvim'
/**
* A selection range represents a part of a selection hierarchy. A selection range
* may have a parent selection range that contains it.
*/
export interface SelectionRange {
/**
* The [range](#Range) of this selection range.
*/
range: Range
/**
* The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
*/
parent?: SelectionRange
}
export default class SmartSelection implements SelectionRangeProvider {
public constructor(
private readonly client: ITypeScriptServiceClient
@ -39,9 +53,9 @@ export default class SmartSelection implements SelectionRangeProvider {
private static convertSelectionRange(
selectionRange: Proto.SelectionRange
): SelectionRange {
return SelectionRange.create(
typeConverters.Range.fromTextSpan(selectionRange.textSpan),
selectionRange.parent ? SmartSelection.convertSelectionRange(selectionRange.parent) : undefined,
)
return {
range: typeConverters.Range.fromTextSpan(selectionRange.textSpan),
parent: selectionRange.parent ? SmartSelection.convertSelectionRange(selectionRange.parent) : undefined,
}
}
}