File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export default class Documents implements Disposable {
186
186
return docs
187
187
}
188
188
189
- public getDocument ( uri : number | string , caseInsensitive = platform . isWindows || platform . isMacintosh ) : Document | null {
189
+ public getDocument ( uri : number | string , caseInsensitive = platform . isWindows || platform . isMacintosh ) : Document | null | undefined {
190
190
if ( typeof uri === 'number' ) {
191
191
return this . buffers . get ( uri )
192
192
}
Original file line number Diff line number Diff line change @@ -357,13 +357,13 @@ export class Workspace {
357
357
/**
358
358
* Get created document by uri or bufnr.
359
359
*/
360
- public getDocument ( uri : number | string ) : Document | null {
360
+ public getDocument ( uri : number | string ) : Document | null | undefined {
361
361
return this . documentsManager . getDocument ( uri )
362
362
}
363
363
364
364
public hasDocument ( uri : string , version ?: number ) : boolean {
365
365
let doc = this . documentsManager . getDocument ( uri )
366
- return doc != null && ( version != null ? doc . version == version : true )
366
+ return doc && ( version != null ? doc . version == version : true )
367
367
}
368
368
369
369
public getUri ( bufnr : number , defaultValue = '' ) : string {
Original file line number Diff line number Diff line change @@ -8934,7 +8934,7 @@ declare module 'coc.nvim' {
8934
8934
/**
8935
8935
* Get created document by uri or bufnr.
8936
8936
*/
8937
- export function getDocument ( uri : number | string ) : Document
8937
+ export function getDocument ( uri : number | string ) : Document | null | undefined
8938
8938
8939
8939
/**
8940
8940
* Apply WorkspaceEdit.
You can’t perform that action at this time.
0 commit comments