Merge branch 'master' into scm-api

This commit is contained in:
Joao Moreno
2017-01-10 10:27:33 +01:00
271 changed files with 94137 additions and 92543 deletions

View File

@@ -35,7 +35,6 @@ import { MainThreadFileSystemEventService } from './mainThreadFileSystemEventSer
import { MainThreadSCM } from './mainThreadSCM';
// --- other interested parties
import { MainProcessTextMateSyntax } from 'vs/editor/node/textMate/TMSyntax';
import { MainProcessTextMateSnippet } from 'vs/editor/node/textMate/TMSnippets';
import { JSONValidationExtensionPoint } from 'vs/platform/jsonschemas/common/jsonValidationExtensionPoint';
import { LanguageConfigurationFileHandler } from 'vs/editor/node/languageConfigurationExtensionPoint';
@@ -89,10 +88,9 @@ export class ExtHostContribution implements IWorkbenchContribution {
col.finish(true, this.threadService);
// Other interested parties
let tmSyntax = create(MainProcessTextMateSyntax);
create(MainProcessTextMateSnippet);
create(JSONValidationExtensionPoint);
this.instantiationService.createInstance(LanguageConfigurationFileHandler, tmSyntax);
this.instantiationService.createInstance(LanguageConfigurationFileHandler);
create(MainThreadFileSystemEventService);
create(SaveParticipant);
}

View File

@@ -303,6 +303,14 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
this._loadExtensionContext(extensionDescription)
]).then(values => {
return ExtHostExtensionService._callActivate(<IExtensionModule>values[0], <IExtensionContext>values[1]);
}, (errors: any[]) => {
// Avoid failing with an array of errors, fail with a single error
if (errors[0]) {
return TPromise.wrapError(errors[0]);
}
if (errors[1]) {
return TPromise.wrapError(errors[1]);
}
});
});
}

View File

@@ -106,7 +106,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
url: model.uri,
versionId: model.getVersionId(),
value: model.toRawText(),
modeId: model.getMode().getId(),
modeId: model.getLanguageIdentifier().language,
isDirty: this._textFileService.isDirty(modelUrl)
});
}
@@ -117,7 +117,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
if (!this._modelIsSynced[modelUrl.toString()]) {
return;
}
this._proxy.$acceptModelModeChanged(model.uri.toString(), oldModeId, model.getMode().getId());
this._proxy.$acceptModelModeChanged(model.uri.toString(), oldModeId, model.getLanguageIdentifier().language);
}
private _onModelRemoved(model: editorCommon.IModel): void {

View File

@@ -20,20 +20,24 @@ import { ExtHostContext, MainThreadLanguageFeaturesShape, ExtHostLanguageFeature
import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
import { LanguageConfiguration } from 'vs/editor/common/modes/languageConfiguration';
import { IHeapService } from './mainThreadHeapService';
import { IModeService } from 'vs/editor/common/services/modeService';
export class MainThreadLanguageFeatures extends MainThreadLanguageFeaturesShape {
private _proxy: ExtHostLanguageFeaturesShape;
private _heapService: IHeapService;
private _modeService: IModeService;
private _registrations: { [handle: number]: IDisposable; } = Object.create(null);
constructor(
@IThreadService threadService: IThreadService,
@IHeapService heapService: IHeapService
@IHeapService heapService: IHeapService,
@IModeService modeService: IModeService,
) {
super();
this._proxy = threadService.get(ExtHostContext.ExtHostLanguageFeatures);
this._heapService = heapService;
this._modeService = modeService;
}
$unregister(handle: number): TPromise<any> {
@@ -273,7 +277,11 @@ export class MainThreadLanguageFeatures extends MainThreadLanguageFeaturesShape
};
}
this._registrations[handle] = LanguageConfigurationRegistry.register(languageId, configuration);
let languageIdentifier = this._modeService.getLanguageIdentifier(languageId);
if (languageIdentifier) {
this._registrations[handle] = LanguageConfigurationRegistry.register(languageIdentifier, configuration);
}
return undefined;
}