@@ -42,7 +42,7 @@ class SyncedBuffer {
42
42
}
43
43
44
44
onContentChanged ( events : vscode . TextDocumentContentChangeEvent [ ] ) : void {
45
- var filePath = this . client . asAbsolutePath ( this . document . getUri ( ) ) ;
45
+ var filePath = this . client . asAbsolutePath ( this . document . uri ) ;
46
46
if ( ! filePath ) {
47
47
return ;
48
48
}
@@ -53,14 +53,10 @@ class SyncedBuffer {
53
53
var text = event . text ;
54
54
var args :Proto . ChangeRequestArgs = {
55
55
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 ,
64
60
insertString : text
65
61
} ;
66
62
this . client . execute ( 'change' , args , false ) ;
@@ -90,7 +86,7 @@ class BufferSyncSupport {
90
86
vscode . workspace . onDidOpenTextDocument ( this . onDidAddDocument , this , this . disposables ) ;
91
87
vscode . workspace . onDidCloseTextDocument ( this . onDidRemoveDocument , this , this . disposables ) ;
92
88
vscode . workspace . onDidChangeTextDocument ( this . onDidChangeDocument , this , this . disposables ) ;
93
- vscode . workspace . getTextDocuments ( ) . forEach ( this . onDidAddDocument , this ) ;
89
+ vscode . workspace . textDocuments . forEach ( this . onDidAddDocument , this ) ;
94
90
}
95
91
96
92
public dispose ( ) : void {
@@ -101,13 +97,13 @@ class BufferSyncSupport {
101
97
102
98
private onDidAddDocument ( document : vscode . TextDocument ) : void {
103
99
104
- if ( document . getLanguageId ( ) !== this . modeId ) {
100
+ if ( document . languageId !== this . modeId ) {
105
101
return ;
106
102
}
107
- if ( document . isUntitled ( ) ) {
103
+ if ( document . isUntitled ) {
108
104
return ;
109
105
}
110
- var resource = document . getUri ( ) ;
106
+ var resource = document . uri ;
111
107
var filepath = this . client . asAbsolutePath ( resource ) ;
112
108
if ( ! filepath ) {
113
109
return ;
@@ -117,11 +113,11 @@ class BufferSyncSupport {
117
113
syncedBuffer . open ( ) ;
118
114
this . requestDiagnostic ( filepath ) ;
119
115
120
- this . client . log ( "Added new document: " + document . getUri ( ) ) ;
116
+ this . client . log ( "Added new document: " + document . uri ) ;
121
117
}
122
118
123
119
private onDidRemoveDocument ( document : vscode . TextDocument ) : void {
124
- var filepath :string = this . client . asAbsolutePath ( document . getUri ( ) ) ;
120
+ var filepath :string = this . client . asAbsolutePath ( document . uri ) ;
125
121
if ( ! filepath ) {
126
122
return ;
127
123
}
@@ -134,7 +130,7 @@ class BufferSyncSupport {
134
130
}
135
131
136
132
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 ) ;
138
134
if ( ! filepath ) {
139
135
return ;
140
136
}
0 commit comments