@@ -20,6 +20,7 @@ import { createDocument } from './razorDocumentFactory';
20
20
import { razorInitializeCommand } from '../../../lsptoolshost/razor/razorCommands' ;
21
21
import { PlatformInformation } from '../../../shared/platform' ;
22
22
import { v4 as uuidv4 } from 'uuid' ;
23
+ import { ServerTextChange } from '../rpc/serverTextChange' ;
23
24
24
25
export class RazorDocumentManager implements IRazorDocumentManager {
25
26
public roslynActivated = false ;
@@ -158,7 +159,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
158
159
159
160
const document = this . _getDocument ( uri ) ;
160
161
161
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . opened ) ;
162
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . opened , [ ] ) ;
162
163
}
163
164
164
165
public async ensureRazorInitialized ( ) {
@@ -189,7 +190,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
189
190
}
190
191
}
191
192
192
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . closed ) ;
193
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . closed , [ ] ) ;
193
194
}
194
195
195
196
private addDocument ( uri : vscode . Uri ) : IRazorDocument {
@@ -203,7 +204,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
203
204
document = createDocument ( uri ) ;
204
205
this . razorDocuments [ document . path ] = document ;
205
206
206
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . added ) ;
207
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . added , [ ] ) ;
207
208
208
209
return document ;
209
210
}
@@ -212,7 +213,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
212
213
const document = this . _getDocument ( uri ) ;
213
214
delete this . razorDocuments [ document . path ] ;
214
215
215
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . removed ) ;
216
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . removed , [ ] ) ;
216
217
}
217
218
218
219
private findDocument ( path : string ) {
@@ -267,7 +268,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
267
268
updateBufferRequest . encodingCodePage
268
269
) ;
269
270
270
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . csharpChanged ) ;
271
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . csharpChanged , updateBufferRequest . changes ) ;
271
272
} else {
272
273
this . logger . logWarning (
273
274
'Failed to update the C# document buffer. This is unexpected and may result in incorrect C# interactions.'
@@ -310,24 +311,27 @@ export class RazorDocumentManager implements IRazorDocumentManager {
310
311
311
312
htmlProjectedDocument . update ( updateBufferRequest . changes , updateBufferRequest . hostDocumentVersion ) ;
312
313
313
- this . notifyDocumentChange ( document , RazorDocumentChangeKind . htmlChanged ) ;
314
+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . htmlChanged , updateBufferRequest . changes ) ;
314
315
} else {
315
316
this . logger . logWarning (
316
317
'Failed to update the HTML document buffer. This is unexpected and may result in incorrect HTML interactions.'
317
318
) ;
318
319
}
319
320
}
320
321
321
- private notifyDocumentChange ( document : IRazorDocument , kind : RazorDocumentChangeKind ) {
322
+ private notifyDocumentChange ( document : IRazorDocument , kind : RazorDocumentChangeKind , changes : ServerTextChange [ ] ) {
322
323
if ( this . logger . verboseEnabled ) {
323
324
this . logger . logVerbose (
324
- `Notifying document '${ getUriPath ( document . uri ) } ' changed '${ RazorDocumentChangeKind [ kind ] } '`
325
+ `Notifying document '${ getUriPath ( document . uri ) } ' changed '${ RazorDocumentChangeKind [ kind ] } ' with '${
326
+ changes . length
327
+ } ' changes.`
325
328
) ;
326
329
}
327
330
328
331
const args : IRazorDocumentChangeEvent = {
329
332
document,
330
333
kind,
334
+ changes,
331
335
} ;
332
336
333
337
this . onChangeEmitter . fire ( args ) ;
0 commit comments