未验证 提交 d1f9e098 编写于 作者: S Sandeep Somavarapu 提交者: GitHub

Merge branch 'master' into sandy081/fileOutput

......@@ -30,16 +30,16 @@ export const jsTsLanguageConfiguration = {
action: { indentAction: IndentAction.None, appendText: ' * ' }
}, {
// e.g. * ...|
beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
beforeText: /^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/,
action: { indentAction: IndentAction.None, appendText: '* ' }
}, {
// e.g. */|
beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
beforeText: /^(\t|[ ])*[ ]\*\/\s*$/,
action: { indentAction: IndentAction.None, removeText: 1 }
},
{
// e.g. *-----*/|
beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/,
beforeText: /^(\t|[ ])*[ ]\*[^/]*\*\/\s*$/,
action: { indentAction: IndentAction.None, removeText: 1 }
}
]
......
......@@ -51,6 +51,39 @@ class VisibleTextAreaData {
const canUseZeroSizeTextarea = (browser.isEdgeOrIE || browser.isFirefox);
interface LocalClipboardMetadata {
lastCopiedValue: string;
isFromEmptySelection: boolean;
}
/**
* Every time we write to the clipboard, we record a bit of extra metadata here.
* Every time we read from the cipboard, if the text matches our last written text,
* we can fetch the previous metadata.
*/
class LocalClipboardMetadataManager {
public static INSTANCE = new LocalClipboardMetadataManager();
private _lastState: LocalClipboardMetadata;
constructor() {
this._lastState = null;
}
public set(state: LocalClipboardMetadata): void {
this._lastState = state;
}
public get(pastedText: string): LocalClipboardMetadata {
if (this._lastState && this._lastState.lastCopiedValue === pastedText) {
// match!
return this._lastState;
}
this._lastState = null;
return null;
}
}
export class TextAreaHandler extends ViewPart {
private readonly _viewController: ViewController;
......@@ -70,8 +103,6 @@ export class TextAreaHandler extends ViewPart {
*/
private _visibleTextArea: VisibleTextAreaData;
private _selections: Selection[];
private _lastCopiedValue: string;
private _lastCopiedValueIsFromEmptySelection: boolean;
public readonly textArea: FastDomNode<HTMLTextAreaElement>;
public readonly textAreaCover: FastDomNode<HTMLElement>;
......@@ -97,8 +128,6 @@ export class TextAreaHandler extends ViewPart {
this._visibleTextArea = null;
this._selections = [new Selection(1, 1, 1, 1)];
this._lastCopiedValue = null;
this._lastCopiedValueIsFromEmptySelection = false;
// Text Area (The focus will always be in the textarea when the cursor is blinking)
this.textArea = createFastDomNode(document.createElement('textarea'));
......@@ -134,18 +163,15 @@ export class TextAreaHandler extends ViewPart {
getPlainTextToCopy: (): string => {
const whatToCopy = this._context.model.getPlainTextToCopy(this._selections, this._emptySelectionClipboard);
if (this._emptySelectionClipboard) {
if (browser.isFirefox) {
// When writing "LINE\r\n" to the clipboard and then pasting,
// Firefox pastes "LINE\n", so let's work around this quirk
this._lastCopiedValue = whatToCopy.replace(/\r\n/g, '\n');
} else {
this._lastCopiedValue = whatToCopy;
}
// When writing "LINE\r\n" to the clipboard and then pasting,
// Firefox pastes "LINE\n", so let's work around this quirk
const lastCopiedValue = (browser.isFirefox ? whatToCopy.replace(/\r\n/g, '\n') : whatToCopy);
const metadata: LocalClipboardMetadata = {
lastCopiedValue: lastCopiedValue,
isFromEmptySelection: (this._emptySelectionClipboard && this._selections.length === 1 && this._selections[0].isEmpty())
};
let selections = this._selections;
this._lastCopiedValueIsFromEmptySelection = (selections.length === 1 && selections[0].isEmpty());
}
LocalClipboardMetadataManager.INSTANCE.set(metadata);
return whatToCopy;
},
......@@ -199,9 +225,11 @@ export class TextAreaHandler extends ViewPart {
}));
this._register(this._textAreaInput.onPaste((e: IPasteData) => {
const metadata = LocalClipboardMetadataManager.INSTANCE.get(e.text);
let pasteOnNewLine = false;
if (this._emptySelectionClipboard) {
pasteOnNewLine = (e.text === this._lastCopiedValue && this._lastCopiedValueIsFromEmptySelection);
if (metadata) {
pasteOnNewLine = (this._emptySelectionClipboard && metadata.isFromEmptySelection);
}
this._viewController.paste('keyboard', e.text, pasteOnNewLine);
}));
......
......@@ -154,7 +154,7 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
export class ModesContentHoverWidget extends ContentHoverWidget {
static ID = 'editor.contrib.modesContentHoverWidget';
static readonly ID = 'editor.contrib.modesContentHoverWidget';
private _messages: HoverPart[];
private _lastRange: Range;
......
......@@ -125,7 +125,7 @@ export class QuickFixController implements IEditorContribution {
export class QuickFixAction extends EditorAction {
static Id = 'editor.action.quickFix';
static readonly Id = 'editor.action.quickFix';
constructor() {
super({
......
......@@ -398,7 +398,7 @@ export class MainThreadDocumentsAndEditors {
private _toModelAddData(model: IModel): IModelAddedData {
return {
url: model.uri,
uri: model.uri,
versionId: model.getVersionId(),
lines: model.getLinesContent(),
EOL: model.getEOL(),
......@@ -410,7 +410,7 @@ export class MainThreadDocumentsAndEditors {
private _toTextEditorAddData(textEditor: MainThreadTextEditor): ITextEditorAddData {
return {
id: textEditor.getId(),
document: textEditor.getModel().uri,
documentUri: textEditor.getModel().uri,
options: textEditor.getConfiguration(),
selections: textEditor.getSelections(),
editorPosition: this._findEditorPosition(textEditor)
......
......@@ -123,7 +123,9 @@ class RemoteFileSystemProvider implements IFileSystemProvider, ISearchResultProv
return this._proxy.$mkdir(this._handle, resource);
}
readdir(resource: URI): TPromise<[URI, IStat][], any> {
return this._proxy.$readdir(this._handle, resource);
return this._proxy.$readdir(this._handle, resource).then(data => {
return data.map(tuple => <[URI, IStat]>[URI.revive(tuple[0]), tuple[1]]);
});
}
rmdir(resource: URI): TPromise<void, any> {
return this._proxy.$rmdir(this._handle, resource);
......
......@@ -48,7 +48,6 @@ import { ITreeItem } from 'vs/workbench/common/views';
import { ThemeColor } from 'vs/platform/theme/common/themeService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { SerializedError } from 'vs/base/common/errors';
import { IWorkspaceFolderData } from 'vs/platform/workspace/common/workspace';
import { IStat, IFileChange } from 'vs/platform/files/common/files';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
......@@ -68,7 +67,7 @@ export interface IEnvironment {
export interface IWorkspaceData {
id: string;
name: string;
folders: IWorkspaceFolderData[];
folders: { uri: UriComponents, name: string, index: number }[];
}
export interface IInitData {
......@@ -437,7 +436,7 @@ export interface ExtHostDocumentContentProvidersShape {
}
export interface IModelAddedData {
url: URI;
uri: UriComponents;
versionId: number;
lines: string[];
EOL: string;
......@@ -457,7 +456,7 @@ export interface ExtHostDocumentSaveParticipantShape {
export interface ITextEditorAddData {
id: string;
document: URI;
documentUri: UriComponents;
options: IResolvedTextEditorConfiguration;
selections: ISelection[];
editorPosition: EditorPosition;
......@@ -493,15 +492,15 @@ export interface ExtHostWorkspaceShape {
}
export interface ExtHostFileSystemShape {
$utimes(handle: number, resource: URI, mtime: number, atime: number): TPromise<IStat>;
$stat(handle: number, resource: URI): TPromise<IStat>;
$read(handle: number, offset: number, count: number, resource: URI): TPromise<number>;
$write(handle: number, resource: URI, content: number[]): TPromise<void>;
$unlink(handle: number, resource: URI): TPromise<void>;
$move(handle: number, resource: URI, target: URI): TPromise<IStat>;
$mkdir(handle: number, resource: URI): TPromise<IStat>;
$readdir(handle: number, resource: URI): TPromise<[URI, IStat][]>;
$rmdir(handle: number, resource: URI): TPromise<void>;
$utimes(handle: number, resource: UriComponents, mtime: number, atime: number): TPromise<IStat>;
$stat(handle: number, resource: UriComponents): TPromise<IStat>;
$read(handle: number, offset: number, count: number, resource: UriComponents): TPromise<number>;
$write(handle: number, resource: UriComponents, content: number[]): TPromise<void>;
$unlink(handle: number, resource: UriComponents): TPromise<void>;
$move(handle: number, resource: UriComponents, target: UriComponents): TPromise<IStat>;
$mkdir(handle: number, resource: UriComponents): TPromise<IStat>;
$readdir(handle: number, resource: UriComponents): TPromise<[UriComponents, IStat][]>;
$rmdir(handle: number, resource: UriComponents): TPromise<void>;
$fileFiles(handle: number, session: number, query: string): TPromise<void>;
}
......@@ -568,31 +567,31 @@ export type IWorkspaceSymbol = IdObject & modes.SymbolInformation;
export interface IWorkspaceSymbols extends IdObject { symbols: IWorkspaceSymbol[]; }
export interface ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]>;
$provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]>;
$resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol>;
$provideDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideImplementation(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideTypeDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideHover(handle: number, resource: URI, position: IPosition): TPromise<modes.Hover>;
$provideDocumentHighlights(handle: number, resource: URI, position: IPosition): TPromise<modes.DocumentHighlight[]>;
$provideReferences(handle: number, resource: URI, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]>;
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]>;
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideDocumentSymbols(handle: number, resource: UriComponents): TPromise<modes.SymbolInformation[]>;
$provideCodeLenses(handle: number, resource: UriComponents): TPromise<modes.ICodeLensSymbol[]>;
$resolveCodeLens(handle: number, resource: UriComponents, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol>;
$provideDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition>;
$provideImplementation(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition>;
$provideTypeDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition>;
$provideHover(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Hover>;
$provideDocumentHighlights(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.DocumentHighlight[]>;
$provideReferences(handle: number, resource: UriComponents, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]>;
$provideCodeActions(handle: number, resource: UriComponents, range: IRange): TPromise<modes.CodeAction[]>;
$provideDocumentFormattingEdits(handle: number, resource: UriComponents, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideDocumentRangeFormattingEdits(handle: number, resource: UriComponents, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideOnTypeFormattingEdits(handle: number, resource: UriComponents, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideWorkspaceSymbols(handle: number, search: string): TPromise<IWorkspaceSymbols>;
$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<IWorkspaceSymbol>;
$releaseWorkspaceSymbols(handle: number, id: number): void;
$provideRenameEdits(handle: number, resource: URI, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit>;
$provideCompletionItems(handle: number, resource: URI, position: IPosition, context: modes.SuggestContext): TPromise<IExtHostSuggestResult>;
$resolveCompletionItem(handle: number, resource: URI, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion>;
$provideRenameEdits(handle: number, resource: UriComponents, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit>;
$provideCompletionItems(handle: number, resource: UriComponents, position: IPosition, context: modes.SuggestContext): TPromise<IExtHostSuggestResult>;
$resolveCompletionItem(handle: number, resource: UriComponents, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion>;
$releaseCompletionItems(handle: number, id: number): void;
$provideSignatureHelp(handle: number, resource: URI, position: IPosition): TPromise<modes.SignatureHelp>;
$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]>;
$provideSignatureHelp(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.SignatureHelp>;
$provideDocumentLinks(handle: number, resource: UriComponents): TPromise<modes.ILink[]>;
$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink>;
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]>;
$provideColorPresentations(handle: number, resource: URI, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]>;
$provideDocumentColors(handle: number, resource: UriComponents): TPromise<IRawColorInfo[]>;
$provideColorPresentations(handle: number, resource: UriComponents, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]>;
}
export interface ExtHostQuickOpenShape {
......@@ -686,7 +685,7 @@ export const MainContext = {
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', ProxyType.CustomMarshaller),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', ProxyType.CustomMarshaller),
......@@ -700,13 +699,13 @@ export const ExtHostContext = {
ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics'),
ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService', ProxyType.CustomMarshaller),
ExtHostDecorations: createExtId<ExtHostDecorationsShape>('ExtHostDecorations'),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ProxyType.CustomMarshaller),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors'),
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ProxyType.CustomMarshaller),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors'),
ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem', ProxyType.CustomMarshaller),
ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem'),
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor'),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ProxyType.CustomMarshaller),
......@@ -715,6 +714,6 @@ export const ExtHostContext = {
ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService'),
ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ProxyType.CustomMarshaller),
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ProxyType.CustomMarshaller),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace', ProxyType.CustomMarshaller),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
ExtHostWindow: createExtId<ExtHostWindowShape>('ExtHostWindow'),
};
......@@ -11,6 +11,7 @@ import { ExtHostDocumentData } from './extHostDocumentData';
import { ExtHostTextEditor } from './extHostTextEditor';
import * as assert from 'assert';
import * as typeConverters from './extHostTypeConverters';
import URI from 'vs/base/common/uri';
export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsShape {
......@@ -49,18 +50,19 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
if (delta.addedDocuments) {
for (const data of delta.addedDocuments) {
assert.ok(!this._documents.has(data.url.toString()), `document '${data.url} already exists!'`);
const resource = URI.revive(data.uri);
assert.ok(!this._documents.has(resource.toString()), `document '${resource} already exists!'`);
const documentData = new ExtHostDocumentData(
this._mainContext.getProxy(MainContext.MainThreadDocuments),
data.url,
resource,
data.lines,
data.EOL,
data.modeId,
data.versionId,
data.isDirty
);
this._documents.set(data.url.toString(), documentData);
this._documents.set(resource.toString(), documentData);
addedDocuments.push(documentData);
}
}
......@@ -75,10 +77,11 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
if (delta.addedEditors) {
for (const data of delta.addedEditors) {
assert.ok(this._documents.has(data.document.toString()), `document '${data.document}' does not exist`);
const resource = URI.revive(data.documentUri);
assert.ok(this._documents.has(resource.toString()), `document '${resource}' does not exist`);
assert.ok(!this._editors.has(data.id), `editor '${data.id}' already exists!`);
const documentData = this._documents.get(data.document.toString());
const documentData = this._documents.get(resource.toString());
const editor = new ExtHostTextEditor(
this._mainContext.getProxy(MainContext.MainThreadEditors),
data.id,
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import URI from 'vs/base/common/uri';
import URI, { UriComponents } from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
import { MainContext, IMainContext, ExtHostFileSystemShape, MainThreadFileSystemShape } from './extHost.protocol';
import * as vscode from 'vscode';
......@@ -42,37 +42,37 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
};
}
$utimes(handle: number, resource: URI, mtime: number, atime: number): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).utimes(resource, mtime, atime));
$utimes(handle: number, resource: UriComponents, mtime: number, atime: number): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).utimes(URI.revive(resource), mtime, atime));
}
$stat(handle: number, resource: URI): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).stat(resource));
$stat(handle: number, resource: UriComponents): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).stat(URI.revive(resource)));
}
$read(handle: number, offset: number, count: number, resource: URI): TPromise<number> {
$read(handle: number, offset: number, count: number, resource: UriComponents): TPromise<number> {
const progress = {
report: chunk => {
this._proxy.$reportFileChunk(handle, resource, [].slice.call(chunk));
}
};
return asWinJsPromise(token => this._provider.get(handle).read(resource, offset, count, progress));
return asWinJsPromise(token => this._provider.get(handle).read(URI.revive(resource), offset, count, progress));
}
$write(handle: number, resource: URI, content: number[]): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).write(resource, Buffer.from(content)));
$write(handle: number, resource: UriComponents, content: number[]): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).write(URI.revive(resource), Buffer.from(content)));
}
$unlink(handle: number, resource: URI): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).unlink(resource));
$unlink(handle: number, resource: UriComponents): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).unlink(URI.revive(resource)));
}
$move(handle: number, resource: URI, target: URI): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).move(resource, target));
$move(handle: number, resource: UriComponents, target: UriComponents): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).move(URI.revive(resource), URI.revive(target)));
}
$mkdir(handle: number, resource: URI): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).mkdir(resource));
$mkdir(handle: number, resource: UriComponents): TPromise<IStat, any> {
return asWinJsPromise(token => this._provider.get(handle).mkdir(URI.revive(resource)));
}
$readdir(handle: number, resource: URI): TPromise<[URI, IStat][], any> {
return asWinJsPromise(token => this._provider.get(handle).readdir(resource));
$readdir(handle: number, resource: UriComponents): TPromise<[UriComponents, IStat][], any> {
return asWinJsPromise(token => this._provider.get(handle).readdir(URI.revive(resource)));
}
$rmdir(handle: number, resource: URI): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).rmdir(resource));
$rmdir(handle: number, resource: UriComponents): TPromise<void, any> {
return asWinJsPromise(token => this._provider.get(handle).rmdir(URI.revive(resource)));
}
$fileFiles(handle: number, session: number, query: string): TPromise<void> {
const provider = this._provider.get(handle);
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import URI from 'vs/base/common/uri';
import URI, { UriComponents } from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
import { mixin } from 'vs/base/common/objects';
import * as vscode from 'vscode';
......@@ -835,8 +835,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]> {
return this._withAdapter(handle, OutlineAdapter, adapter => adapter.provideDocumentSymbols(resource));
$provideDocumentSymbols(handle: number, resource: UriComponents): TPromise<modes.SymbolInformation[]> {
return this._withAdapter(handle, OutlineAdapter, adapter => adapter.provideDocumentSymbols(URI.revive(resource)));
}
// --- code lens
......@@ -857,12 +857,12 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return result;
}
$provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]> {
return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(resource));
$provideCodeLenses(handle: number, resource: UriComponents): TPromise<modes.ICodeLensSymbol[]> {
return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(URI.revive(resource)));
}
$resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> {
return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLens(resource, symbol));
$resolveCodeLens(handle: number, resource: UriComponents, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> {
return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLens(URI.revive(resource), symbol));
}
// --- declaration
......@@ -874,8 +874,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, DefinitionAdapter, adapter => adapter.provideDefinition(resource, position));
$provideDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, DefinitionAdapter, adapter => adapter.provideDefinition(URI.revive(resource), position));
}
registerImplementationProvider(selector: vscode.DocumentSelector, provider: vscode.ImplementationProvider): vscode.Disposable {
......@@ -885,8 +885,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideImplementation(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, ImplementationAdapter, adapter => adapter.provideImplementation(resource, position));
$provideImplementation(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, ImplementationAdapter, adapter => adapter.provideImplementation(URI.revive(resource), position));
}
registerTypeDefinitionProvider(selector: vscode.DocumentSelector, provider: vscode.TypeDefinitionProvider): vscode.Disposable {
......@@ -896,8 +896,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideTypeDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, TypeDefinitionAdapter, adapter => adapter.provideTypeDefinition(resource, position));
$provideTypeDefinition(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Definition> {
return this._withAdapter(handle, TypeDefinitionAdapter, adapter => adapter.provideTypeDefinition(URI.revive(resource), position));
}
// --- extra info
......@@ -909,8 +909,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideHover(handle: number, resource: URI, position: IPosition): TPromise<modes.Hover> {
return this._withAdapter(handle, HoverAdapter, adpater => adpater.provideHover(resource, position));
$provideHover(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Hover> {
return this._withAdapter(handle, HoverAdapter, adpater => adpater.provideHover(URI.revive(resource), position));
}
// --- occurrences
......@@ -922,8 +922,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentHighlights(handle: number, resource: URI, position: IPosition): TPromise<modes.DocumentHighlight[]> {
return this._withAdapter(handle, DocumentHighlightAdapter, adapter => adapter.provideDocumentHighlights(resource, position));
$provideDocumentHighlights(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.DocumentHighlight[]> {
return this._withAdapter(handle, DocumentHighlightAdapter, adapter => adapter.provideDocumentHighlights(URI.revive(resource), position));
}
// --- references
......@@ -935,8 +935,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideReferences(handle: number, resource: URI, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> {
return this._withAdapter(handle, ReferenceAdapter, adapter => adapter.provideReferences(resource, position, context));
$provideReferences(handle: number, resource: UriComponents, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> {
return this._withAdapter(handle, ReferenceAdapter, adapter => adapter.provideReferences(URI.revive(resource), position, context));
}
// --- quick fix
......@@ -948,8 +948,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]> {
return this._withAdapter(handle, CodeActionAdapter, adapter => adapter.provideCodeActions(resource, range));
$provideCodeActions(handle: number, resource: UriComponents, range: IRange): TPromise<modes.CodeAction[]> {
return this._withAdapter(handle, CodeActionAdapter, adapter => adapter.provideCodeActions(URI.revive(resource), range));
}
// --- formatting
......@@ -961,8 +961,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, DocumentFormattingAdapter, adapter => adapter.provideDocumentFormattingEdits(resource, options));
$provideDocumentFormattingEdits(handle: number, resource: UriComponents, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, DocumentFormattingAdapter, adapter => adapter.provideDocumentFormattingEdits(URI.revive(resource), options));
}
registerDocumentRangeFormattingEditProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentRangeFormattingEditProvider): vscode.Disposable {
......@@ -972,8 +972,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, RangeFormattingAdapter, adapter => adapter.provideDocumentRangeFormattingEdits(resource, range, options));
$provideDocumentRangeFormattingEdits(handle: number, resource: UriComponents, range: IRange, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, RangeFormattingAdapter, adapter => adapter.provideDocumentRangeFormattingEdits(URI.revive(resource), range, options));
}
registerOnTypeFormattingEditProvider(selector: vscode.DocumentSelector, provider: vscode.OnTypeFormattingEditProvider, triggerCharacters: string[]): vscode.Disposable {
......@@ -983,8 +983,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, OnTypeFormattingAdapter, adapter => adapter.provideOnTypeFormattingEdits(resource, position, ch, options));
$provideOnTypeFormattingEdits(handle: number, resource: UriComponents, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, OnTypeFormattingAdapter, adapter => adapter.provideOnTypeFormattingEdits(URI.revive(resource), position, ch, options));
}
// --- navigate types
......@@ -1017,8 +1017,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideRenameEdits(handle: number, resource: URI, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit> {
return this._withAdapter(handle, RenameAdapter, adapter => adapter.provideRenameEdits(resource, position, newName));
$provideRenameEdits(handle: number, resource: UriComponents, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit> {
return this._withAdapter(handle, RenameAdapter, adapter => adapter.provideRenameEdits(URI.revive(resource), position, newName));
}
// --- suggestion
......@@ -1030,12 +1030,12 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideCompletionItems(handle: number, resource: URI, position: IPosition, context: modes.SuggestContext): TPromise<IExtHostSuggestResult> {
return this._withAdapter(handle, SuggestAdapter, adapter => adapter.provideCompletionItems(resource, position, context));
$provideCompletionItems(handle: number, resource: UriComponents, position: IPosition, context: modes.SuggestContext): TPromise<IExtHostSuggestResult> {
return this._withAdapter(handle, SuggestAdapter, adapter => adapter.provideCompletionItems(URI.revive(resource), position, context));
}
$resolveCompletionItem(handle: number, resource: URI, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> {
return this._withAdapter(handle, SuggestAdapter, adapter => adapter.resolveCompletionItem(resource, position, suggestion));
$resolveCompletionItem(handle: number, resource: UriComponents, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> {
return this._withAdapter(handle, SuggestAdapter, adapter => adapter.resolveCompletionItem(URI.revive(resource), position, suggestion));
}
$releaseCompletionItems(handle: number, id: number): void {
......@@ -1051,8 +1051,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideSignatureHelp(handle: number, resource: URI, position: IPosition): TPromise<modes.SignatureHelp> {
return this._withAdapter(handle, SignatureHelpAdapter, adapter => adapter.provideSignatureHelp(resource, position));
$provideSignatureHelp(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.SignatureHelp> {
return this._withAdapter(handle, SignatureHelpAdapter, adapter => adapter.provideSignatureHelp(URI.revive(resource), position));
}
// --- links
......@@ -1064,8 +1064,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> {
return this._withAdapter(handle, LinkProviderAdapter, adapter => adapter.provideLinks(resource));
$provideDocumentLinks(handle: number, resource: UriComponents): TPromise<modes.ILink[]> {
return this._withAdapter(handle, LinkProviderAdapter, adapter => adapter.provideLinks(URI.revive(resource)));
}
$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> {
......@@ -1079,12 +1079,12 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]> {
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColors(resource));
$provideDocumentColors(handle: number, resource: UriComponents): TPromise<IRawColorInfo[]> {
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColors(URI.revive(resource)));
}
$provideColorPresentations(handle: number, resource: URI, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColorPresentations(resource, colorInfo));
$provideColorPresentations(handle: number, resource: UriComponents, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColorPresentations(URI.revive(resource), colorInfo));
}
// --- configuration
......
......@@ -18,14 +18,23 @@ import { TernarySearchTree } from 'vs/base/common/map';
class Workspace2 extends Workspace {
static fromData(data: IWorkspaceData) {
return data ? new Workspace2(data) : null;
if (!data) {
return null;
} else {
const { id, name, folders } = data;
return new Workspace2(
id,
name,
folders.map(({ uri, name, index }) => new WorkspaceFolder({ name, index, uri: URI.revive(uri) }))
);
}
}
private readonly _workspaceFolders: vscode.WorkspaceFolder[] = [];
private readonly _structure = TernarySearchTree.forPaths<vscode.WorkspaceFolder>();
private constructor(data: IWorkspaceData) {
super(data.id, data.name, data.folders.map(folder => new WorkspaceFolder(folder)));
private constructor(id: string, name: string, folders: WorkspaceFolder[]) {
super(id, name, folders);
// setup the workspace folder data structure
this.folders.forEach(({ name, uri, index }) => {
......
......@@ -30,7 +30,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history';
export class OpenFileAction extends Action {
static ID = 'workbench.action.files.openFile';
static readonly ID = 'workbench.action.files.openFile';
static LABEL = nls.localize('openFile', "Open File...");
constructor(
......@@ -50,7 +50,7 @@ export class OpenFileAction extends Action {
export class OpenFolderAction extends Action {
static ID = 'workbench.action.files.openFolder';
static readonly ID = 'workbench.action.files.openFolder';
static LABEL = nls.localize('openFolder', "Open Folder...");
constructor(
......@@ -70,7 +70,7 @@ export class OpenFolderAction extends Action {
export class OpenFileFolderAction extends Action {
static ID = 'workbench.action.files.openFileFolder';
static readonly ID = 'workbench.action.files.openFileFolder';
static LABEL = nls.localize('openFileFolder', "Open...");
constructor(
......@@ -195,7 +195,7 @@ function isUntitledWorkspace(path: string, environmentService: IEnvironmentServi
export class AddRootFolderAction extends BaseWorkspacesAction {
static ID = 'workbench.action.addRootFolder';
static readonly ID = 'workbench.action.addRootFolder';
static LABEL = nls.localize('addFolderToWorkspace', "Add Folder to Workspace...");
constructor(
......@@ -225,7 +225,7 @@ export class AddRootFolderAction extends BaseWorkspacesAction {
export class GlobalRemoveRootFolderAction extends BaseWorkspacesAction {
static ID = 'workbench.action.removeRootFolder';
static readonly ID = 'workbench.action.removeRootFolder';
static LABEL = nls.localize('globalRemoveFolderFromWorkspace', "Remove Folder from Workspace...");
constructor(
......@@ -261,7 +261,7 @@ export class GlobalRemoveRootFolderAction extends BaseWorkspacesAction {
export class RemoveRootFolderAction extends Action {
static ID = 'workbench.action.removeRootFolder';
static readonly ID = 'workbench.action.removeRootFolder';
static LABEL = nls.localize('removeFolderFromWorkspace', "Remove Folder from Workspace");
constructor(
......@@ -280,7 +280,7 @@ export class RemoveRootFolderAction extends Action {
export class OpenFolderSettingsAction extends Action {
static ID = 'workbench.action.openFolderSettings';
static readonly ID = 'workbench.action.openFolderSettings';
static LABEL = nls.localize('openFolderSettings', "Open Folder Settings");
constructor(
......@@ -302,7 +302,7 @@ export class OpenFolderSettingsAction extends Action {
export class SaveWorkspaceAsAction extends BaseWorkspacesAction {
static ID = 'workbench.action.saveWorkspaceAs';
static readonly ID = 'workbench.action.saveWorkspaceAs';
static LABEL = nls.localize('saveWorkspaceAsAction', "Save Workspace As...");
constructor(
......@@ -347,7 +347,7 @@ export class SaveWorkspaceAsAction extends BaseWorkspacesAction {
export class OpenWorkspaceAction extends Action {
static ID = 'workbench.action.openWorkspace';
static readonly ID = 'workbench.action.openWorkspace';
static LABEL = nls.localize('openWorkspaceAction', "Open Workspace...");
constructor(
......
......@@ -765,7 +765,7 @@ function isWritableBaseEditor(e: IBaseEditor): boolean {
export class ShowLanguageExtensionsAction extends Action {
static ID = 'workbench.action.showLanguageExtensions';
static readonly ID = 'workbench.action.showLanguageExtensions';
constructor(
private fileExtension: string,
......@@ -885,7 +885,7 @@ export class ChangeModeAction extends Action {
picks.unshift(autoDetectMode);
}
return this.quickOpenService.pick(picks, { placeHolder: nls.localize('pickLanguage', "Select Language Mode") }).then(pick => {
return this.quickOpenService.pick(picks, { placeHolder: nls.localize('pickLanguage', "Select Language Mode"), matchOnDescription: true }).then(pick => {
if (!pick) {
return;
}
......
......@@ -18,7 +18,7 @@ import { ActivityAction } from 'vs/workbench/browser/parts/compositebar/composit
import { IActivity } from 'vs/workbench/common/activity';
export class ClosePanelAction extends Action {
static ID = 'workbench.action.closePanel';
static readonly ID = 'workbench.action.closePanel';
static LABEL = nls.localize('closePanel', "Close Panel");
constructor(
......@@ -35,7 +35,7 @@ export class ClosePanelAction extends Action {
}
export class TogglePanelAction extends Action {
static ID = 'workbench.action.togglePanel';
static readonly ID = 'workbench.action.togglePanel';
static LABEL = nls.localize('togglePanel', "Toggle Panel");
constructor(
......
......@@ -90,7 +90,7 @@ export class CloseCurrentWindowAction extends Action {
export class CloseWorkspaceAction extends Action {
static ID = 'workbench.action.closeFolder';
static readonly ID = 'workbench.action.closeFolder';
static LABEL = nls.localize('closeWorkspace', "Close Workspace");
constructor(
......@@ -116,7 +116,7 @@ export class CloseWorkspaceAction extends Action {
export class NewWindowAction extends Action {
static ID = 'workbench.action.newWindow';
static readonly ID = 'workbench.action.newWindow';
static LABEL = nls.localize('newWindow', "New Window");
constructor(
......@@ -134,7 +134,7 @@ export class NewWindowAction extends Action {
export class ToggleFullScreenAction extends Action {
static ID = 'workbench.action.toggleFullScreen';
static readonly ID = 'workbench.action.toggleFullScreen';
static LABEL = nls.localize('toggleFullScreen', "Toggle Full Screen");
constructor(id: string, label: string, @IWindowService private windowService: IWindowService) {
......@@ -148,7 +148,7 @@ export class ToggleFullScreenAction extends Action {
export class ToggleMenuBarAction extends Action {
static ID = 'workbench.action.toggleMenuBar';
static readonly ID = 'workbench.action.toggleMenuBar';
static LABEL = nls.localize('toggleMenuBar', "Toggle Menu Bar");
private static readonly menuBarVisibilityKey = 'window.menuBarVisibility';
......@@ -182,7 +182,7 @@ export class ToggleMenuBarAction extends Action {
export class ToggleDevToolsAction extends Action {
static ID = 'workbench.action.toggleDevTools';
static readonly ID = 'workbench.action.toggleDevTools';
static LABEL = nls.localize('toggleDevTools', "Toggle Developer Tools");
constructor(id: string, label: string, @IWindowService private windowsService: IWindowService) {
......@@ -557,7 +557,7 @@ export class ShowStartupPerformance extends Action {
export class ReloadWindowAction extends Action {
static ID = 'workbench.action.reloadWindow';
static readonly ID = 'workbench.action.reloadWindow';
static LABEL = nls.localize('reloadWindow', "Reload Window");
constructor(
......@@ -653,7 +653,7 @@ class CloseWindowAction extends Action implements IPickOpenAction {
export class SwitchWindow extends BaseSwitchWindow {
static ID = 'workbench.action.switchWindow';
static readonly ID = 'workbench.action.switchWindow';
static LABEL = nls.localize('switchWindow', "Switch Window...");
constructor(
......@@ -675,7 +675,7 @@ export class SwitchWindow extends BaseSwitchWindow {
export class QuickSwitchWindow extends BaseSwitchWindow {
static ID = 'workbench.action.quickSwitchWindow';
static readonly ID = 'workbench.action.quickSwitchWindow';
static LABEL = nls.localize('quickSwitchWindow', "Quick Switch Window...");
constructor(
......@@ -1188,7 +1188,7 @@ export class OpenTipsAndTricksUrlAction extends Action {
export class ToggleSharedProcessAction extends Action {
static ID = 'workbench.action.toggleSharedProcess';
static readonly ID = 'workbench.action.toggleSharedProcess';
static LABEL = nls.localize('toggleSharedProcess', "Toggle Shared Process");
constructor(id: string, label: string, @IWindowsService private windowsService: IWindowsService) {
......
......@@ -26,6 +26,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ILogService } from 'vs/platform/log/common/log';
import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc';
import { RPCProtocol } from 'vs/workbench/services/extensions/node/rpcProtocol';
import URI from 'vs/base/common/uri';
// const nativeExit = process.exit.bind(process);
function patchProcess(allowExit: boolean) {
......@@ -234,7 +235,7 @@ export class ExtensionHostMain {
// find exact path
for (const { uri } of this._workspace.folders) {
if (await pfs.exists(join(uri.fsPath, fileName))) {
if (await pfs.exists(join(URI.revive(uri).fsPath, fileName))) {
// the file was found
return (
this._extensionService.activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContains:${fileName}`))
......@@ -261,7 +262,7 @@ export class ExtensionHostMain {
includes[globPattern] = true;
});
const folderQueries = this._workspace.folders.map(folder => ({ folder: folder.uri }));
const folderQueries = this._workspace.folders.map(folder => ({ folder: URI.revive(folder.uri) }));
const config = this._extHostConfiguration.getConfiguration('search');
const useRipgrep = config.get('useRipgrep', true);
const followSymlinks = config.get('followSymlinks', true);
......
......@@ -30,7 +30,7 @@ function isAvailable(): TPromise<boolean> {
class InstallAction extends Action {
static ID = 'workbench.action.installCommandLine';
static readonly ID = 'workbench.action.installCommandLine';
static LABEL = nls.localize('install', "Install '{0}' command in PATH", product.applicationName);
constructor(
......@@ -111,7 +111,7 @@ class InstallAction extends Action {
class UninstallAction extends Action {
static ID = 'workbench.action.uninstallCommandLine';
static readonly ID = 'workbench.action.uninstallCommandLine';
static LABEL = nls.localize('uninstall', "Uninstall '{0}' command from PATH", product.applicationName);
constructor(
......
......@@ -71,7 +71,7 @@ export abstract class AbstractDebugAction extends Action {
}
export class ConfigureAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.configure';
static readonly ID = 'workbench.action.debug.configure';
static LABEL = nls.localize('openLaunchJson', "Open {0}", 'launch.json');
constructor(id: string, label: string,
......@@ -160,7 +160,7 @@ export class StartAction extends AbstractDebugAction {
}
export class RunAction extends StartAction {
static ID = 'workbench.action.debug.run';
static readonly ID = 'workbench.action.debug.run';
static LABEL = nls.localize('startWithoutDebugging', "Start Without Debugging");
protected isNoDebug(): boolean {
......@@ -169,7 +169,7 @@ export class RunAction extends StartAction {
}
export class SelectAndStartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.selectandstart';
static readonly ID = 'workbench.action.debug.selectandstart';
static LABEL = nls.localize('selectAndStartDebugging', "Select and Start Debugging");
constructor(id: string, label: string,
......@@ -190,7 +190,7 @@ export class SelectAndStartAction extends AbstractDebugAction {
}
export class RestartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.restart';
static readonly ID = 'workbench.action.debug.restart';
static LABEL = nls.localize('restartDebug', "Restart");
static RECONNECT_LABEL = nls.localize('reconnectDebug', "Reconnect");
......@@ -224,7 +224,7 @@ export class RestartAction extends AbstractDebugAction {
}
export class StepOverAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepOver';
static readonly ID = 'workbench.action.debug.stepOver';
static LABEL = nls.localize('stepOverDebug', "Step Over");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -245,7 +245,7 @@ export class StepOverAction extends AbstractDebugAction {
}
export class StepIntoAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepInto';
static readonly ID = 'workbench.action.debug.stepInto';
static LABEL = nls.localize('stepIntoDebug', "Step Into");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -266,7 +266,7 @@ export class StepIntoAction extends AbstractDebugAction {
}
export class StepOutAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepOut';
static readonly ID = 'workbench.action.debug.stepOut';
static LABEL = nls.localize('stepOutDebug', "Step Out");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -287,7 +287,7 @@ export class StepOutAction extends AbstractDebugAction {
}
export class StopAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stop';
static readonly ID = 'workbench.action.debug.stop';
static LABEL = nls.localize('stopDebug', "Stop");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -308,7 +308,7 @@ export class StopAction extends AbstractDebugAction {
}
export class DisconnectAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.disconnect';
static readonly ID = 'workbench.action.debug.disconnect';
static LABEL = nls.localize('disconnectDebug', "Disconnect");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -326,7 +326,7 @@ export class DisconnectAction extends AbstractDebugAction {
}
export class ContinueAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.continue';
static readonly ID = 'workbench.action.debug.continue';
static LABEL = nls.localize('continueDebug', "Continue");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -347,7 +347,7 @@ export class ContinueAction extends AbstractDebugAction {
}
export class PauseAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.pause';
static readonly ID = 'workbench.action.debug.pause';
static LABEL = nls.localize('pauseDebug', "Pause");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -368,7 +368,7 @@ export class PauseAction extends AbstractDebugAction {
}
export class RestartFrameAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.restartFrame';
static readonly ID = 'workbench.action.debug.restartFrame';
static LABEL = nls.localize('restartFrame', "Restart Frame");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -385,7 +385,7 @@ export class RestartFrameAction extends AbstractDebugAction {
}
export class RemoveBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeBreakpoint';
static readonly ID = 'workbench.debug.viewlet.action.removeBreakpoint';
static LABEL = nls.localize('removeBreakpoint', "Remove Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -399,7 +399,7 @@ export class RemoveBreakpointAction extends AbstractDebugAction {
}
export class RemoveAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeAllBreakpoints';
static readonly ID = 'workbench.debug.viewlet.action.removeAllBreakpoints';
static LABEL = nls.localize('removeAllBreakpoints', "Remove All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -418,7 +418,7 @@ export class RemoveAllBreakpointsAction extends AbstractDebugAction {
}
export class EnableBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.enableBreakpoint';
static readonly ID = 'workbench.debug.viewlet.action.enableBreakpoint';
static LABEL = nls.localize('enableBreakpoint', "Enable Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -431,7 +431,7 @@ export class EnableBreakpointAction extends AbstractDebugAction {
}
export class DisableBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.disableBreakpoint';
static readonly ID = 'workbench.debug.viewlet.action.disableBreakpoint';
static LABEL = nls.localize('disableBreakpoint', "Disable Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -444,7 +444,7 @@ export class DisableBreakpointAction extends AbstractDebugAction {
}
export class EnableAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.enableAllBreakpoints';
static readonly ID = 'workbench.debug.viewlet.action.enableAllBreakpoints';
static LABEL = nls.localize('enableAllBreakpoints', "Enable All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -463,7 +463,7 @@ export class EnableAllBreakpointsAction extends AbstractDebugAction {
}
export class DisableAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.disableAllBreakpoints';
static readonly ID = 'workbench.debug.viewlet.action.disableAllBreakpoints';
static LABEL = nls.localize('disableAllBreakpoints', "Disable All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -482,7 +482,7 @@ export class DisableAllBreakpointsAction extends AbstractDebugAction {
}
export class ToggleBreakpointsActivatedAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.toggleBreakpointsActivatedAction';
static readonly ID = 'workbench.debug.viewlet.action.toggleBreakpointsActivatedAction';
static ACTIVATE_LABEL = nls.localize('activateBreakpoints', "Activate Breakpoints");
static DEACTIVATE_LABEL = nls.localize('deactivateBreakpoints', "Deactivate Breakpoints");
......@@ -506,7 +506,7 @@ export class ToggleBreakpointsActivatedAction extends AbstractDebugAction {
}
export class ReapplyBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.reapplyBreakpointsAction';
static readonly ID = 'workbench.debug.viewlet.action.reapplyBreakpointsAction';
static LABEL = nls.localize('reapplyAllBreakpoints', "Reapply All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -526,7 +526,7 @@ export class ReapplyBreakpointsAction extends AbstractDebugAction {
}
export class AddFunctionBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addFunctionBreakpointAction';
static readonly ID = 'workbench.debug.viewlet.action.addFunctionBreakpointAction';
static LABEL = nls.localize('addFunctionBreakpoint', "Add Function Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -546,7 +546,7 @@ export class AddFunctionBreakpointAction extends AbstractDebugAction {
}
export class AddConditionalBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addConditionalBreakpointAction';
static readonly ID = 'workbench.debug.viewlet.action.addConditionalBreakpointAction';
static LABEL = nls.localize('addConditionalBreakpoint', "Add Conditional Breakpoint...");
constructor(id: string, label: string,
......@@ -565,7 +565,7 @@ export class AddConditionalBreakpointAction extends AbstractDebugAction {
}
export class EditConditionalBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.editConditionalBreakpointAction';
static readonly ID = 'workbench.debug.viewlet.action.editConditionalBreakpointAction';
static LABEL = nls.localize('editConditionalBreakpoint', "Edit Breakpoint...");
constructor(id: string, label: string,
......@@ -584,7 +584,7 @@ export class EditConditionalBreakpointAction extends AbstractDebugAction {
export class SetValueAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.setValue';
static readonly ID = 'workbench.debug.viewlet.action.setValue';
static LABEL = nls.localize('setValue', "Set Value");
constructor(id: string, label: string, private variable: Variable, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -607,7 +607,7 @@ export class SetValueAction extends AbstractDebugAction {
export class AddWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addWatchExpression';
static readonly ID = 'workbench.debug.viewlet.action.addWatchExpression';
static LABEL = nls.localize('addWatchExpression', "Add Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -626,7 +626,7 @@ export class AddWatchExpressionAction extends AbstractDebugAction {
}
export class EditWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.editWatchExpression';
static readonly ID = 'workbench.debug.viewlet.action.editWatchExpression';
static LABEL = nls.localize('editWatchExpression', "Edit Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -640,7 +640,7 @@ export class EditWatchExpressionAction extends AbstractDebugAction {
}
export class AddToWatchExpressionsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addToWatchExpressions';
static readonly ID = 'workbench.debug.viewlet.action.addToWatchExpressions';
static LABEL = nls.localize('addToWatchExpressions', "Add to Watch");
constructor(id: string, label: string, private expression: IExpression, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -656,7 +656,7 @@ export class AddToWatchExpressionsAction extends AbstractDebugAction {
}
export class RemoveWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeWatchExpression';
static readonly ID = 'workbench.debug.viewlet.action.removeWatchExpression';
static LABEL = nls.localize('removeWatchExpression', "Remove Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -670,7 +670,7 @@ export class RemoveWatchExpressionAction extends AbstractDebugAction {
}
export class RemoveAllWatchExpressionsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeAllWatchExpressions';
static readonly ID = 'workbench.debug.viewlet.action.removeAllWatchExpressions';
static LABEL = nls.localize('removeAllWatchExpressions', "Remove All Expressions");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -689,7 +689,7 @@ export class RemoveAllWatchExpressionsAction extends AbstractDebugAction {
}
export class ClearReplAction extends AbstractDebugAction {
static ID = 'workbench.debug.panel.action.clearReplAction';
static readonly ID = 'workbench.debug.panel.action.clearReplAction';
static LABEL = nls.localize('clearRepl', "Clear Console");
constructor(id: string, label: string,
......@@ -709,7 +709,7 @@ export class ClearReplAction extends AbstractDebugAction {
}
export class ToggleReplAction extends TogglePanelAction {
static ID = 'workbench.debug.action.toggleRepl';
static readonly ID = 'workbench.debug.action.toggleRepl';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugConsoleAction' }, 'Debug Console');
private toDispose: lifecycle.IDisposable[];
......@@ -751,7 +751,7 @@ export class ToggleReplAction extends TogglePanelAction {
export class FocusReplAction extends Action {
static ID = 'workbench.debug.action.focusRepl';
static readonly ID = 'workbench.debug.action.focusRepl';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugFocusConsole' }, 'Focus Debug Console');
......@@ -767,7 +767,7 @@ export class FocusReplAction extends Action {
}
export class FocusProcessAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.focusProcess';
static readonly ID = 'workbench.action.debug.focusProcess';
static LABEL = nls.localize('focusProcess', "Focus Process");
constructor(id: string, label: string,
......@@ -793,7 +793,7 @@ export class FocusProcessAction extends AbstractDebugAction {
// Actions used by the chakra debugger
export class StepBackAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepBack';
static readonly ID = 'workbench.action.debug.stepBack';
static LABEL = nls.localize('stepBackDebug', "Step Back");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......@@ -816,7 +816,7 @@ export class StepBackAction extends AbstractDebugAction {
}
export class ReverseContinueAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.reverseContinue';
static readonly ID = 'workbench.action.debug.reverseContinue';
static LABEL = nls.localize('reverseContinue', "Reverse");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
......
......@@ -32,7 +32,7 @@ interface IDebugEditorModelData {
const stickiness = TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
export class DebugEditorModelManager implements IWorkbenchContribution {
static ID = 'breakpointManager';
static readonly ID = 'breakpointManager';
private modelDataMap: Map<string, IDebugEditorModelData>;
private toDispose: lifecycle.IDisposable[];
......
......@@ -138,7 +138,7 @@ export class DebugViewlet extends PersistentViewsViewlet {
export class FocusVariablesViewAction extends Action {
static ID = 'workbench.debug.action.focusVariablesView';
static readonly ID = 'workbench.debug.action.focusVariablesView';
static LABEL = nls.localize('debugFocusVariablesView', 'Focus Variables');
constructor(id: string, label: string,
......@@ -156,7 +156,7 @@ export class FocusVariablesViewAction extends Action {
export class FocusWatchViewAction extends Action {
static ID = 'workbench.debug.action.focusWatchView';
static readonly ID = 'workbench.debug.action.focusWatchView';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugFocusWatchView' }, 'Focus Watch');
constructor(id: string, label: string,
......@@ -174,7 +174,7 @@ export class FocusWatchViewAction extends Action {
export class FocusCallStackViewAction extends Action {
static ID = 'workbench.debug.action.focusCallStackView';
static readonly ID = 'workbench.debug.action.focusCallStackView';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugFocusCallStackView' }, 'Focus CallStack');
constructor(id: string, label: string,
......@@ -192,7 +192,7 @@ export class FocusCallStackViewAction extends Action {
export class FocusBreakpointsViewAction extends Action {
static ID = 'workbench.debug.action.focusBreakpointsView';
static readonly ID = 'workbench.debug.action.focusBreakpointsView';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugFocusBreakpointsView' }, 'Focus Breakpoints');
constructor(id: string, label: string,
......
......@@ -267,7 +267,7 @@ class BreakpointsRenderer implements IRenderer<IBreakpoint, IBreakpointTemplateD
// noop
}
static ID = 'breakpoints';
static readonly ID = 'breakpoints';
get templateId() {
return BreakpointsRenderer.ID;
......@@ -331,7 +331,7 @@ class ExceptionBreakpointsRenderer implements IRenderer<IExceptionBreakpoint, IB
// noop
}
static ID = 'exceptionbreakpoints';
static readonly ID = 'exceptionbreakpoints';
get templateId() {
return ExceptionBreakpointsRenderer.ID;
......@@ -376,7 +376,7 @@ class FunctionBreakpointsRenderer implements IRenderer<IFunctionBreakpoint, IBas
// noop
}
static ID = 'functionbreakpoints';
static readonly ID = 'functionbreakpoints';
get templateId() {
return FunctionBreakpointsRenderer.ID;
......@@ -429,7 +429,7 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
// noop
}
static ID = 'functionbreakpointinput';
static readonly ID = 'functionbreakpointinput';
get templateId() {
return FunctionBreakpointInputRenderer.ID;
......
......@@ -13,7 +13,7 @@ import { IDebugService, IStackFrame } from 'vs/workbench/parts/debug/common/debu
import { clipboard } from 'electron';
export class CopyValueAction extends Action {
static ID = 'workbench.debug.viewlet.action.copyValue';
static readonly ID = 'workbench.debug.viewlet.action.copyValue';
static LABEL = nls.localize('copyValue', "Copy Value");
constructor(id: string, label: string, private value: any, @IDebugService private debugService: IDebugService) {
......@@ -35,7 +35,7 @@ export class CopyValueAction extends Action {
}
export class CopyAction extends Action {
static ID = 'workbench.debug.action.copy';
static readonly ID = 'workbench.debug.action.copy';
static LABEL = nls.localize('copy', "Copy");
public run(): TPromise<any> {
......@@ -45,7 +45,7 @@ export class CopyAction extends Action {
}
export class CopyAllAction extends Action {
static ID = 'workbench.debug.action.copyAll';
static readonly ID = 'workbench.debug.action.copyAll';
static LABEL = nls.localize('copyAll', "Copy All");
constructor(id: string, label: string, private tree: ITree) {
......@@ -69,7 +69,7 @@ export class CopyAllAction extends Action {
}
export class CopyStackTraceAction extends Action {
static ID = 'workbench.action.debug.copyStackTrace';
static readonly ID = 'workbench.action.debug.copyStackTrace';
static LABEL = nls.localize('copyStackTrace', "Copy Call Stack");
public run(frame: IStackFrame): TPromise<any> {
......
......@@ -350,7 +350,7 @@ export class DropDownMenuActionItem extends ActionItem {
export class ManageExtensionAction extends Action {
static ID = 'extensions.manage';
static readonly ID = 'extensions.manage';
private static readonly Class = 'extension-action manage';
private static readonly HideManageExtensionClass = `${ManageExtensionAction.Class} hide`;
......@@ -413,7 +413,7 @@ export class ManageExtensionAction extends Action {
export class EnableForWorkspaceAction extends Action implements IExtensionAction {
static ID = 'extensions.enableForWorkspace';
static readonly ID = 'extensions.enableForWorkspace';
static LABEL = localize('enableForWorkspaceAction', "Enable (Workspace)");
private disposables: IDisposable[] = [];
......@@ -453,7 +453,7 @@ export class EnableForWorkspaceAction extends Action implements IExtensionAction
export class EnableGloballyAction extends Action implements IExtensionAction {
static ID = 'extensions.enableGlobally';
static readonly ID = 'extensions.enableGlobally';
static LABEL = localize('enableGloballyAction', "Enable");
private disposables: IDisposable[] = [];
......@@ -491,7 +491,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction {
export class EnableAction extends Action {
static ID = 'extensions.enable';
static readonly ID = 'extensions.enable';
private static readonly EnabledClass = 'extension-action prominent enable';
private static readonly DisabledClass = `${EnableAction.EnabledClass} disabled`;
......@@ -549,7 +549,7 @@ export class EnableAction extends Action {
export class DisableForWorkspaceAction extends Action implements IExtensionAction {
static ID = 'extensions.disableForWorkspace';
static readonly ID = 'extensions.disableForWorkspace';
static LABEL = localize('disableForWorkspaceAction', "Disable (Workspace)");
private disposables: IDisposable[] = [];
......@@ -588,7 +588,7 @@ export class DisableForWorkspaceAction extends Action implements IExtensionActio
export class DisableGloballyAction extends Action implements IExtensionAction {
static ID = 'extensions.disableGlobally';
static readonly ID = 'extensions.disableGlobally';
static LABEL = localize('disableGloballyAction', "Disable");
private disposables: IDisposable[] = [];
......@@ -625,7 +625,7 @@ export class DisableGloballyAction extends Action implements IExtensionAction {
export class DisableAction extends Action {
static ID = 'extensions.disable';
static readonly ID = 'extensions.disable';
private static readonly EnabledClass = 'extension-action disable';
private static readonly DisabledClass = `${DisableAction.EnabledClass} disabled`;
......@@ -680,7 +680,7 @@ export class DisableAction extends Action {
export class CheckForUpdatesAction extends Action {
static ID = 'workbench.extensions.action.checkForUpdates';
static readonly ID = 'workbench.extensions.action.checkForUpdates';
static LABEL = localize('checkForUpdates', "Check for Updates");
constructor(
......@@ -720,7 +720,7 @@ export class ToggleAutoUpdateAction extends Action {
export class EnableAutoUpdateAction extends ToggleAutoUpdateAction {
static ID = 'workbench.extensions.action.enableAutoUpdate';
static readonly ID = 'workbench.extensions.action.enableAutoUpdate';
static LABEL = localize('enableAutoUpdate', "Enable Auto Updating Extensions");
constructor(
......@@ -734,7 +734,7 @@ export class EnableAutoUpdateAction extends ToggleAutoUpdateAction {
export class DisableAutoUpdateAction extends ToggleAutoUpdateAction {
static ID = 'workbench.extensions.action.disableAutoUpdate';
static readonly ID = 'workbench.extensions.action.disableAutoUpdate';
static LABEL = localize('disableAutoUpdate', "Disable Auto Updating Extensions");
constructor(
......@@ -748,7 +748,7 @@ export class DisableAutoUpdateAction extends ToggleAutoUpdateAction {
export class UpdateAllAction extends Action {
static ID = 'workbench.extensions.action.updateAllExtensions';
static readonly ID = 'workbench.extensions.action.updateAllExtensions';
static LABEL = localize('updateAll', "Update All Extensions");
private disposables: IDisposable[] = [];
......@@ -899,7 +899,7 @@ export class InstallExtensionsAction extends OpenExtensionsViewletAction {
export class ShowEnabledExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showEnabledExtensions';
static readonly ID = 'workbench.extensions.action.showEnabledExtensions';
static LABEL = localize('showEnabledExtensions', 'Show Enabled Extensions');
constructor(
......@@ -922,7 +922,7 @@ export class ShowEnabledExtensionsAction extends Action {
export class ShowInstalledExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showInstalledExtensions';
static readonly ID = 'workbench.extensions.action.showInstalledExtensions';
static LABEL = localize('showInstalledExtensions', "Show Installed Extensions");
constructor(
......@@ -945,7 +945,7 @@ export class ShowInstalledExtensionsAction extends Action {
export class ShowDisabledExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showDisabledExtensions';
static readonly ID = 'workbench.extensions.action.showDisabledExtensions';
static LABEL = localize('showDisabledExtensions', "Show Disabled Extensions");
constructor(
......@@ -968,7 +968,7 @@ export class ShowDisabledExtensionsAction extends Action {
export class ClearExtensionsInputAction extends Action {
static ID = 'workbench.extensions.action.clearExtensionsInput';
static readonly ID = 'workbench.extensions.action.clearExtensionsInput';
static LABEL = localize('clearExtensionsInput', "Clear Extensions Input");
private disposables: IDisposable[] = [];
......@@ -1004,7 +1004,7 @@ export class ClearExtensionsInputAction extends Action {
export class ShowOutdatedExtensionsAction extends Action {
static ID = 'workbench.extensions.action.listOutdatedExtensions';
static readonly ID = 'workbench.extensions.action.listOutdatedExtensions';
static LABEL = localize('showOutdatedExtensions', "Show Outdated Extensions");
constructor(
......@@ -1027,7 +1027,7 @@ export class ShowOutdatedExtensionsAction extends Action {
export class ShowPopularExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showPopularExtensions';
static readonly ID = 'workbench.extensions.action.showPopularExtensions';
static LABEL = localize('showPopularExtensions', "Show Popular Extensions");
constructor(
......@@ -1050,7 +1050,7 @@ export class ShowPopularExtensionsAction extends Action {
export class ShowRecommendedExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showRecommendedExtensions';
static readonly ID = 'workbench.extensions.action.showRecommendedExtensions';
static LABEL = localize('showRecommendedExtensions', "Show Recommended Extensions");
constructor(
......@@ -1073,7 +1073,7 @@ export class ShowRecommendedExtensionsAction extends Action {
export class InstallWorkspaceRecommendedExtensionsAction extends Action {
static ID = 'workbench.extensions.action.installWorkspaceRecommendedExtensions';
static readonly ID = 'workbench.extensions.action.installWorkspaceRecommendedExtensions';
static LABEL = localize('installWorkspaceRecommendedExtensions', "Install All Workspace Recommended Extensions");
private disposables: IDisposable[] = [];
......@@ -1150,7 +1150,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
export class InstallRecommendedExtensionAction extends Action {
static ID = 'workbench.extensions.action.installRecommendedExtension';
static readonly ID = 'workbench.extensions.action.installRecommendedExtension';
static LABEL = localize('installRecommendedExtension', "Install Recommended Extension");
private extensionId: string;
......@@ -1200,7 +1200,7 @@ export class InstallRecommendedExtensionAction extends Action {
export class ShowRecommendedKeymapExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showRecommendedKeymapExtensions';
static readonly ID = 'workbench.extensions.action.showRecommendedKeymapExtensions';
static SHORT_LABEL = localize('showRecommendedKeymapExtensionsShort', "Keymaps");
constructor(
......@@ -1223,7 +1223,7 @@ export class ShowRecommendedKeymapExtensionsAction extends Action {
export class ShowLanguageExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showLanguageExtensions';
static readonly ID = 'workbench.extensions.action.showLanguageExtensions';
static SHORT_LABEL = localize('showLanguageExtensionsShort', "Language Extensions");
constructor(
......@@ -1246,7 +1246,7 @@ export class ShowLanguageExtensionsAction extends Action {
export class ShowAzureExtensionsAction extends Action {
static ID = 'workbench.extensions.action.showAzureExtensions';
static readonly ID = 'workbench.extensions.action.showAzureExtensions';
static SHORT_LABEL = localize('showAzureExtensionsShort', "Azure Extensions");
constructor(
......@@ -1445,7 +1445,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio
export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
static ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions';
static readonly ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions';
static LABEL = localize('configureWorkspaceRecommendedExtensions', "Configure Recommended Extensions (Workspace)");
private disposables: IDisposable[] = [];
......@@ -1486,7 +1486,7 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi
export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
static ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions';
static readonly ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions';
static LABEL = localize('configureWorkspaceFolderRecommendedExtensions', "Configure Recommended Extensions (Workspace Folder)");
private disposables: IDisposable[] = [];
......@@ -1555,7 +1555,7 @@ export class BuiltinStatusLabelAction extends Action {
export class DisableAllAction extends Action {
static ID = 'workbench.extensions.action.disableAll';
static readonly ID = 'workbench.extensions.action.disableAll';
static LABEL = localize('disableAll', "Disable All Installed Extensions");
private disposables: IDisposable[] = [];
......@@ -1585,7 +1585,7 @@ export class DisableAllAction extends Action {
export class DisableAllWorkpsaceAction extends Action {
static ID = 'workbench.extensions.action.disableAllWorkspace';
static readonly ID = 'workbench.extensions.action.disableAllWorkspace';
static LABEL = localize('disableAllWorkspace', "Disable All Installed Extensions for this Workspace");
private disposables: IDisposable[] = [];
......@@ -1617,7 +1617,7 @@ export class DisableAllWorkpsaceAction extends Action {
export class EnableAllAction extends Action {
static ID = 'workbench.extensions.action.enableAll';
static readonly ID = 'workbench.extensions.action.enableAll';
static LABEL = localize('enableAll', "Enable All Installed Extensions");
private disposables: IDisposable[] = [];
......@@ -1648,7 +1648,7 @@ export class EnableAllAction extends Action {
export class EnableAllWorkpsaceAction extends Action {
static ID = 'workbench.extensions.action.enableAllWorkspace';
static readonly ID = 'workbench.extensions.action.enableAllWorkspace';
static LABEL = localize('enableAllWorkspace', "Enable All Installed Extensions for this Workspace");
private disposables: IDisposable[] = [];
......
......@@ -13,7 +13,7 @@ import URI from 'vs/base/common/uri';
export class ExtensionsInput extends EditorInput {
static get ID() { return 'workbench.extensions.input2'; }
static readonly ID = 'workbench.extensions.input2';
get extension(): IExtension { return this._extension; }
constructor(private _extension: IExtension) {
......
......@@ -44,9 +44,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
private _fileBasedRecommendations: { [id: string]: number; } = Object.create(null);
private _exeBasedRecommendations: { [id: string]: string; } = Object.create(null);
private _availableRecommendations: { [pattern: string]: string[] } = Object.create(null);
private importantRecommendations: { [id: string]: { name: string; pattern: string; } } = Object.create(null);
private importantRecommendationsIgnoreList: string[];
private _allRecommendations: string[] = [];
private _disposables: IDisposable[] = [];
private _allWorkspaceRecommendedExtensions: string[] = [];
......@@ -71,8 +68,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
return;
}
this._suggestTips();
this._suggestFileBasedRecommendations();
this._suggestWorkspaceRecommendations();
// Executable based recommendations carry out a lot of file stats, so run them after 10 secs
......@@ -138,7 +134,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
const fileBased = Object.keys(this._fileBasedRecommendations)
.sort((a, b) => {
if (this._fileBasedRecommendations[a] === this._fileBasedRecommendations[b]) {
if (product.extensionImportantTips[a]) {
if (!product.extensionImportantTips || product.extensionImportantTips[a]) {
return -1;
}
if (product.extensionImportantTips[b]) {
......@@ -154,19 +150,15 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
return Object.keys(this._exeBasedRecommendations);
}
getKeymapRecommendations(): string[] {
return product.keymapExtensionTips || [];
}
private _suggestTips() {
private _suggestFileBasedRecommendations() {
const extensionTips = product.extensionTips;
if (!extensionTips) {
return;
}
this.importantRecommendations = product.extensionImportantTips || Object.create(null);
this.importantRecommendationsIgnoreList = <string[]>JSON.parse(this.storageService.get('extensionsAssistant/importantRecommendationsIgnore', StorageScope.GLOBAL, '[]'));
// group ids by pattern, like {**/*.md} -> [ext.foo1, ext.bar2]
this._availableRecommendations = Object.create(null);
......@@ -191,8 +183,9 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
}
});
const allRecommendations = [];
forEach(this._availableRecommendations, ({ value: ids }) => {
this._allRecommendations.push(...ids);
allRecommendations.push(...ids);
});
// retrieve ids of previous recommendations
......@@ -200,7 +193,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
if (Array.isArray<string>(storedRecommendationsJson)) {
for (let id of <string[]>storedRecommendationsJson) {
if (this._allRecommendations.indexOf(id) > -1) {
if (allRecommendations.indexOf(id) > -1) {
this._fileBasedRecommendations[id] = Date.now();
}
}
......@@ -209,7 +202,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
forEach(storedRecommendationsJson, entry => {
if (typeof entry.value === 'number') {
const diff = (now - entry.value) / milliSecondsInADay;
if (diff <= 7 && this._allRecommendations.indexOf(entry.key) > -1) {
if (diff <= 7 && allRecommendations.indexOf(entry.key) > -1) {
this._fileBasedRecommendations[entry.key] = entry.value;
}
}
......@@ -248,17 +241,18 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
);
const config = this.configurationService.getValue<IExtensionsConfiguration>(ConfigurationKey);
const importantRecommendationsIgnoreList = <string[]>JSON.parse(this.storageService.get('extensionsAssistant/importantRecommendationsIgnore', StorageScope.GLOBAL, '[]'));
if (config.ignoreRecommendations) {
if (config.ignoreRecommendations || !product.extensionImportantTips) {
return;
}
this.extensionsService.getInstalled(LocalExtensionType.User).done(local => {
Object.keys(this.importantRecommendations)
.filter(id => this.importantRecommendationsIgnoreList.indexOf(id) === -1)
Object.keys(product.extensionImportantTips)
.filter(id => importantRecommendationsIgnoreList.indexOf(id) === -1)
.filter(id => local.every(local => `${local.manifest.publisher}.${local.manifest.name}` !== id))
.forEach(id => {
const { pattern, name } = this.importantRecommendations[id];
const { pattern, name } = product.extensionImportantTips[id];
if (!match(pattern, uri.fsPath)) {
return;
......@@ -299,10 +293,10 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
*/
this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'show', extensionId: name });
return recommendationsAction.run();
case 2: this.importantRecommendationsIgnoreList.push(id);
case 2: importantRecommendationsIgnoreList.push(id);
this.storageService.store(
'extensionsAssistant/importantRecommendationsIgnore',
JSON.stringify(this.importantRecommendationsIgnoreList),
JSON.stringify(importantRecommendationsIgnoreList),
StorageScope.GLOBAL
);
/* __GDPR__
......
......@@ -20,7 +20,7 @@ import { mnemonicButtonLabel } from 'vs/base/common/labels';
export class OpenExtensionsFolderAction extends Action {
static ID = 'workbench.extensions.action.openExtensionsFolder';
static readonly ID = 'workbench.extensions.action.openExtensionsFolder';
static LABEL = localize('openExtensionsFolder', "Open Extensions Folder");
constructor(
......@@ -51,7 +51,7 @@ export class OpenExtensionsFolderAction extends Action {
export class InstallVSIXAction extends Action {
static ID = 'workbench.extensions.action.installVSIX';
static readonly ID = 'workbench.extensions.action.installVSIX';
static LABEL = localize('installVSIX', "Install from VSIX...");
constructor(
......
......@@ -413,7 +413,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
export class RuntimeExtensionsInput extends EditorInput {
static ID = 'workbench.runtimeExtensions.input';
static readonly ID = 'workbench.runtimeExtensions.input';
constructor() {
super();
......@@ -451,7 +451,7 @@ export class RuntimeExtensionsInput extends EditorInput {
}
export class ShowRuntimeExtensionsAction extends Action {
static ID = 'workbench.action.showRuntimeExtensions';
static readonly ID = 'workbench.action.showRuntimeExtensions';
static LABEL = nls.localize('showRuntimeExtensions', "Show Running Extensions");
constructor(
......@@ -468,7 +468,7 @@ export class ShowRuntimeExtensionsAction extends Action {
}
class ReportExtensionIssueAction extends Action {
static ID = 'workbench.extensions.action.reportExtensionIssue';
static readonly ID = 'workbench.extensions.action.reportExtensionIssue';
static LABEL = nls.localize('reportExtensionIssue', "Report Issue");
constructor(
......@@ -506,7 +506,7 @@ class ReportExtensionIssueAction extends Action {
}
class ExtensionHostProfileAction extends Action {
static ID = 'workbench.extensions.action.extensionHostProfile';
static readonly ID = 'workbench.extensions.action.extensionHostProfile';
static LABEL_START = nls.localize('extensionHostProfileStart', "Start Extension Host Profile");
static LABEL_STOP = nls.localize('extensionHostProfileStop', "Stop Extension Host Profile");
static STOP_CSS_CLASS = 'extension-host-profile-stop';
......@@ -549,7 +549,7 @@ class ExtensionHostProfileAction extends Action {
class SaveExtensionHostProfileAction extends Action {
static LABEL = nls.localize('saveExtensionHostProfile', "Save Extension Host Profile");
static ID = 'workbench.extensions.action.saveExtensionHostProfile';
static readonly ID = 'workbench.extensions.action.saveExtensionHostProfile';
constructor(
id: string = SaveExtensionHostProfileAction.ID, label: string = SaveExtensionHostProfileAction.LABEL,
......
......@@ -47,7 +47,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
private static readonly DEFAULT_VISIBLE_OPEN_EDITORS = 9;
private static readonly DEFAULT_DYNAMIC_HEIGHT = true;
static ID = 'workbench.explorer.openEditorsView';
static readonly ID = 'workbench.explorer.openEditorsView';
static NAME = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors");
private model: IEditorStacksModel;
......@@ -413,7 +413,7 @@ class OpenEditorsDelegate implements IDelegate<OpenEditor | IEditorGroup> {
}
class EditorGroupRenderer implements IRenderer<IEditorGroup, IEditorGroupTemplateData> {
static ID = 'editorgroup';
static readonly ID = 'editorgroup';
constructor(
private keybindingService: IKeybindingService,
......@@ -478,7 +478,7 @@ class EditorGroupRenderer implements IRenderer<IEditorGroup, IEditorGroupTemplat
}
class OpenEditorRenderer implements IRenderer<OpenEditor, IOpenEditorTemplateData> {
static ID = 'openeditor';
static readonly ID = 'openeditor';
public static DRAGGED_OPEN_EDITOR: OpenEditor;
constructor(
......
......@@ -356,7 +356,7 @@ export class KeybindingEditorDecorationsRenderer extends Disposable {
class DefineKeybindingCommand extends EditorCommand {
static ID = 'editor.action.defineKeybinding';
static readonly ID = 'editor.action.defineKeybinding';
constructor() {
super({
......
......@@ -23,7 +23,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
class OpenSCMViewletAction extends ToggleViewletAction {
static ID = VIEWLET_ID;
static readonly ID = VIEWLET_ID;
static LABEL = localize('toggleGitViewlet', "Show Git");
constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) {
......
......@@ -28,7 +28,7 @@ import { LIGHT, DARK, HIGH_CONTRAST } from 'vs/platform/theme/common/themeServic
export class SelectColorThemeAction extends Action {
static ID = 'workbench.action.selectTheme';
static readonly ID = 'workbench.action.selectTheme';
static LABEL = localize('selectTheme.label', "Color Theme");
constructor(
......@@ -87,7 +87,7 @@ export class SelectColorThemeAction extends Action {
class SelectIconThemeAction extends Action {
static ID = 'workbench.action.selectIconTheme';
static readonly ID = 'workbench.action.selectIconTheme';
static LABEL = localize('selectIconTheme.label', "File Icon Theme");
constructor(
......@@ -171,7 +171,7 @@ function toEntries(themes: (IColorTheme | IFileIconTheme)[], label?: string, bor
class GenerateColorThemeAction extends Action {
static ID = 'workbench.action.generateColorTheme';
static readonly ID = 'workbench.action.generateColorTheme';
static LABEL = localize('generateColorTheme.label', "Generate Color Theme From Current Settings");
constructor(
......
......@@ -12,7 +12,7 @@ import URI from 'vs/base/common/uri';
export class ReleaseNotesInput extends EditorInput {
static get ID() { return 'workbench.releaseNotes.input'; }
static readonly ID = 'workbench.releaseNotes.input';
get version(): string { return this._version; }
get text(): string { return this._text; }
......
......@@ -165,7 +165,7 @@ export class ShowReleaseNotesAction extends AbstractShowReleaseNotesAction {
export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesAction {
static ID = 'update.showCurrentReleaseNotes';
static readonly ID = 'update.showCurrentReleaseNotes';
static LABEL = nls.localize('showReleaseNotes', "Show Release Notes");
constructor(
......
......@@ -585,7 +585,7 @@ function stripVersion(id: string): string {
export class WelcomeInputFactory implements IEditorInputFactory {
static ID = welcomeInputTypeId;
static readonly ID = welcomeInputTypeId;
public serialize(editorInput: EditorInput): string {
return '{}';
......
......@@ -47,7 +47,7 @@ export class EditorWalkThroughAction extends Action {
export class EditorWalkThroughInputFactory implements IEditorInputFactory {
static ID = typeId;
static readonly ID = typeId;
public serialize(editorInput: EditorInput): string {
return '{}';
......
......@@ -104,7 +104,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
isDirty: false,
versionId: model.getVersionId(),
modeId: model.getLanguageIdentifier().language,
url: model.uri,
uri: model.uri,
lines: model.getValue().split(model.getEOL()),
EOL: model.getEOL(),
}]
......
......@@ -42,7 +42,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
addedDocuments: [{
isDirty: false,
modeId: 'foo',
url: resource,
uri: resource,
versionId: 1,
lines: ['foo'],
EOL: '\n',
......
......@@ -28,7 +28,7 @@ suite('ExtHostDocumentsAndEditors', () => {
EOL: '\n',
isDirty: true,
modeId: 'fooLang',
url: URI.parse('foo:bar'),
uri: URI.parse('foo:bar'),
versionId: 1,
lines: [
'first',
......
......@@ -93,7 +93,7 @@ suite('ExtHostLanguageFeatures', function () {
isDirty: false,
versionId: model.getVersionId(),
modeId: model.getLanguageIdentifier().language,
url: model.uri,
uri: model.uri,
lines: model.getValue().split(model.getEOL()),
EOL: model.getEOL(),
}]
......
......@@ -35,7 +35,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
addedDocuments: [{
isDirty: false,
modeId: 'foo',
url: resource,
uri: resource,
versionId: 1337,
lines: ['foo'],
EOL: '\n',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册