mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -64,7 +64,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
}
|
||||
|
||||
public getModeIdByFilenameOrFirstLine(filename: string, firstLine?: string): string {
|
||||
var modeIds = this._registry.getModeIdsFromFilenameOrFirstLine(filename, firstLine);
|
||||
const modeIds = this._registry.getModeIdsFromFilenameOrFirstLine(filename, firstLine);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
@@ -74,7 +74,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
}
|
||||
|
||||
public getModeId(commaSeparatedMimetypesOrCommaSeparatedIds: string): string {
|
||||
var modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
const modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
@@ -94,10 +94,10 @@ export class ModeServiceImpl implements IModeService {
|
||||
// --- instantiation
|
||||
|
||||
public getMode(commaSeparatedMimetypesOrCommaSeparatedIds: string): IMode {
|
||||
var modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
const modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
|
||||
var isPlainText = false;
|
||||
for (var i = 0; i < modeIds.length; i++) {
|
||||
let isPlainText = false;
|
||||
for (let i = 0; i < modeIds.length; i++) {
|
||||
if (this._instantiatedModes.hasOwnProperty(modeIds[i])) {
|
||||
return this._instantiatedModes[modeIds[i]];
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
if (isPlainText) {
|
||||
// Try to do it synchronously
|
||||
var r: IMode = null;
|
||||
let r: IMode = null;
|
||||
this.getOrCreateMode(commaSeparatedMimetypesOrCommaSeparatedIds).then((mode) => {
|
||||
r = mode;
|
||||
}).done(null, onUnexpectedError);
|
||||
@@ -117,7 +117,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
public getOrCreateMode(commaSeparatedMimetypesOrCommaSeparatedIds: string): TPromise<IMode> {
|
||||
return this._onReady().then(() => {
|
||||
var modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
const modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
// Fall back to plain text if no mode was found
|
||||
return this._getOrCreateMode(modeId || 'plaintext');
|
||||
});
|
||||
@@ -125,14 +125,14 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
public getOrCreateModeByLanguageName(languageName: string): TPromise<IMode> {
|
||||
return this._onReady().then(() => {
|
||||
var modeId = this._getModeIdByLanguageName(languageName);
|
||||
const modeId = this._getModeIdByLanguageName(languageName);
|
||||
// Fall back to plain text if no mode was found
|
||||
return this._getOrCreateMode(modeId || 'plaintext');
|
||||
});
|
||||
}
|
||||
|
||||
private _getModeIdByLanguageName(languageName: string): string {
|
||||
var modeIds = this._registry.getModeIdsFromLanguageName(languageName);
|
||||
const modeIds = this._registry.getModeIdsFromLanguageName(languageName);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
@@ -143,7 +143,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
public getOrCreateModeByFilenameOrFirstLine(filename: string, firstLine?: string): TPromise<IMode> {
|
||||
return this._onReady().then(() => {
|
||||
var modeId = this.getModeIdByFilenameOrFirstLine(filename, firstLine);
|
||||
const modeId = this.getModeIdByFilenameOrFirstLine(filename, firstLine);
|
||||
// Fall back to plain text if no mode was found
|
||||
return this._getOrCreateMode(modeId || 'plaintext');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user