@@ -40,7 +40,7 @@ class DocumentSymbolAdapter {
4040 }
4141
4242 provideDocumentSymbols ( resource : URI , token : CancellationToken ) : Promise < modes . DocumentSymbol [ ] > {
43- let doc = this . _documents . getDocumentData ( resource ) . document ;
43+ const doc = this . _documents . getDocument ( resource ) ;
4444 return asPromise ( ( ) => this . _provider . provideDocumentSymbols ( doc , token ) ) . then ( value => {
4545 if ( isFalsyOrEmpty ( value ) ) {
4646 return undefined ;
@@ -105,7 +105,7 @@ class CodeLensAdapter {
105105 ) { }
106106
107107 provideCodeLenses ( resource : URI , token : CancellationToken ) : Promise < CodeLensDto [ ] > {
108- const doc = this . _documents . getDocumentData ( resource ) . document ;
108+ const doc = this . _documents . getDocument ( resource ) ;
109109
110110 return asPromise ( ( ) => this . _provider . provideCodeLenses ( doc , token ) ) . then ( lenses => {
111111 let result : CodeLensDto [ ] = [ ] ;
@@ -161,7 +161,7 @@ class DefinitionAdapter {
161161 ) { }
162162
163163 provideDefinition ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . LocationLink [ ] > {
164- let doc = this . _documents . getDocumentData ( resource ) . document ;
164+ const doc = this . _documents . getDocument ( resource ) ;
165165 let pos = typeConvert . Position . to ( position ) ;
166166 return asPromise ( ( ) => this . _provider . provideDefinition ( doc , pos , token ) ) . then ( convertToLocationLinks ) ;
167167 }
@@ -175,7 +175,7 @@ class DeclarationAdapter {
175175 ) { }
176176
177177 provideDeclaration ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . LocationLink [ ] > {
178- let doc = this . _documents . getDocumentData ( resource ) . document ;
178+ const doc = this . _documents . getDocument ( resource ) ;
179179 let pos = typeConvert . Position . to ( position ) ;
180180 return asPromise ( ( ) => this . _provider . provideDeclaration ( doc , pos , token ) ) . then ( convertToLocationLinks ) ;
181181 }
@@ -189,7 +189,7 @@ class ImplementationAdapter {
189189 ) { }
190190
191191 provideImplementation ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . LocationLink [ ] > {
192- let doc = this . _documents . getDocumentData ( resource ) . document ;
192+ const doc = this . _documents . getDocument ( resource ) ;
193193 let pos = typeConvert . Position . to ( position ) ;
194194 return asPromise ( ( ) => this . _provider . provideImplementation ( doc , pos , token ) ) . then ( convertToLocationLinks ) ;
195195 }
@@ -203,7 +203,7 @@ class TypeDefinitionAdapter {
203203 ) { }
204204
205205 provideTypeDefinition ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . LocationLink [ ] > {
206- const doc = this . _documents . getDocumentData ( resource ) . document ;
206+ const doc = this . _documents . getDocument ( resource ) ;
207207 const pos = typeConvert . Position . to ( position ) ;
208208 return asPromise ( ( ) => this . _provider . provideTypeDefinition ( doc , pos , token ) ) . then ( convertToLocationLinks ) ;
209209 }
@@ -218,7 +218,7 @@ class HoverAdapter {
218218
219219 public provideHover ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . Hover > {
220220
221- let doc = this . _documents . getDocumentData ( resource ) . document ;
221+ const doc = this . _documents . getDocument ( resource ) ;
222222 let pos = typeConvert . Position . to ( position ) ;
223223
224224 return asPromise ( ( ) => this . _provider . provideHover ( doc , pos , token ) ) . then ( value => {
@@ -246,7 +246,7 @@ class DocumentHighlightAdapter {
246246
247247 provideDocumentHighlights ( resource : URI , position : IPosition , token : CancellationToken ) : Promise < modes . DocumentHighlight [ ] > {
248248
249- let doc = this . _documents . getDocumentData ( resource ) . document ;
249+ const doc = this . _documents . getDocument ( resource ) ;
250250 let pos = typeConvert . Position . to ( position ) ;
251251
252252 return asPromise ( ( ) => this . _provider . provideDocumentHighlights ( doc , pos , token ) ) . then ( value => {
@@ -266,7 +266,7 @@ class ReferenceAdapter {
266266 ) { }
267267
268268 provideReferences ( resource : URI , position : IPosition , context : modes . ReferenceContext , token : CancellationToken ) : Promise < modes . Location [ ] > {
269- let doc = this . _documents . getDocumentData ( resource ) . document ;
269+ const doc = this . _documents . getDocument ( resource ) ;
270270 let pos = typeConvert . Position . to ( position ) ;
271271
272272 return asPromise ( ( ) => this . _provider . provideReferences ( doc , pos , context , token ) ) . then ( value => {
@@ -296,7 +296,7 @@ class CodeActionAdapter {
296296
297297 provideCodeActions ( resource : URI , rangeOrSelection : IRange | ISelection , context : modes . CodeActionContext , token : CancellationToken ) : Promise < CodeActionDto [ ] > {
298298
299- const doc = this . _documents . getDocumentData ( resource ) . document ;
299+ const doc = this . _documents . getDocument ( resource ) ;
300300 const ran = Selection . isISelection ( rangeOrSelection )
301301 ? < vscode . Selection > typeConvert . Selection . to ( rangeOrSelection )
302302 : < vscode . Range > typeConvert . Range . to ( rangeOrSelection ) ;
@@ -371,7 +371,7 @@ class DocumentFormattingAdapter {
371371
372372 provideDocumentFormattingEdits ( resource : URI , options : modes . FormattingOptions , token : CancellationToken ) : Promise < ISingleEditOperation [ ] > {
373373
374- const { document } = this . _documents . getDocumentData ( resource ) ;
374+ const document = this . _documents . getDocument ( resource ) ;
375375
376376 return asPromise ( ( ) => this . _provider . provideDocumentFormattingEdits ( document , < any > options , token ) ) . then ( value => {
377377 if ( Array . isArray ( value ) ) {
@@ -391,7 +391,7 @@ class RangeFormattingAdapter {
391391
392392 provideDocumentRangeFormattingEdits ( resource : URI , range : IRange , options : modes . FormattingOptions , token : CancellationToken ) : Promise < ISingleEditOperation [ ] > {
393393
394- const { document } = this . _documents . getDocumentData ( resource ) ;
394+ const document = this . _documents . getDocument ( resource ) ;
395395 const ran = typeConvert . Range . to ( range ) ;
396396
397397 return asPromise ( ( ) => this . _provider . provideDocumentRangeFormattingEdits ( document , ran , < any > options , token ) ) . then ( value => {
@@ -414,7 +414,7 @@ class OnTypeFormattingAdapter {
414414
415415 provideOnTypeFormattingEdits ( resource : URI , position : IPosition , ch : string , options : modes . FormattingOptions , token : CancellationToken ) : Promise < ISingleEditOperation [ ] > {
416416
417- const { document } = this . _documents . getDocumentData ( resource ) ;
417+ const document = this . _documents . getDocument ( resource ) ;
418418 const pos = typeConvert . Position . to ( position ) ;
419419
420420 return asPromise ( ( ) => this . _provider . provideOnTypeFormattingEdits ( document , pos , ch , < any > options , token ) ) . then ( value => {
@@ -501,7 +501,7 @@ class RenameAdapter {
501501
502502 provideRenameEdits ( resource : URI , position : IPosition , newName : string , token : CancellationToken ) : Promise < WorkspaceEditDto | undefined > {
503503
504- let doc = this . _documents . getDocumentData ( resource ) . document ;
504+ const doc = this . _documents . getDocument ( resource ) ;
505505 let pos = typeConvert . Position . to ( position ) ;
506506
507507 return asPromise ( ( ) => this . _provider . provideRenameEdits ( doc , pos , newName , token ) ) . then ( value => {
@@ -525,7 +525,7 @@ class RenameAdapter {
525525 return Promise . resolve ( undefined ) ;
526526 }
527527
528- let doc = this . _documents . getDocumentData ( resource ) . document ;
528+ const doc = this . _documents . getDocument ( resource ) ;
529529 let pos = typeConvert . Position . to ( position ) ;
530530
531531 return asPromise ( ( ) => this . _provider . prepareRename ( doc , pos , token ) ) . then ( rangeOrLocation => {
@@ -591,7 +591,7 @@ class SuggestAdapter {
591591
592592 provideCompletionItems ( resource : URI , position : IPosition , context : modes . CompletionContext , token : CancellationToken ) : Promise < SuggestResultDto > {
593593
594- const doc = this . _documents . getDocumentData ( resource ) . document ;
594+ const doc = this . _documents . getDocument ( resource ) ;
595595 const pos = typeConvert . Position . to ( position ) ;
596596
597597 return asPromise < vscode . CompletionItem [ ] | vscode . CompletionList > (
@@ -654,7 +654,7 @@ class SuggestAdapter {
654654 return suggestion ;
655655 }
656656
657- const doc = this . _documents . getDocumentData ( resource ) . document ;
657+ const doc = this . _documents . getDocument ( resource ) ;
658658 const pos = typeConvert . Position . to ( position ) ;
659659 const wordRangeBeforePos = ( doc . getWordRangeAtPosition ( pos ) as Range || new Range ( pos , pos ) ) . with ( { end : pos } ) ;
660660 const newSuggestion = this . _convertCompletionItem ( resolvedItem , pos , wordRangeBeforePos , _id , _parentId ) ;
@@ -741,7 +741,7 @@ class SignatureHelpAdapter {
741741 ) { }
742742
743743 provideSignatureHelp ( resource : URI , position : IPosition , context : modes . SignatureHelpContext , token : CancellationToken ) : Promise < modes . SignatureHelp > {
744- const doc = this . _documents . getDocumentData ( resource ) . document ;
744+ const doc = this . _documents . getDocument ( resource ) ;
745745 const pos = typeConvert . Position . to ( position ) ;
746746 const vscodeContext = this . reviveContext ( context ) ;
747747
@@ -780,7 +780,7 @@ class LinkProviderAdapter {
780780 ) { }
781781
782782 provideLinks ( resource : URI , token : CancellationToken ) : Promise < LinkDto [ ] > {
783- const doc = this . _documents . getDocumentData ( resource ) . document ;
783+ const doc = this . _documents . getDocument ( resource ) ;
784784
785785 return asPromise ( ( ) => this . _provider . provideDocumentLinks ( doc , token ) ) . then ( links => {
786786 if ( ! Array . isArray ( links ) ) {
@@ -824,7 +824,7 @@ class ColorProviderAdapter {
824824 ) { }
825825
826826 provideColors ( resource : URI , token : CancellationToken ) : Promise < IRawColorInfo [ ] > {
827- const doc = this . _documents . getDocumentData ( resource ) . document ;
827+ const doc = this . _documents . getDocument ( resource ) ;
828828 return asPromise ( ( ) => this . _provider . provideDocumentColors ( doc , token ) ) . then ( colors => {
829829 if ( ! Array . isArray ( colors ) ) {
830830 return [ ] ;
@@ -842,7 +842,7 @@ class ColorProviderAdapter {
842842 }
843843
844844 provideColorPresentations ( resource : URI , raw : IRawColorInfo , token : CancellationToken ) : Promise < modes . IColorPresentation [ ] > {
845- const document = this . _documents . getDocumentData ( resource ) . document ;
845+ const document = this . _documents . getDocument ( resource ) ;
846846 const range = typeConvert . Range . to ( raw . range ) ;
847847 const color = typeConvert . Color . to ( raw . color ) ;
848848 return asPromise ( ( ) => this . _provider . provideColorPresentations ( color , { document, range } , token ) ) . then ( value => {
@@ -859,7 +859,7 @@ class FoldingProviderAdapter {
859859 ) { }
860860
861861 provideFoldingRanges ( resource : URI , context : modes . FoldingContext , token : CancellationToken ) : Promise < modes . FoldingRange [ ] > {
862- const doc = this . _documents . getDocumentData ( resource ) . document ;
862+ const doc = this . _documents . getDocument ( resource ) ;
863863 return asPromise ( ( ) => this . _provider . provideFoldingRanges ( doc , context , token ) ) . then ( ranges => {
864864 if ( ! Array . isArray ( ranges ) ) {
865865 return undefined ;
0 commit comments