fix proposed module not found
This commit is contained in:
parent
58d6fc756d
commit
8b3a276e18
1 changed files with 20 additions and 6 deletions
|
@ -5,11 +5,25 @@
|
||||||
|
|
||||||
import * as Proto from '../protocol'
|
import * as Proto from '../protocol'
|
||||||
import { ITypeScriptServiceClient } from '../typescriptService'
|
import { ITypeScriptServiceClient } from '../typescriptService'
|
||||||
import { TextDocument, Position, CancellationToken } from 'vscode-languageserver-protocol'
|
import { TextDocument, Range, Position, CancellationToken } from 'vscode-languageserver-protocol'
|
||||||
import { SelectionRange } from 'vscode-languageserver-protocol/lib/protocol.selectionRange.proposed'
|
|
||||||
import * as typeConverters from '../utils/typeConverters'
|
import * as typeConverters from '../utils/typeConverters'
|
||||||
import { SelectionRangeProvider } from 'coc.nvim'
|
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 {
|
export default class SmartSelection implements SelectionRangeProvider {
|
||||||
public constructor(
|
public constructor(
|
||||||
private readonly client: ITypeScriptServiceClient
|
private readonly client: ITypeScriptServiceClient
|
||||||
|
@ -39,9 +53,9 @@ export default class SmartSelection implements SelectionRangeProvider {
|
||||||
private static convertSelectionRange(
|
private static convertSelectionRange(
|
||||||
selectionRange: Proto.SelectionRange
|
selectionRange: Proto.SelectionRange
|
||||||
): SelectionRange {
|
): SelectionRange {
|
||||||
return SelectionRange.create(
|
return {
|
||||||
typeConverters.Range.fromTextSpan(selectionRange.textSpan),
|
range: typeConverters.Range.fromTextSpan(selectionRange.textSpan),
|
||||||
selectionRange.parent ? SmartSelection.convertSelectionRange(selectionRange.parent) : undefined,
|
parent: selectionRange.parent ? SmartSelection.convertSelectionRange(selectionRange.parent) : undefined,
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue