@@ -927,10 +927,11 @@ define(function (require, exports, module) {
927
927
* @param {string } path - full path of file
928
928
* @return {jQuery.Promise } - the promise for the request
929
929
*/
930
- function primePump ( path ) {
930
+ function primePump ( path , isUntitledDoc ) {
931
931
_postMessageByPass ( {
932
- type : MessageIds . TERN_PRIME_PUMP_MSG ,
933
- path : path
932
+ type : MessageIds . TERN_PRIME_PUMP_MSG ,
933
+ path : path ,
934
+ isUntitledDoc : isUntitledDoc
934
935
} ) ;
935
936
936
937
return addPendingRequest ( path , OFFSET_ZERO , MessageIds . TERN_PRIME_PUMP_MSG ) ;
@@ -1152,7 +1153,7 @@ define(function (require, exports, module) {
1152
1153
if ( isDocumentDirty && previousDocument ) {
1153
1154
var updateFilePromise = updateTernFile ( previousDocument ) ;
1154
1155
updateFilePromise . done ( function ( ) {
1155
- primePump ( path ) ;
1156
+ primePump ( path , document . isUntitled ( ) ) ;
1156
1157
addFilesDeferred . resolveWith ( null , [ _ternWorker ] ) ;
1157
1158
} ) ;
1158
1159
} else {
@@ -1171,7 +1172,7 @@ define(function (require, exports, module) {
1171
1172
deferredPreferences . done ( function ( ) {
1172
1173
if ( file instanceof InMemoryFile ) {
1173
1174
initTernServer ( pr , [ ] ) ;
1174
- var hintsPromise = primePump ( path ) ;
1175
+ var hintsPromise = primePump ( path , true ) ;
1175
1176
hintsPromise . done ( function ( ) {
1176
1177
addFilesDeferred . resolveWith ( null , [ _ternWorker ] ) ;
1177
1178
} ) ;
@@ -1202,7 +1203,7 @@ define(function (require, exports, module) {
1202
1203
1203
1204
initTernServer ( dir , files ) ;
1204
1205
1205
- var hintsPromise = primePump ( path ) ;
1206
+ var hintsPromise = primePump ( path , false ) ;
1206
1207
hintsPromise . done ( function ( ) {
1207
1208
if ( ! usingModules ( ) ) {
1208
1209
// Read the subdirectories of the new file's directory.
@@ -1217,7 +1218,7 @@ define(function (require, exports, module) {
1217
1218
addAllFilesAndSubdirectories ( projectRoot , function ( ) {
1218
1219
// prime the pump again but this time don't wait
1219
1220
// for completion.
1220
- primePump ( path ) ;
1221
+ primePump ( path , false ) ;
1221
1222
1222
1223
addFilesDeferred . resolveWith ( null , [ _ternWorker ] ) ;
1223
1224
} ) ;
0 commit comments