@@ -20,6 +20,7 @@ import { createDocument } from './razorDocumentFactory';
2020import { razorInitializeCommand } from '../../../lsptoolshost/razor/razorCommands' ;
2121import { PlatformInformation } from '../../../shared/platform' ;
2222import { v4 as uuidv4 } from 'uuid' ;
23+ import { ServerTextChange } from '../rpc/serverTextChange' ;
2324
2425export class RazorDocumentManager implements IRazorDocumentManager {
2526 public roslynActivated = false ;
@@ -158,7 +159,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
158159
159160 const document = this . _getDocument ( uri ) ;
160161
161- this . notifyDocumentChange ( document , RazorDocumentChangeKind . opened ) ;
162+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . opened , [ ] ) ;
162163 }
163164
164165 public async ensureRazorInitialized ( ) {
@@ -189,7 +190,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
189190 }
190191 }
191192
192- this . notifyDocumentChange ( document , RazorDocumentChangeKind . closed ) ;
193+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . closed , [ ] ) ;
193194 }
194195
195196 private addDocument ( uri : vscode . Uri ) : IRazorDocument {
@@ -203,7 +204,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
203204 document = createDocument ( uri ) ;
204205 this . razorDocuments [ document . path ] = document ;
205206
206- this . notifyDocumentChange ( document , RazorDocumentChangeKind . added ) ;
207+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . added , [ ] ) ;
207208
208209 return document ;
209210 }
@@ -212,7 +213,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
212213 const document = this . _getDocument ( uri ) ;
213214 delete this . razorDocuments [ document . path ] ;
214215
215- this . notifyDocumentChange ( document , RazorDocumentChangeKind . removed ) ;
216+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . removed , [ ] ) ;
216217 }
217218
218219 private findDocument ( path : string ) {
@@ -267,7 +268,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
267268 updateBufferRequest . encodingCodePage
268269 ) ;
269270
270- this . notifyDocumentChange ( document , RazorDocumentChangeKind . csharpChanged ) ;
271+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . csharpChanged , updateBufferRequest . changes ) ;
271272 } else {
272273 this . logger . logWarning (
273274 '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 {
310311
311312 htmlProjectedDocument . update ( updateBufferRequest . changes , updateBufferRequest . hostDocumentVersion ) ;
312313
313- this . notifyDocumentChange ( document , RazorDocumentChangeKind . htmlChanged ) ;
314+ this . notifyDocumentChange ( document , RazorDocumentChangeKind . htmlChanged , updateBufferRequest . changes ) ;
314315 } else {
315316 this . logger . logWarning (
316317 'Failed to update the HTML document buffer. This is unexpected and may result in incorrect HTML interactions.'
317318 ) ;
318319 }
319320 }
320321
321- private notifyDocumentChange ( document : IRazorDocument , kind : RazorDocumentChangeKind ) {
322+ private notifyDocumentChange ( document : IRazorDocument , kind : RazorDocumentChangeKind , changes : ServerTextChange [ ] ) {
322323 if ( this . logger . verboseEnabled ) {
323324 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.`
325328 ) ;
326329 }
327330
328331 const args : IRazorDocumentChangeEvent = {
329332 document,
330333 kind,
334+ changes,
331335 } ;
332336
333337 this . onChangeEmitter . fire ( args ) ;
0 commit comments