mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -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:
@@ -8,14 +8,14 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { first } from 'vs/base/common/async';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IModel } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { IDisposable, toDisposable, IReference, ReferenceCollection, ImmortalReference } from 'vs/base/common/lifecycle';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import network = require('vs/base/common/network');
|
||||
import { ITextModelService, ITextModelContentProvider, ITextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { IUntitledEditorService, UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
|
||||
|
||||
class ResourceModelCollection extends ReferenceCollection<TPromise<ITextEditorModel>> {
|
||||
@@ -81,7 +81,7 @@ class ResourceModelCollection extends ReferenceCollection<TPromise<ITextEditorMo
|
||||
});
|
||||
}
|
||||
|
||||
private resolveTextModelContent(key: string): TPromise<IModel> {
|
||||
private resolveTextModelContent(key: string): TPromise<ITextModel> {
|
||||
const resource = URI.parse(key);
|
||||
const providers = this.providers[resource.scheme] || [];
|
||||
const factories = providers.map(p => () => p.provideTextContent(resource));
|
||||
@@ -89,7 +89,7 @@ class ResourceModelCollection extends ReferenceCollection<TPromise<ITextEditorMo
|
||||
return first(factories).then(model => {
|
||||
if (!model) {
|
||||
console.error(`Unable to open '${resource}' resource is not available.`); // TODO PII
|
||||
return TPromise.wrapError<IModel>(new Error('resource is not available'));
|
||||
return TPromise.wrapError<ITextModel>(new Error('resource is not available'));
|
||||
}
|
||||
|
||||
return model;
|
||||
@@ -119,7 +119,7 @@ export class TextModelResolverService implements ITextModelService {
|
||||
|
||||
// Untitled Schema: go through cached input
|
||||
// TODO ImmortalReference is a hack
|
||||
if (resource.scheme === UNTITLED_SCHEMA) {
|
||||
if (resource.scheme === network.Schemas.untitled) {
|
||||
return this.untitledEditorService.loadOrCreate({ resource }).then(model => new ImmortalReference(model));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { IModel } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
|
||||
@@ -22,6 +22,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager';
|
||||
import { once } from 'vs/base/common/event';
|
||||
import { snapshotToString } from 'vs/platform/files/common/files';
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor(
|
||||
@@ -57,7 +58,7 @@ suite('Workbench - TextModelResolverService', () => {
|
||||
|
||||
test('resolve resource', function (done) {
|
||||
const dispose = accessor.textModelResolverService.registerTextModelContentProvider('test', {
|
||||
provideTextContent: function (resource: URI): TPromise<IModel> {
|
||||
provideTextContent: function (resource: URI): TPromise<ITextModel> {
|
||||
if (resource.scheme === 'test') {
|
||||
let modelContent = 'Hello Test';
|
||||
let mode = accessor.modeService.getOrCreateMode('json');
|
||||
@@ -73,7 +74,7 @@ suite('Workbench - TextModelResolverService', () => {
|
||||
|
||||
input.resolve().then(model => {
|
||||
assert.ok(model);
|
||||
assert.equal((model as ResourceEditorModel).getValue(), 'Hello Test');
|
||||
assert.equal(snapshotToString((model as ResourceEditorModel).createSnapshot()), 'Hello Test');
|
||||
|
||||
let disposed = false;
|
||||
once(model.onDispose)(() => {
|
||||
@@ -133,7 +134,7 @@ suite('Workbench - TextModelResolverService', () => {
|
||||
let waitForIt = new TPromise(c => resolveModel = c);
|
||||
|
||||
const disposable = accessor.textModelResolverService.registerTextModelContentProvider('test', {
|
||||
provideTextContent: async (resource: URI): TPromise<IModel> => {
|
||||
provideTextContent: async (resource: URI): TPromise<ITextModel> => {
|
||||
await waitForIt;
|
||||
|
||||
let modelContent = 'Hello Test';
|
||||
|
||||
Reference in New Issue
Block a user