mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
workbench api linting
This commit is contained in:
@@ -16,7 +16,7 @@ import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindi
|
||||
import {ExtHostCommands} from 'vs/workbench/api/common/extHostCommands';
|
||||
import {IQuickFix2} from 'vs/editor/contrib/quickFix/common/quickFix';
|
||||
import {IOutline} from 'vs/editor/contrib/quickOpen/common/quickOpen';
|
||||
import {ITypeBearing} from 'vs/workbench/parts/search/common/search'
|
||||
import {ITypeBearing} from 'vs/workbench/parts/search/common/search';
|
||||
import {ICodeLensData} from 'vs/editor/contrib/codelens/common/codelens';
|
||||
|
||||
export class ExtHostApiCommands {
|
||||
@@ -169,7 +169,7 @@ export class ExtHostApiCommands {
|
||||
};
|
||||
return this._commands.executeCommand<modes.IReference[]>('_executeDefinitionProvider', args).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(typeConverters.toLocation)
|
||||
return value.map(typeConverters.toLocation);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -181,7 +181,7 @@ export class ExtHostApiCommands {
|
||||
};
|
||||
return this._commands.executeCommand<modes.IComputeExtraInfoResult[]>('_executeHoverProvider', args).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(typeConverters.toHover)
|
||||
return value.map(typeConverters.toHover);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export class ExtHostApiCommands {
|
||||
};
|
||||
return this._commands.executeCommand<modes.IOccurence[]>('_executeDocumentHighlights', args).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(typeConverters.toDocumentHighlight)
|
||||
return value.map(typeConverters.toDocumentHighlight);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -205,7 +205,7 @@ export class ExtHostApiCommands {
|
||||
};
|
||||
return this._commands.executeCommand<modes.IReference[]>('_executeDocumentHighlights', args).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(typeConverters.toLocation)
|
||||
return value.map(typeConverters.toLocation);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,18 +5,11 @@
|
||||
'use strict';
|
||||
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {TypeConstraint, validateConstraint} from 'vs/base/common/types';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {PluginsRegistry} from 'vs/platform/plugins/common/pluginsRegistry';
|
||||
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
|
||||
import {validateConstraint} from 'vs/base/common/types';
|
||||
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import {KeybindingsUtils} from 'vs/platform/keybinding/common/keybindingsUtils';
|
||||
import {IKeybindingService, ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindingService';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {ExtHostEditors} from 'vs/workbench/api/common/extHostEditors';
|
||||
import {IMessageService, Severity} from 'vs/platform/message/common/message';
|
||||
import {canSerialize} from 'vs/base/common/marshalling';
|
||||
import {toErrorMessage} from 'vs/base/common/errors';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
interface CommandHandler {
|
||||
@@ -54,7 +47,7 @@ export class ExtHostCommands {
|
||||
dispose: () => {
|
||||
delete this._commands[id];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
registerTextEditorCommand(id: string, callback: (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit) => void, thisArg?: any): vscode.Disposable {
|
||||
@@ -70,12 +63,12 @@ export class ExtHostCommands {
|
||||
actualCallback(activeTextEditor, edit);
|
||||
}).then((result) => {
|
||||
if (!result) {
|
||||
console.warn('Edits from command ' + id + ' were not applied.')
|
||||
console.warn('Edits from command ' + id + ' were not applied.');
|
||||
}
|
||||
}, (err) => {
|
||||
console.warn('An error occured while running command ' + id, err);
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
executeCommand<T>(id: string, ...args: any[]): Thenable<T> {
|
||||
@@ -208,7 +201,7 @@ KeybindingsRegistry.registerCommandDesc({
|
||||
return accessor.get(IThreadService).getRemotable(MainThreadCommands).$getCommandHandlerDescriptions().then(result => {
|
||||
const all: string[] = [];
|
||||
for (let id in result) {
|
||||
all.push('`' + id + '` - ' + _generateMarkdown(result[id]))
|
||||
all.push('`' + id + '` - ' + _generateMarkdown(result[id]));
|
||||
}
|
||||
console.log(all.join('\n'));
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {clone} from 'vs/base/common/objects';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IThreadService, Remotable} from 'vs/platform/thread/common/thread';
|
||||
@@ -48,14 +47,14 @@ export class ExtHostConfiguration {
|
||||
// result = Object.freeze(result);
|
||||
result.has = function(key: string): boolean {
|
||||
return typeof ExtHostConfiguration._lookUp(key, config) !== 'undefined';
|
||||
}
|
||||
};
|
||||
result.get = function <T>(key: string, defaultValue?: T): T {
|
||||
let result = ExtHostConfiguration._lookUp(key, config);
|
||||
if (typeof result === 'undefined') {
|
||||
result = defaultValue;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
source: diagnostic.source,
|
||||
severity: DiagnosticCollection._convertDiagnosticsSeverity(diagnostic.severity),
|
||||
code: String(diagnostic.code)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static _convertDiagnosticsSeverity(severity: number): Severity {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {Range, Position} from 'vs/workbench/api/common/extHostTypes';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {IEditorService} from 'vs/platform/editor/common/editor';
|
||||
import {EventType as FileEventType, LocalFileChangeEvent, ITextFileService, ITextFileOperationResult} from 'vs/workbench/parts/files/common/files';
|
||||
import {EventType as FileEventType, LocalFileChangeEvent, ITextFileService} from 'vs/workbench/parts/files/common/files';
|
||||
import * as TypeConverters from './extHostTypeConverters';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -32,7 +32,7 @@ export interface IModelAddedData {
|
||||
isDirty: boolean;
|
||||
}
|
||||
|
||||
var _modeId2WordDefinition: {
|
||||
const _modeId2WordDefinition: {
|
||||
[modeId:string]: RegExp;
|
||||
} = Object.create(null);
|
||||
|
||||
@@ -252,7 +252,7 @@ export class BaseTextDocument implements vscode.TextDocument {
|
||||
return this._lines[range.start.line].substring(range.start.character, range.end.character);
|
||||
}
|
||||
|
||||
var lineEnding = this._eol,
|
||||
let lineEnding = this._eol,
|
||||
startLineIndex = range.start.line,
|
||||
endLineIndex = range.end.line,
|
||||
resultLines: string[] = [];
|
||||
@@ -355,7 +355,7 @@ export class BaseTextDocument implements vscode.TextDocument {
|
||||
|
||||
validatePosition(position:Position): Position {
|
||||
if (!(position instanceof Position)) {
|
||||
throw new Error('Invalid argument')
|
||||
throw new Error('Invalid argument');
|
||||
}
|
||||
|
||||
let {line, character} = position;
|
||||
@@ -673,7 +673,7 @@ export class MainThreadDocuments {
|
||||
let asFileUri = URI.file(uri.fsPath);
|
||||
return this._fileService.resolveFile(asFileUri).then(stats => {
|
||||
// don't create a new file ontop of an existing file
|
||||
return TPromise.wrapError<boolean>('file already exists on disk')
|
||||
return TPromise.wrapError<boolean>('file already exists on disk');
|
||||
}, err => {
|
||||
let input = this._untitledEditorService.createOrGet(asFileUri); // using file-uri makes it show in 'Working Files' section
|
||||
return input.resolve(true).then(model => {
|
||||
|
||||
@@ -14,7 +14,7 @@ import {Selection, Range, Position, EditorOptions} from './extHostTypes';
|
||||
import {ISingleEditOperation, ISelection, IRange, IInternalIndentationOptions, IEditor, EditorType, ICommonCodeEditor, ICommonDiffEditor, IDecorationRenderOptions, IRangeWithMessage} from 'vs/editor/common/editorCommon';
|
||||
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
import {IEditor as IPlatformEditor, IResourceInput, Position as EditorPosition} from 'vs/platform/editor/common/editor';
|
||||
import {IEditor as IPlatformEditor, Position as EditorPosition} from 'vs/platform/editor/common/editor';
|
||||
import {IModelService} from 'vs/editor/common/services/modelService';
|
||||
import {MainThreadEditorsTracker, TextEditorRevealType, MainThreadTextEditor, ITextEditorConfiguration} from 'vs/workbench/api/common/mainThreadEditors';
|
||||
import * as TypeConverters from './extHostTypeConverters';
|
||||
@@ -130,7 +130,7 @@ export class ExtHostEditors {
|
||||
|
||||
_acceptTextEditorRemove(id:string): void {
|
||||
// make sure the removed editor is not visible
|
||||
var newVisibleEditors = this._visibleEditorIds.filter(visibleEditorId => visibleEditorId !== id);
|
||||
let newVisibleEditors = this._visibleEditorIds.filter(visibleEditorId => visibleEditorId !== id);
|
||||
|
||||
if (this._activeEditorId === id) {
|
||||
// removing the current active editor
|
||||
@@ -241,7 +241,7 @@ export class TextEditorEdit {
|
||||
function readonly(name: string, alt?: string) {
|
||||
let message = `The property '${name}' is readonly.`;
|
||||
if (alt) {
|
||||
message += ` Use '${alt}' instead.`
|
||||
message += ` Use '${alt}' instead.`;
|
||||
}
|
||||
return new Error(message);
|
||||
}
|
||||
@@ -256,10 +256,10 @@ function deprecated(name:string, message:string = 'Refer to the documentation fo
|
||||
descriptor.value = function(...args: any[]) {
|
||||
console.warn(`[Deprecation Warning] method '${name}' is deprecated and should no longer be used. ${message}`);
|
||||
return originalMethod.apply(this, args);
|
||||
}
|
||||
};
|
||||
|
||||
return descriptor;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class ExtHostTextEditor implements vscode.TextEditor {
|
||||
@@ -315,7 +315,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
|
||||
}
|
||||
|
||||
_acceptOptions(options: EditorOptions): void {
|
||||
this._options = options
|
||||
this._options = options;
|
||||
}
|
||||
|
||||
// ---- selections
|
||||
@@ -384,10 +384,10 @@ class ExtHostTextEditor implements vscode.TextEditor {
|
||||
}
|
||||
|
||||
_applyEdit(edit:TextEditorEdit): TPromise<boolean> {
|
||||
var editData = edit.finalize();
|
||||
let editData = edit.finalize();
|
||||
|
||||
// prepare data for serialization
|
||||
var edits: ISingleEditOperation[] = editData.edits.map((edit) => {
|
||||
let edits: ISingleEditOperation[] = editData.edits.map((edit) => {
|
||||
return {
|
||||
range: TypeConverters.fromRange(edit.range),
|
||||
text: edit.text,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
import {FileChangesEvent, FileChangeType} from 'vs/platform/files/common/files';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {IMarkerService} from 'vs/platform/markers/common/markers';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {Disposable} from './extHostTypes';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
|
||||
@@ -25,7 +25,7 @@ import {OccurrencesRegistry} from 'vs/editor/contrib/wordHighlighter/common/word
|
||||
import {ReferenceRegistry} from 'vs/editor/contrib/referenceSearch/common/referenceSearch';
|
||||
import {QuickFixRegistry} from 'vs/editor/contrib/quickFix/common/quickFix';
|
||||
import {OutlineRegistry, IOutlineEntry, IOutlineSupport} from 'vs/editor/contrib/quickOpen/common/quickOpen';
|
||||
import {NavigateTypesSupportRegistry, INavigateTypesSupport, ITypeBearing} from 'vs/workbench/parts/search/common/search'
|
||||
import {NavigateTypesSupportRegistry, INavigateTypesSupport, ITypeBearing} from 'vs/workbench/parts/search/common/search';
|
||||
import {RenameRegistry} from 'vs/editor/contrib/rename/common/rename';
|
||||
import {FormatRegistry, FormatOnTypeRegistry} from 'vs/editor/contrib/format/common/format';
|
||||
import {CodeLensRegistry} from 'vs/editor/contrib/codelens/common/codelens';
|
||||
@@ -102,7 +102,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
|
||||
id: String(i),
|
||||
range: TypeConverters.fromRange(lens.range),
|
||||
command: TypeConverters.Command.from(lens.command)
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -133,7 +133,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
|
||||
command = {
|
||||
title: '<<MISSING COMMAND>>',
|
||||
command: 'missing',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
symbol.command = TypeConverters.Command.from(command);
|
||||
@@ -236,7 +236,7 @@ class OccurrencesAdapter implements modes.IOccurrencesSupport {
|
||||
return {
|
||||
range: TypeConverters.fromRange(documentHighlight.range),
|
||||
kind: DocumentHighlightKind[documentHighlight.kind].toString().toLowerCase()
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class ReferenceAdapter implements modes.IReferenceSupport {
|
||||
}
|
||||
|
||||
canFindReferences(): boolean {
|
||||
return true
|
||||
return true;
|
||||
}
|
||||
|
||||
findReferences(resource: URI, position: IPosition, includeDeclaration: boolean): TPromise<modes.IReference[]> {
|
||||
@@ -502,8 +502,8 @@ class SuggestAdapter implements modes.ISuggestSupport {
|
||||
// insert the text of the edit and create a dedicated
|
||||
// suggestion-container with overwrite[Before|After]
|
||||
suggestion.codeSnippet = item.textEdit.newText;
|
||||
suggestion.overwriteBefore = pos.character - editRange.start.character,
|
||||
suggestion.overwriteAfter = editRange.end.character - pos.character
|
||||
suggestion.overwriteBefore = pos.character - editRange.start.character;
|
||||
suggestion.overwriteAfter = editRange.end.character - pos.character;
|
||||
|
||||
allSuggestions.push({
|
||||
currentWord: doc.getText(<any>editRange),
|
||||
|
||||
@@ -10,7 +10,6 @@ import {IMessageService} from 'vs/platform/message/common/message';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import {Action} from 'vs/base/common/actions';
|
||||
import {TPromise as Promise} from 'vs/base/common/winjs.base';
|
||||
import {ExtHostCommands} from 'vs/workbench/api/common/extHostCommands';
|
||||
import vscode = require('vscode');
|
||||
|
||||
export class ExtHostMessageService {
|
||||
|
||||
@@ -4,18 +4,12 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {PluginsRegistry} from 'vs/platform/plugins/common/pluginsRegistry';
|
||||
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
|
||||
import {TPromise as Promise} from 'vs/base/common/winjs.base';
|
||||
import {AbstractRemoteTelemetryService} from 'vs/platform/telemetry/common/abstractRemoteTelemetryService';
|
||||
import vscode = require('vscode');
|
||||
|
||||
export class ExtHostTelemetryService extends AbstractRemoteTelemetryService {
|
||||
|
||||
protected handleEvent(eventName:string, data?:any):void {
|
||||
var data = data || {};
|
||||
protected handleEvent(eventName: string, data?: any): void {
|
||||
data = data || {};
|
||||
data['pluginHostTelemetry'] = true;
|
||||
super.handleEvent(eventName, data);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
'use strict';
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as modes from 'vs/editor/common/modes';
|
||||
import * as types from './extHostTypes';
|
||||
import {Position as EditorPosition} from 'vs/platform/editor/common/editor';
|
||||
@@ -163,7 +162,7 @@ export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.Decorat
|
||||
return ranges.map((r): IRangeWithMessage => {
|
||||
return {
|
||||
range: fromRange(r)
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -173,12 +172,12 @@ export const TextEdit = {
|
||||
return <ISingleEditOperation>{
|
||||
text: edit.newText,
|
||||
range: fromRange(edit.range)
|
||||
}
|
||||
};
|
||||
},
|
||||
to(edit: ISingleEditOperation): vscode.TextEdit {
|
||||
return new types.TextEdit(toRange(edit.range), edit.text);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export namespace SymbolKind {
|
||||
|
||||
@@ -251,7 +250,7 @@ export namespace SymbolKind {
|
||||
case 'boolean':
|
||||
return types.SymbolKind.Boolean;
|
||||
}
|
||||
return types.SymbolKind.Property
|
||||
return types.SymbolKind.Property;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +261,7 @@ export namespace SymbolInformation {
|
||||
SymbolKind.to(entry.type),
|
||||
toRange(entry.range),
|
||||
undefined,
|
||||
entry.containerLabel)
|
||||
entry.containerLabel);
|
||||
}
|
||||
|
||||
export function toOutlineEntry(symbol: vscode.SymbolInformation): modes.IOutlineEntry {
|
||||
@@ -274,7 +273,6 @@ export namespace SymbolInformation {
|
||||
icon: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function fromSymbolInformation(info: vscode.SymbolInformation): ITypeBearing {
|
||||
@@ -306,7 +304,7 @@ export function fromHover(hover: vscode.Hover): modes.IComputeExtraInfoResult {
|
||||
return <modes.IComputeExtraInfoResult>{
|
||||
range: fromRange(hover.range),
|
||||
htmlContent: hover.contents.map(fromFormattedString)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function toHover(info: modes.IComputeExtraInfoResult): types.Hover {
|
||||
@@ -352,7 +350,7 @@ export const Suggest = {
|
||||
result.textEdit = types.TextEdit.replace(new types.Range(startPosition, endPosition), suggestion.codeSnippet);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export namespace SignatureHelp {
|
||||
|
||||
@@ -362,7 +360,7 @@ export namespace SignatureHelp {
|
||||
currentSignature: signatureHelp.activeSignature,
|
||||
currentParameter: signatureHelp.activeParameter,
|
||||
signatures: []
|
||||
}
|
||||
};
|
||||
|
||||
for (let signature of signatureHelp.signatures) {
|
||||
|
||||
@@ -441,4 +439,4 @@ export const Command = {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -7,7 +7,6 @@
|
||||
import {registerMarshallingContribution, IMarshallingContribution} from 'vs/base/common/marshalling';
|
||||
import * as types from './extHostTypes';
|
||||
import {fromPosition, fromRange} from './extHostTypeConverters';
|
||||
import {IRange, IPosition} from 'vs/editor/common/editorCommon';
|
||||
import {IReference} from 'vs/editor/common/modes';
|
||||
|
||||
abstract class OneWayMarshalling<T> implements IMarshallingContribution {
|
||||
|
||||
@@ -233,8 +233,8 @@ export class Range {
|
||||
} else if (other.contains(this)) {
|
||||
return other;
|
||||
}
|
||||
let start = Position.Min(other.start, this._start)
|
||||
let end = Position.Max(other.end, this.end)
|
||||
let start = Position.Min(other.start, this._start);
|
||||
let end = Position.Max(other.end, this.end);
|
||||
return new Range(start, end);
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ export class Selection extends Range {
|
||||
end: this.end,
|
||||
active: this.active,
|
||||
anchor: this.anchor
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ export class TextEdit {
|
||||
|
||||
set range(value: Range) {
|
||||
if (!value) {
|
||||
throw illegalArgument('range')
|
||||
throw illegalArgument('range');
|
||||
}
|
||||
this._range = value;
|
||||
}
|
||||
@@ -470,7 +470,7 @@ export class Diagnostic {
|
||||
range: this.range,
|
||||
source: this.source,
|
||||
code: this.code,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ export class DocumentHighlight {
|
||||
return {
|
||||
range: this.range,
|
||||
kind: DocumentHighlightKind[this.kind]
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ export class SymbolInformation {
|
||||
kind: SymbolKind[this.kind],
|
||||
location: this.location,
|
||||
containerName: this.containerName
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ export class CompletionItem {
|
||||
filterText: this.filterText,
|
||||
insertText: this.insertText,
|
||||
textEdit: this.textEdit
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,10 @@ import URI from 'vs/base/common/uri';
|
||||
import {ISearchService, QueryType} from 'vs/platform/search/common/search';
|
||||
import {IWorkspaceContextService, IWorkspace} from 'vs/platform/workspace/common/workspace';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
import {ITextFileService, ITextFileOperationResult} from 'vs/workbench/parts/files/common/files';
|
||||
import {Uri, FileSystemWatcher} from 'vscode';
|
||||
import {ITextFileService} from 'vs/workbench/parts/files/common/files';
|
||||
import {Uri} from 'vscode';
|
||||
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {bulkEdit, IResourceEdit} from 'vs/editor/common/services/bulkEdit';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -46,7 +45,7 @@ export class ExtHostWorkspace {
|
||||
return path.substring(this._workspacePath.length);
|
||||
}
|
||||
|
||||
return path
|
||||
return path;
|
||||
}
|
||||
|
||||
findFiles(include: string, exclude: string, maxResults?:number): Thenable<Uri[]> {
|
||||
@@ -120,7 +119,7 @@ export class MainThreadWorkspace {
|
||||
|
||||
saveAll(includeUntitled?: boolean): Thenable<boolean> {
|
||||
return this._textFileService.saveAll(includeUntitled).then(result => {
|
||||
return result.results.every(each => each.success === true);;
|
||||
return result.results.every(each => each.success === true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
import EditorCommon = require('vs/editor/common/editorCommon');
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {IEditor} from 'vs/platform/editor/common/editor';
|
||||
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
|
||||
import {IModelService} from 'vs/editor/common/services/modelService';
|
||||
@@ -113,7 +112,7 @@ export class MainThreadTextEditor {
|
||||
this._codeEditor = codeEditor;
|
||||
if (this._codeEditor) {
|
||||
|
||||
var forwardSelection = () => {
|
||||
let forwardSelection = () => {
|
||||
this._lastSelection = this._codeEditor.getSelections();
|
||||
this._onSelectionChanged.fire(this._lastSelection);
|
||||
};
|
||||
@@ -122,7 +121,7 @@ export class MainThreadTextEditor {
|
||||
forwardSelection();
|
||||
}
|
||||
|
||||
var forwardConfiguration = () => {
|
||||
let forwardConfiguration = () => {
|
||||
this._lastConfiguration = MainThreadTextEditor._readConfiguration(this._codeEditor);
|
||||
this._onConfigurationChanged.fire(this._lastConfiguration);
|
||||
};
|
||||
@@ -236,13 +235,13 @@ export class MainThreadTextEditor {
|
||||
}
|
||||
|
||||
if (this._codeEditor) {
|
||||
var transformedEdits = edits.map((edit): EditorCommon.IIdentifiedSingleEditOperation => {
|
||||
let transformedEdits = edits.map((edit): EditorCommon.IIdentifiedSingleEditOperation => {
|
||||
return {
|
||||
identifier: null,
|
||||
range: Range.lift(edit.range),
|
||||
text: edit.text,
|
||||
forceMoveMarkers: edit.forceMoveMarkers
|
||||
}
|
||||
};
|
||||
});
|
||||
return this._codeEditor.executeEdits('MainThreadTextEditor', transformedEdits) || true;
|
||||
}
|
||||
@@ -449,7 +448,7 @@ export class MainThreadEditorsTracker {
|
||||
}
|
||||
|
||||
private _findVisibleTextEditorIds(): string[] {
|
||||
var result = [];
|
||||
let result = [];
|
||||
let modelUris = Object.keys(this._model2TextEditors);
|
||||
for (let i = 0, len = modelUris.length; i < len; i++) {
|
||||
let editors = this._model2TextEditors[modelUris[i]];
|
||||
@@ -562,7 +561,7 @@ interface IVisibleModels {
|
||||
[modelUri:string]: {
|
||||
model: EditorCommon.IModel;
|
||||
codeEditors: EditorCommon.ICommonCodeEditor[];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function strcmp(a:string, b:string): number {
|
||||
|
||||
Reference in New Issue
Block a user