@@ -42,7 +42,7 @@ class SyncedBuffer {
4242 }
4343
4444 onContentChanged ( events : vscode . TextDocumentContentChangeEvent [ ] ) : void {
45- var filePath = this . client . asAbsolutePath ( this . document . getUri ( ) ) ;
45+ var filePath = this . client . asAbsolutePath ( this . document . uri ) ;
4646 if ( ! filePath ) {
4747 return ;
4848 }
@@ -53,14 +53,10 @@ class SyncedBuffer {
5353 var text = event . text ;
5454 var args :Proto . ChangeRequestArgs = {
5555 file : filePath ,
56- //line: range.start.line + 1,
57- //offset: range.start.character + 1,
58- //endLine: range.end.line + 1,
59- //endOffset: range.end.character + 1,
60- line : range . start . line ,
61- offset : range . start . character ,
62- endLine : range . end . line ,
63- endOffset : range . end . character ,
56+ line : range . start . line + 1 ,
57+ offset : range . start . character + 1 ,
58+ endLine : range . end . line + 1 ,
59+ endOffset : range . end . character + 1 ,
6460 insertString : text
6561 } ;
6662 this . client . execute ( 'change' , args , false ) ;
@@ -90,7 +86,7 @@ class BufferSyncSupport {
9086 vscode . workspace . onDidOpenTextDocument ( this . onDidAddDocument , this , this . disposables ) ;
9187 vscode . workspace . onDidCloseTextDocument ( this . onDidRemoveDocument , this , this . disposables ) ;
9288 vscode . workspace . onDidChangeTextDocument ( this . onDidChangeDocument , this , this . disposables ) ;
93- vscode . workspace . getTextDocuments ( ) . forEach ( this . onDidAddDocument , this ) ;
89+ vscode . workspace . textDocuments . forEach ( this . onDidAddDocument , this ) ;
9490 }
9591
9692 public dispose ( ) : void {
@@ -101,13 +97,13 @@ class BufferSyncSupport {
10197
10298 private onDidAddDocument ( document : vscode . TextDocument ) : void {
10399
104- if ( document . getLanguageId ( ) !== this . modeId ) {
100+ if ( document . languageId !== this . modeId ) {
105101 return ;
106102 }
107- if ( document . isUntitled ( ) ) {
103+ if ( document . isUntitled ) {
108104 return ;
109105 }
110- var resource = document . getUri ( ) ;
106+ var resource = document . uri ;
111107 var filepath = this . client . asAbsolutePath ( resource ) ;
112108 if ( ! filepath ) {
113109 return ;
@@ -117,11 +113,11 @@ class BufferSyncSupport {
117113 syncedBuffer . open ( ) ;
118114 this . requestDiagnostic ( filepath ) ;
119115
120- this . client . log ( "Added new document: " + document . getUri ( ) ) ;
116+ this . client . log ( "Added new document: " + document . uri ) ;
121117 }
122118
123119 private onDidRemoveDocument ( document : vscode . TextDocument ) : void {
124- var filepath :string = this . client . asAbsolutePath ( document . getUri ( ) ) ;
120+ var filepath :string = this . client . asAbsolutePath ( document . uri ) ;
125121 if ( ! filepath ) {
126122 return ;
127123 }
@@ -134,7 +130,7 @@ class BufferSyncSupport {
134130 }
135131
136132 private onDidChangeDocument ( e : vscode . TextDocumentChangeEvent ) : void {
137- var filepath :string = this . client . asAbsolutePath ( e . document . getUri ( ) ) ;
133+ var filepath :string = this . client . asAbsolutePath ( e . document . uri ) ;
138134 if ( ! filepath ) {
139135 return ;
140136 }
0 commit comments