55'use strict' ;
66
77import Event , { Emitter } from 'vs/base/common/event' ;
8- import URI from 'vs/base/common/uri' ;
8+ import URI , { UriComponents } from 'vs/base/common/uri' ;
99import { IDisposable , dispose } from 'vs/base/common/lifecycle' ;
1010import * as TypeConverters from './extHostTypeConverters' ;
1111import { TPromise } from 'vs/base/common/winjs.base' ;
@@ -95,7 +95,9 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
9595 return this . _proxy . $tryCreateDocument ( options ) . then ( data => URI . revive ( data ) ) ;
9696 }
9797
98- public $acceptModelModeChanged ( strURL : string , oldModeId : string , newModeId : string ) : void {
98+ public $acceptModelModeChanged ( uriComponents : UriComponents , oldModeId : string , newModeId : string ) : void {
99+ const uri = URI . revive ( uriComponents ) ;
100+ const strURL = uri . toString ( ) ;
99101 let data = this . _documentsAndEditors . getDocument ( strURL ) ;
100102
101103 // Treat a mode change as a remove + add
@@ -105,13 +107,17 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
105107 this . _onDidAddDocument . fire ( data . document ) ;
106108 }
107109
108- public $acceptModelSaved ( strURL : string ) : void {
110+ public $acceptModelSaved ( uriComponents : UriComponents ) : void {
111+ const uri = URI . revive ( uriComponents ) ;
112+ const strURL = uri . toString ( ) ;
109113 let data = this . _documentsAndEditors . getDocument ( strURL ) ;
110- this . $acceptDirtyStateChanged ( strURL , false ) ;
114+ this . $acceptDirtyStateChanged ( uriComponents , false ) ;
111115 this . _onDidSaveDocument . fire ( data . document ) ;
112116 }
113117
114- public $acceptDirtyStateChanged ( strURL : string , isDirty : boolean ) : void {
118+ public $acceptDirtyStateChanged ( uriComponents : UriComponents , isDirty : boolean ) : void {
119+ const uri = URI . revive ( uriComponents ) ;
120+ const strURL = uri . toString ( ) ;
115121 let data = this . _documentsAndEditors . getDocument ( strURL ) ;
116122 data . _acceptIsDirty ( isDirty ) ;
117123 this . _onDidChangeDocument . fire ( {
@@ -120,7 +126,9 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
120126 } ) ;
121127 }
122128
123- public $acceptModelChanged ( strURL : string , events : IModelChangedEvent , isDirty : boolean ) : void {
129+ public $acceptModelChanged ( uriComponents : UriComponents , events : IModelChangedEvent , isDirty : boolean ) : void {
130+ const uri = URI . revive ( uriComponents ) ;
131+ const strURL = uri . toString ( ) ;
124132 let data = this . _documentsAndEditors . getDocument ( strURL ) ;
125133 data . _acceptIsDirty ( isDirty ) ;
126134 data . onEvents ( events ) ;
0 commit comments