Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -14,27 +14,26 @@ import { Position as EditorPosition } from 'vs/platform/editor/common/editor';
import { HtmlInput, HtmlInputOptions } from '../common/htmlInput';
import { HtmlPreviewPart } from 'vs/workbench/parts/html/browser/htmlPreviewPart';
import { Registry } from 'vs/platform/registry/common/platform';
import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { MenuRegistry } from 'vs/platform/actions/common/actions';
import { WebviewElement } from 'vs/workbench/parts/html/browser/webview';
import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions';
import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
function getActivePreviewsForResource(accessor: ServicesAccessor, resource: URI | string) {
const uri = resource instanceof URI ? resource : URI.parse(resource);
return accessor.get(IWorkbenchEditorService).getVisibleEditors()
.filter(c => c instanceof HtmlPreviewPart && c.model)
.map(e => e as HtmlPreviewPart)
.filter(e => e.model.uri.scheme === uri.scheme && e.model.uri.fsPath === uri.fsPath);
.filter(e => e.model.uri.scheme === uri.scheme && e.model.uri.toString() === uri.toString());
}
// --- Register Editor
(<IEditorRegistry>Registry.as(EditorExtensions.Editors)).registerEditor(new EditorDescriptor(HtmlPreviewPart.ID,
localize('html.editor.label', "Html Preview"),
'vs/workbench/parts/html/browser/htmlPreviewPart',
'HtmlPreviewPart'),
(<IEditorRegistry>Registry.as(EditorExtensions.Editors)).registerEditor(new EditorDescriptor(
HtmlPreviewPart,
HtmlPreviewPart.ID,
localize('html.editor.label', "Html Preview")),
[new SyncDescriptor(HtmlInput)]);
// --- Register Commands