@@ -20,6 +20,9 @@ export class CSharpProjectedDocument implements IProjectedDocument {
2020 private ProvisionalDotPosition : Position | undefined ;
2121 private hostDocumentVersion : number | null = null ;
2222 private updates : Update [ ] | null = null ;
23+ private _checksum : Uint8Array = new Uint8Array ( ) ;
24+ private _checksumAlgorithm : number = 0 ;
25+ private _encodingCodePage : number | null = null ;
2326
2427 public constructor ( public readonly uri : vscode . Uri ) {
2528 this . path = getUriPath ( uri ) ;
@@ -33,33 +36,55 @@ export class CSharpProjectedDocument implements IProjectedDocument {
3336 return this . content . length ;
3437 }
3538
39+ public get checksum ( ) : Uint8Array {
40+ return this . _checksum ;
41+ }
42+
43+ public get checksumAlgorithm ( ) : number {
44+ return this . _checksumAlgorithm ;
45+ }
46+
47+ public get encodingCodePage ( ) : number | null {
48+ return this . _encodingCodePage ;
49+ }
50+
3651 public clear ( ) {
3752 this . setContent ( '' ) ;
3853 }
3954
40- public update ( edits : ServerTextChange [ ] , hostDocumentVersion : number ) {
41- this . removeProvisionalDot ( ) ;
42-
43- // Apply any stored edits if needed
44- if ( this . updates ) {
45- for ( const update of this . updates ) {
46- this . updateContent ( update . changes ) ;
55+ public update (
56+ hostDocumentIsOpen : boolean ,
57+ edits : ServerTextChange [ ] ,
58+ hostDocumentVersion : number ,
59+ checksum : Uint8Array ,
60+ checksumAlgorithm : number ,
61+ encodingCodePage : number | null
62+ ) {
63+ if ( hostDocumentIsOpen ) {
64+ this . removeProvisionalDot ( ) ;
65+
66+ // Apply any stored edits if needed
67+ if ( this . updates ) {
68+ for ( const update of this . updates ) {
69+ this . updateContent ( update . changes ) ;
70+ }
71+
72+ this . updates = null ;
4773 }
4874
49- this . updates = null ;
75+ this . updateContent ( edits ) ;
76+ } else {
77+ if ( this . updates ) {
78+ this . updates = this . updates . concat ( new Update ( edits ) ) ;
79+ } else {
80+ this . updates = [ new Update ( edits ) ] ;
81+ }
5082 }
5183
84+ this . _checksum = checksum ;
85+ this . _checksumAlgorithm = checksumAlgorithm ;
86+ this . _encodingCodePage = encodingCodePage ;
5287 this . hostDocumentVersion = hostDocumentVersion ;
53- this . updateContent ( edits ) ;
54- }
55-
56- public storeEdits ( edits : ServerTextChange [ ] , hostDocumentVersion : number ) {
57- this . hostDocumentVersion = hostDocumentVersion ;
58- if ( this . updates ) {
59- this . updates = this . updates . concat ( new Update ( edits ) ) ;
60- } else {
61- this . updates = [ new Update ( edits ) ] ;
62- }
6388 }
6489
6590 public getAndApplyEdits ( ) {
0 commit comments