【发布时间】:2020-02-24 14:51:24
【问题描述】:
vscode-languageserver-protocol中声明的类型:
export declare type TextDocumentContentChangeEvent = {
/**
* The range of the document that changed.
*/
range: Range;
/**
* The optional length of the range that got replaced.
*
* @deprecated use range instead.
*/
rangeLength?: number;
/**
* The new text for the provided range.
*/
text: string;
} | {
/**
* The new text of the whole document.
*/
text: string;
};
而change 实例为TextDocumentContentChangeEvent,当我使用change.range 时,VSCode 发布错误:Property 'range' does not exist on type '{ text: string; }'。
如何检查change.range 或我用错了什么?
【问题讨论】:
标签: typescript visual-studio-code vscode-extensions