Merge branch 'master' into ben/next

This commit is contained in:
Benjamin Pasero 2016-09-05 16:48:31 +02:00
commit 7a517bbd73
33 changed files with 263 additions and 132 deletions

View file

@ -6,7 +6,9 @@
"rules": {
"no-console": 0,
"no-cond-assign": 0,
"no-unused-vars": 1
"no-unused-vars": 1,
"no-extra-semi": "warn",
"semi": "warn"
},
"extends": "eslint:recommended"
}

View file

@ -32,6 +32,7 @@ var editorResources = [
'!out-build/vs/base/browser/ui/splitview/**/*',
'!out-build/vs/base/browser/ui/toolbar/**/*',
'!out-build/vs/base/browser/ui/octiconLabel/**/*',
'!out-build/vs/editor/contrib/defineKeybinding/**/*',
'out-build/vs/base/worker/workerMainCompatibility.html',
'out-build/vs/base/worker/workerMain.{js,js.map}',
'!out-build/vs/workbench/**',

View file

@ -11,7 +11,7 @@ const path = require('path');
const es = require('event-stream');
const azure = require('gulp-azure-storage');
const electron = require('gulp-atom-electron');
const symdest = require('gulp-symdest');
const vfs = require('vinyl-fs');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const filter = require('gulp-filter');
@ -130,7 +130,7 @@ gulp.task('electron', ['clean-electron'], () => {
.pipe(json({ name }))
.pipe(electron(opts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(symdest('.build/electron'));
.pipe(vfs.dest('.build/electron'));
});
const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
@ -243,7 +243,7 @@ function packageTask(platform, arch, opts) {
.pipe(rename('bin/' + product.applicationName)));
}
return result.pipe(symdest(destination));
return result.pipe(vfs.dest(destination));
};
}

View file

@ -10,7 +10,7 @@ const replace = require('gulp-replace');
const rename = require('gulp-rename');
const shell = require('gulp-shell');
const es = require('event-stream');
const symdest = require('gulp-symdest');
const vfs = require('vinyl-fs');
const util = require('./lib/util');
const packageJson = require('../package.json');
const product = require('../product.json');
@ -55,22 +55,22 @@ function prepareDebPackage(arch) {
const prerm = gulp.src('resources/linux/debian/prerm.template', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('DEBIAN/prerm'))
.pipe(rename('DEBIAN/prerm'));
const postrm = gulp.src('resources/linux/debian/postrm.template', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(rename('DEBIAN/postrm'))
.pipe(rename('DEBIAN/postrm'));
const postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@ARCHITECTURE@@', debArch))
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
.pipe(rename('DEBIAN/postinst'))
.pipe(rename('DEBIAN/postinst'));
const all = es.merge(control, postinst, postrm, prerm, desktop, icon, code);
return all.pipe(symdest(destination));
return all.pipe(vfs.dest(destination));
};
}
@ -124,8 +124,8 @@ function prepareRpmPackage(arch) {
const all = es.merge(code, desktop, icon, spec, specIcon);
return all.pipe(symdest(getRpmBuildPath(rpmArch)));
}
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
};
}
function buildRpmPackage(arch) {
@ -133,6 +133,7 @@ function buildRpmPackage(arch) {
const rpmBuildPath = getRpmBuildPath(rpmArch);
const rpmOut = rpmBuildPath + '/RPMS/' + rpmArch;
const destination = '.build/linux/rpm/' + rpmArch;
return shell.task([
'mkdir -p ' + destination,
'HOME="$(pwd)/' + destination + '" fakeroot rpmbuild -bb ' + rpmBuildPath + '/SPECS/' + product.applicationName + '.spec --target=' + rpmArch,

View file

@ -1,5 +1,31 @@
# Monaco Editor Change log
## [0.6.0]
- This will be the last release that contains specific IE9 and IE10 fixes/workarounds. We will begin cleaning our code-base and remove them.
- `javascript` and `typescript` language services:
- exposed API to get to the underlying language service.
- fixed a bug that prevented modifying `extraLibs`.
- Multiple improvements/bugfixes to the `css`, `less`, `scss` and `json` language services.
### API changes:
- settings:
- new: `mouseWheelZoom`, `wordWrap`, `snippetSuggestions`, `tabCompletion`, `wordBasedSuggestions`, `renderControlCharacters`, `renderLineHighlight`, `fontWeight`.
- removed: `tabFocusMode`, `outlineMarkers`.
- renamed: `indentGuides` -> `renderIndentGuides`, `referenceInfos` -> `codeLens`
- added `editor.pushUndoStop()` to explicitly push an undo stop
- added `suppressMouseDown` to `IContentWidget`
- added optional `resolveLink` to `ILinkProvider`
- removed `enablement`, `contextMenuGroupId` from `IActionDescriptor`
- removed exposed constants for editor context keys.
### Notable bugfixes:
- Icons missing in the find widget in IE11 [#148](https://github.com/Microsoft/monaco-editor/issues/148)
- Multiple context menu issues
- Multiple clicking issues in IE11/Edge ([#137](https://github.com/Microsoft/monaco-editor/issues/137), [#118](https://github.com/Microsoft/monaco-editor/issues/118))
- Multiple issues with the high-contrast theme.
- Multiple IME issues in IE11, Edge and Firefox.
## [0.5.1]
- Fixed mouse handling in IE

View file

@ -8,6 +8,28 @@ herein, whether by implication, estoppel or otherwise.
%% winjs version 4.4.0 (https://github.com/winjs/winjs)
=========================================
WinJS
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF winjs NOTICES AND INFORMATION
%% HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
=========================================
Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied

View file

@ -1,7 +1,7 @@
{
"name": "monaco-editor-core",
"private": true,
"version": "0.5.3",
"version": "0.6.0",
"description": "A browser based code editor",
"author": "Microsoft Corporation",
"license": "MIT",

View file

@ -44,7 +44,7 @@ connection.onShutdown(() => {
});
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilites.
// in the passed params the rootPath of the workspace plus the client capabilities.
connection.onInitialize((params: InitializeParams): InitializeResult => {
return {
capabilities: {

View file

@ -52,7 +52,7 @@ documents.listen(connection);
const filesAssociationContribution = new FileAssociationContribution();
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilites.
// in the passed params the rootPath of the workspace plus the client capabilities.
let workspaceRoot: URI;
connection.onInitialize((params: InitializeParams): InitializeResult => {
workspaceRoot = URI.parse(params.rootPath);

View file

@ -29,6 +29,7 @@ const assign = require('object-assign');
const monacodts = require('./build/monaco/api');
const fs = require('fs');
const glob = require('glob');
const pkg = require('./package.json');
const rootDir = path.join(__dirname, 'src');
const options = require('./src/tsconfig.json').compilerOptions;
@ -215,7 +216,7 @@ gulp.task('mixin', function () {
return;
}
const url = 'https://github.com/' + repo + '/archive/master.zip';
const url = `https://github.com/${ repo }/archive/${ pkg.distro }.zip`;
const opts = { base: '' };
const username = process.env['VSCODE_MIXIN_USERNAME'];
const password = process.env['VSCODE_MIXIN_PASSWORD'];

View file

@ -2,6 +2,7 @@
"name": "code-oss-dev",
"version": "1.5.0",
"electronVersion": "0.37.6",
"distro": "c26eaaa8f54b3209a1e2418c9b1010cca4650620",
"author": {
"name": "Microsoft Corporation"
},
@ -42,6 +43,7 @@
"cson-parser": "^1.3.3",
"debounce": "^1.0.0",
"documentdb": "^1.5.1",
"eslint": "^3.4.0",
"event-stream": "^3.1.7",
"express": "^4.13.1",
"ghooks": "1.0.3",
@ -61,7 +63,6 @@
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-symdest": "^1.1.0",
"gulp-tsb": "^1.10.1",
"gulp-tslint": "^4.3.0",
"gulp-uglify": "^1.4.1",
@ -89,6 +90,7 @@
"uglify-js": "2.4.8",
"underscore": "^1.8.2",
"vinyl": "^0.4.5",
"vinyl-fs": "^2.4.3",
"vscode-nls-dev": "^1.0.0"
},
"repository": {

View file

@ -109,12 +109,14 @@ export class KeyboardHandler extends ViewEventHandler implements IDisposable {
let cs = dom.getComputedStyle(this.textArea.actual);
if (browser.isFirefox) {
// computedStyle.font is empty in Firefox...
context.font = `${cs.fontStyle} ${cs.fontVariant} ${cs.fontWeight} ${cs.fontStretch} ${cs.fontSize} / ${cs.lineHeight} '${cs.fontFamily}'`;
context.font = `${cs.fontStyle} ${cs.fontVariant} ${cs.fontWeight} ${cs.fontStretch} ${cs.fontSize} / ${cs.lineHeight} ${cs.fontFamily}`;
let metrics = context.measureText(e.data);
StyleMutator.setWidth(this.textArea.actual, metrics.width + 2); // +2 for Japanese...
} else {
context.font = cs.font;
let metrics = context.measureText(e.data);
StyleMutator.setWidth(this.textArea.actual, metrics.width);
}
let metrics = context.measureText(e.data);
StyleMutator.setWidth(this.textArea.actual, metrics.width);
}
}));

View file

@ -117,11 +117,8 @@ export class TextAreaHandler extends Disposable {
this.textareaIsShownAtCursor = true;
// In IE we cannot set .value when handling 'compositionstart' because the entire composition will get canceled.
let shouldEmptyTextArea = true;
if (shouldEmptyTextArea) {
if (!this.Browser.isEdgeOrIE) {
this.setTextAreaState('compositionstart', this.textAreaState.toEmpty());
}
if (!this.Browser.isEdgeOrIE) {
this.setTextAreaState('compositionstart', this.textAreaState.toEmpty());
}
this._onCompositionStart.fire({

View file

@ -248,6 +248,10 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
},
codeBlockRenderer: (modeId, value): string | TPromise<string> => {
if (!modeId) {
modeId = this._editor.getModel().getModeId();
}
let mode = this._modeService.getMode(modeId);
if (mode) {
return tokenizeToString(value, mode);

View file

@ -138,7 +138,13 @@ export class CompletionModel {
// no match on label nor codeSnippet -> check on filterText
if(!match && typeof suggestion.filterText === 'string') {
match = !isFalsyOrEmpty(filter(word, suggestion.filterText));
if (!isFalsyOrEmpty(filter(word, suggestion.filterText))) {
match = true;
// try to compute highlights by stripping none-word
// characters from the end of the string
item.highlights = filter(word.replace(/^\W+|\W+$/, ''), suggestion.label);
}
}
if (!match) {
@ -149,7 +155,7 @@ export class CompletionModel {
// compute score against word
const wordLowerCase = word.toLowerCase();
const score = CompletionModel._score(suggestion.label, word, wordLowerCase);
const score = CompletionModel._score(suggestion.insertText, word, wordLowerCase);
if (score > topScore) {
topScore = score;
this._topScoreIdx = this._filteredItems.length - 1;

View file

@ -13,28 +13,38 @@ export class CommandService implements ICommandService {
_serviceBrand: any;
private _extensionHostIsReady: boolean = false;
constructor(
@IInstantiationService private _instantiationService: IInstantiationService,
@IExtensionService private _extensionService: IExtensionService
) {
//
this._extensionService.onReady().then(value => this._extensionHostIsReady = value);
}
executeCommand<T>(id: string, ...args: any[]): TPromise<T> {
// we always send an activation event, but
// we don't wait for it when the extension
// host didn't yet start
return this._extensionService.activateByEvent(`onCommand:${id}`).then(_ => {
const activation = this._extensionService.activateByEvent(`onCommand:${id}`);
const command = CommandsRegistry.getCommand(id);
if (!command) {
return TPromise.wrapError(new Error(`command '${id}' not found`));
}
return this._extensionHostIsReady
? activation.then(_ => this._tryExecuteCommand(id, args))
: this._tryExecuteCommand(id, args);
}
try {
const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler].concat(args));
return TPromise.as(result);
} catch (err) {
return TPromise.wrapError(err);
}
});
private _tryExecuteCommand(id: string, args: any[]): TPromise<any> {
const command = CommandsRegistry.getCommand(id);
if (!command) {
return TPromise.wrapError(new Error(`command '${id}' not found`));
}
try {
const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler].concat(args));
return TPromise.as(result);
} catch (err) {
return TPromise.wrapError(err);
}
}
}

View file

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as assert from 'assert';
import {IDisposable} from 'vs/base/common/lifecycle';
import {TPromise} from 'vs/base/common/winjs.base';
import {CommandsRegistry} from 'vs/platform/commands/common/commands';
import {CommandService} from 'vs/platform/commands/common/commandService';
import {IExtensionService} from 'vs/platform/extensions/common/extensions';
import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService';
class SimpleExtensionService implements IExtensionService {
_serviceBrand: any;
activateByEvent(activationEvent: string): TPromise<void> {
return this.onReady().then(() => { });
}
onReady(): TPromise<boolean> {
return TPromise.as(true);
}
getExtensionsStatus() {
return undefined;
}
}
suite('CommandService', function () {
let commandRegistration: IDisposable;
setup(function () {
commandRegistration = CommandsRegistry.registerCommand('foo', function () { });
});
teardown(function () {
commandRegistration.dispose();
});
test('activateOnCommand', function () {
let lastEvent: string;
let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService {
activateByEvent(activationEvent: string): TPromise<void> {
lastEvent = activationEvent;
return super.activateByEvent(activationEvent);
}
});
return service.executeCommand('foo').then(() => {
assert.ok(lastEvent, 'onCommand:foo');
return service.executeCommand('unknownCommandId');
}).then(() => {
assert.ok(false);
}, () => {
assert.ok(lastEvent, 'onCommand:unknownCommandId');
});
});
test('fwd activation error', function () {
let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService {
activateByEvent(activationEvent: string): TPromise<void> {
return TPromise.wrapError<void>('bad_activate');
}
});
return service.executeCommand('foo').then(() => assert.ok(false), err => {
assert.equal(err, 'bad_activate');
});
});
test('!onReady, but executeCommand', function () {
let callCounter = 0;
let reg = CommandsRegistry.registerCommand('bar', () => callCounter += 1);
let resolve: Function;
let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService {
onReady() {
return new TPromise(_resolve => { resolve = _resolve; });
}
});
return service.executeCommand('bar').then(() => {
reg.dispose();
assert.equal(callCounter, 1);
});
});
});

6
src/vs/vscode.d.ts vendored
View file

@ -1434,7 +1434,7 @@ declare namespace vscode {
* @return A human readable string which is presented as diagnostic message.
* Return `undefined`, `null`, or the empty string when 'value' is valid.
*/
validateInput?: (value: string) => string;
validateInput?(value: string): string;
}
/**
@ -1843,7 +1843,7 @@ declare namespace vscode {
* @return The resolved symbol or a thenable that resolves to that. When no result is returned,
* the given `symbol` is used.
*/
resolveWorkspaceSymbol?: (symbol: SymbolInformation, token: CancellationToken) => SymbolInformation | Thenable<SymbolInformation>;
resolveWorkspaceSymbol?(symbol: SymbolInformation, token: CancellationToken): SymbolInformation | Thenable<SymbolInformation>;
}
/**
@ -2445,7 +2445,7 @@ declare namespace vscode {
* @param link The link that is to be resolved.
* @param token A cancellation token.
*/
resolveDocumentLink?: (link: DocumentLink, token: CancellationToken) => DocumentLink | Thenable<DocumentLink>;
resolveDocumentLink?(link: DocumentLink, token: CancellationToken): DocumentLink | Thenable<DocumentLink>;
}
/**

View file

@ -10,7 +10,7 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
import * as vscode from 'vscode';
import * as TypeConverters from 'vs/workbench/api/node/extHostTypeConverters';
import {Range, Disposable, SignatureHelp, CompletionList} from 'vs/workbench/api/node/extHostTypes';
import {Range, Disposable, CompletionList} from 'vs/workbench/api/node/extHostTypes';
import {IPosition, IRange, ISingleEditOperation} from 'vs/editor/common/editorCommon';
import * as modes from 'vs/editor/common/modes';
import {ExtHostDocuments} from 'vs/workbench/api/node/extHostDocuments';
@ -535,18 +535,16 @@ class SuggestAdapter {
const disposables: IDisposable[] = [];
let list: CompletionList;
if (Array.isArray(value)) {
list = new CompletionList(value);
} else if (value instanceof CompletionList) {
list = value;
result.incomplete = list.isIncomplete;
} else if (!value) {
if (!value) {
// undefined and null are valid results
return;
} else if (Array.isArray(value)) {
list = new CompletionList(value);
} else {
// warn about everything else
console.warn('INVALID result from completion provider. expected CompletionItem-array or CompletionList but got:', value);
return;
list = value;
result.incomplete = list.isIncomplete;
}
for (let i = 0; i < list.items.length; i++) {
@ -622,7 +620,7 @@ class SignatureHelpAdapter {
const pos = TypeConverters.toPosition(position);
return asWinJsPromise(token => this._provider.provideSignatureHelp(doc, pos, token)).then(value => {
if (value instanceof SignatureHelp) {
if (value) {
return TypeConverters.SignatureHelp.from(value);
}
});

View file

@ -39,7 +39,7 @@ export class ExtHostWorkspace {
}
if (isEqualOrParent(path, this._workspacePath)) {
return relative(this._workspacePath, path);
return relative(this._workspacePath, path) || path;
}
return path;

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#2D2D30" d="M13 13h-10v-10h10v10z"/><path fill="#F48771" d="M12 12h-8v-8h8v8z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#f48771" d="M15 15H1V1h14v14z"/><path fill="#2a292c" d="M11 6v1h-1v3H8.5v4h-1v-4H6V7H5V6h6zM7 3.5a.5.5 0 0 0-1 0V5h1V3.5zm3 0a.5.5 0 0 0-1 0V5h1V3.5z"/></svg>

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 230 B

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M13 13h-10v-10h10v10z"/><path fill="#A1260D" d="M12 12h-8v-8h8v8z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#A1260D" d="M15 15H1V1h14v14z"/><path fill="#F0EFF1" d="M11 6v1h-1v3H8.5v4h-1v-4H6V7H5V6h6zM7 3.5a.5.5 0 0 0-1 0V5h1V3.5zm3 0a.5.5 0 0 0-1 0V5h1V3.5z"/></svg>

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 230 B

View file

@ -252,7 +252,7 @@ export interface IRawBreakpointContribution {
}
export interface IRawDebugSession {
configuration: { type: string, capabilities: DebugProtocol.Capabilites };
configuration: { type: string, capabilities: DebugProtocol.Capabilities };
disconnect(restart?: boolean, force?: boolean): TPromise<DebugProtocol.DisconnectResponse>;

View file

@ -343,7 +343,7 @@ export class Variable extends ExpressionContainer implements debug.IExpression {
public available = true,
startOfVariables = 0
) {
super(reference, `variable:${ parent.getId() }:${ name }`, true, namedVariables, indexedVariables, startOfVariables);
super(reference, `variable:${parent.getId()}:${name}:${reference}`, true, namedVariables, indexedVariables, startOfVariables);
this.value = massageValue(value);
}
}

View file

@ -231,7 +231,7 @@ declare module DebugProtocol {
/** Response to Initialize request. */
export interface InitializeResponse extends Response {
/** The capabilities of this debug adapter */
body?: Capabilites;
body?: Capabilities;
}
/** ConfigurationDone request; value of command field is "configurationDone".
@ -759,7 +759,7 @@ declare module DebugProtocol {
//---- Types
/** Information about the capabilities of a debug adapter. */
export interface Capabilites {
export interface Capabilities {
/** The debug adapter supports the configurationDoneRequest. */
supportsConfigurationDoneRequest?: boolean;
/** The debug adapter supports functionBreakpoints. */

View file

@ -30,7 +30,6 @@ import IDebugService = debug.IDebugService;
const debugTreeOptions = (ariaLabel: string) => {
return <tree.ITreeOptions> {
indentPixels: 8,
twistiePixels: 20,
ariaLabel
};

View file

@ -52,7 +52,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
private startTime: number;
private stopServerPending: boolean;
private sentPromises: TPromise<DebugProtocol.Response>[];
private capabilities: DebugProtocol.Capabilites;
private capabilities: DebugProtocol.Capabilities;
private _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
private _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
@ -211,7 +211,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this._onDidEvent.fire(event);
}
public get configuration(): { type: string, capabilities: DebugProtocol.Capabilites } {
public get configuration(): { type: string, capabilities: DebugProtocol.Capabilities } {
return {
type: this.adapter.type,
capabilities: this.capabilities || {}

View file

@ -43,7 +43,6 @@ import {IPanelService} from 'vs/workbench/services/panel/common/panelService';
const $ = dom.$;
const replTreeOptions: tree.ITreeOptions = {
indentPixels: 8,
twistiePixels: 20,
ariaLabel: nls.localize('replAriaLabel', "Read Eval Print Loop Panel")
};
@ -57,8 +56,6 @@ export interface IPrivateReplService {
acceptReplInput(): void;
}
export class Repl extends Panel implements IPrivateReplService {
public _serviceBrand: any;

View file

@ -3,9 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!./../browser/media/repl';
import {IEditorOptions} from 'vs/editor/common/editorCommon';
import {EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
@ -25,8 +22,8 @@ import {TabCompletionController} from 'vs/editor/contrib/suggest/browser/tabComp
export class ReplEditor extends CodeEditorWidget {
constructor(
domElement:HTMLElement,
options:IEditorOptions,
domElement: HTMLElement,
options: IEditorOptions,
@IInstantiationService instantiationService: IInstantiationService,
@ICodeEditorService codeEditorService: ICodeEditorService,
@ICommandService commandService: ICommandService,

View file

@ -145,7 +145,7 @@ export class MockDebugService implements debug.IDebugService {
class MockRawSession implements debug.IRawDebugSession {
public get configuration(): { type: string, capabilities: DebugProtocol.Capabilites } {
public get configuration(): { type: string, capabilities: DebugProtocol.Capabilities } {
return {
type: 'mock',
capabilities: {}

View file

@ -5,7 +5,7 @@
import {IThemeDocument, IThemeSetting, IThemeSettingStyle} from 'vs/workbench/services/themes/common/themeService';
import {Color} from 'vs/base/common/color';
import {getBaseThemeId, getSyntaxThemeId, isLightTheme, isDarkTheme} from 'vs/platform/theme/common/themes';
import {getBaseThemeId, getSyntaxThemeId} from 'vs/platform/theme/common/themes';
interface ThemeGlobalSettings {
background?: string;
@ -67,23 +67,15 @@ class Theme {
return this.settings;
}
public isDarkTheme(): boolean {
return isDarkTheme(this.themeId);
}
public isLightTheme(): boolean {
return isLightTheme(this.themeId);
}
}
abstract class StyleRules {
public abstract getCssRules(theme: Theme): string[];
public abstract getCssRules(theme: Theme, cssRules: string[]): void;
}
export class TokenStylesContribution {
public contributeStyles(themeId: string, themeDocument: IThemeDocument): string[] {
let cssRules = [];
public contributeStyles(themeId: string, themeDocument: IThemeDocument, cssRules: string[]): void {
let theme = new Theme(themeId, themeDocument);
theme.getSettings().forEach((s: IThemeSetting, index, arr) => {
let scope: string | string[] = s.scope;
@ -98,7 +90,6 @@ export class TokenStylesContribution {
});
}
});
return cssRules;
}
private _settingsToStatements(settings: IThemeSettingStyle): string {
@ -139,8 +130,7 @@ export class TokenStylesContribution {
export class EditorStylesContribution {
public contributeStyles(themeId: string, themeDocument: IThemeDocument): string[] {
let cssRules = [];
public contributeStyles(themeId: string, themeDocument: IThemeDocument, cssRules: string[]) {
let editorStyleRules = [
new EditorBackgroundStyleRules(),
new EditorForegroundStyleRules(),
@ -158,17 +148,15 @@ export class EditorStylesContribution {
let theme = new Theme(themeId, themeDocument);
if (theme.hasGlobalSettings()) {
editorStyleRules.forEach((editorStyleRule => {
cssRules = cssRules.concat(editorStyleRule.getCssRules(theme));
editorStyleRule.getCssRules(theme, cssRules);
}));
}
return cssRules;
}
}
export class SearchViewStylesContribution {
public contributeStyles(themeId: string, themeDocument: IThemeDocument): string[] {
let cssRules = [];
public contributeStyles(themeId: string, themeDocument: IThemeDocument, cssRules: string[]): void {
let theme = new Theme(themeId, themeDocument);
if (theme.hasGlobalSettings()) {
if (theme.getGlobalSettings().findMatchHighlight) {
@ -177,7 +165,6 @@ export class SearchViewStylesContribution {
cssRules.push(`.${theme.getSelector()} .search-viewlet .highlight { background-color: ${color}; }`);
}
}
return cssRules;
}
}
@ -193,8 +180,7 @@ abstract class EditorStyleRules extends StyleRules {
}
class EditorBackgroundStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
let themeSelector = theme.getSelector();
if (theme.getGlobalSettings().background) {
let background = new Color(theme.getGlobalSettings().background);
@ -202,44 +188,36 @@ class EditorBackgroundStyleRules extends EditorStyleRules {
this.addBackgroundColorRule(theme, '.glyph-margin', background, cssRules);
cssRules.push(`.${themeSelector} .monaco-workbench .monaco-editor-background { background-color: ${background}; }`);
}
return cssRules;
}
}
class EditorForegroundStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
let themeSelector = theme.getSelector();
if (theme.getGlobalSettings().foreground) {
let foreground = new Color(theme.getGlobalSettings().foreground);
cssRules.push(`.monaco-editor.${themeSelector} .token { color: ${foreground}; }`);
}
return cssRules;
}
}
class EditorHoverHighlightStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
this.addBackgroundColorRule(theme, '.hoverHighlight', theme.getGlobalSettings().hoverHighlight, cssRules);
return cssRules;
}
}
class EditorLinkStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
if (theme.getGlobalSettings().activeLinkForeground) {
cssRules.push(`.monaco-editor.${theme.getSelector()} .detected-link-active { color: ${new Color(theme.getGlobalSettings().activeLinkForeground)} !important; }`);
cssRules.push(`.monaco-editor.${theme.getSelector()} .goto-definition-link { color: ${new Color(theme.getGlobalSettings().activeLinkForeground)} !important; }`);
}
return cssRules;
}
}
class EditorSelectionStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
if (theme.getGlobalSettings().selection) {
this.addBackgroundColorRule(theme, '.focused .selected-text', theme.getGlobalSettings().selection, cssRules);
}
@ -256,8 +234,6 @@ class EditorSelectionStyleRules extends EditorStyleRules {
this.addBackgroundColorRule(theme, '.focused .selectionHighlight', selectionHighlightColor, cssRules);
this.addBackgroundColorRule(theme, '.selectionHighlight', selectionHighlightColor.transparent(0.5), cssRules);
}
return cssRules;
}
private getSelectionHighlightColor(theme: Theme) {
@ -276,78 +252,64 @@ class EditorSelectionStyleRules extends EditorStyleRules {
}
class EditorWordHighlightStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
this.addBackgroundColorRule(theme, '.wordHighlight', theme.getGlobalSettings().wordHighlight, cssRules);
this.addBackgroundColorRule(theme, '.wordHighlightStrong', theme.getGlobalSettings().wordHighlightStrong, cssRules);
return cssRules;
}
}
class EditorFindStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
this.addBackgroundColorRule(theme, '.findMatch', theme.getGlobalSettings().findMatchHighlight, cssRules);
this.addBackgroundColorRule(theme, '.currentFindMatch', theme.getGlobalSettings().currentFindMatchHighlight, cssRules);
this.addBackgroundColorRule(theme, '.findScope', theme.getGlobalSettings().findRangeHighlight, cssRules);
return cssRules;
}
}
class EditorReferenceSearchStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
this.addBackgroundColorRule(theme, '.reference-zone-widget .ref-tree .referenceMatch', theme.getGlobalSettings().findMatchHighlight, cssRules);
this.addBackgroundColorRule(theme, '.reference-zone-widget .preview .reference-decoration', theme.getGlobalSettings().referenceHighlight, cssRules);
return cssRules;
}
}
class EditorLineHighlightStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
if (theme.getGlobalSettings().lineHighlight) {
cssRules.push(`.monaco-editor.${theme.getSelector()} .current-line { background-color: ${new Color(theme.getGlobalSettings().lineHighlight)}; border: none; }`);
}
this.addBackgroundColorRule(theme, '.rangeHighlight', theme.getGlobalSettings().rangeHighlight, cssRules);
return cssRules;
}
}
class EditorCursorStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
let themeSelector = theme.getSelector();
if (theme.getGlobalSettings().caret) {
let caret = new Color(theme.getGlobalSettings().caret);
let oppositeCaret = caret.opposite();
cssRules.push(`.monaco-editor.${themeSelector} .cursor { background-color: ${caret}; border-color: ${caret}; color: ${oppositeCaret}; }`);
}
return cssRules;
}
}
class EditorWhiteSpaceStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
let themeSelector = theme.getSelector();
if (theme.getGlobalSettings().invisibles) {
let invisibles = new Color(theme.getGlobalSettings().invisibles);
cssRules.push(`.monaco-editor.${themeSelector} .token.whitespace { color: ${invisibles} !important; }`);
}
return cssRules;
}
}
class EditorIndentGuidesStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme): string[] {
let cssRules = [];
public getCssRules(theme: Theme, cssRules: string[]): void {
let themeSelector = theme.getSelector();
let color = this.getColor(theme.getGlobalSettings());
if (color !== null) {
cssRules.push(`.monaco-editor.${themeSelector} .lines-content .cigr { background: ${color}; }`);
}
return cssRules;
}
private getColor(theme: ThemeGlobalSettings): Color {

View file

@ -346,7 +346,7 @@ export class ThemeService implements IThemeService {
if (normalizedAbsolutePath.indexOf(extensionFolderPath) !== 0) {
collector.warn(nls.localize('invalid.path.1', "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", themesExtPoint.name, normalizedAbsolutePath, extensionFolderPath));
}
this.knownIconThemes.push({
id: extensionId + '-' + iconTheme.id,
label: iconTheme.label || Paths.basename(iconTheme.path),
@ -630,9 +630,9 @@ function _processThemeObject(themeId: string, themeDocument: IThemeDocument): st
let themeSettings : IThemeSetting[] = themeDocument.settings;
if (Array.isArray(themeSettings)) {
cssRules= cssRules.concat(new TokenStylesContribution().contributeStyles(themeId, themeDocument));
cssRules= cssRules.concat(new EditorStylesContribution().contributeStyles(themeId, themeDocument));
cssRules= cssRules.concat(new SearchViewStylesContribution().contributeStyles(themeId, themeDocument));
new TokenStylesContribution().contributeStyles(themeId, themeDocument, cssRules);
new EditorStylesContribution().contributeStyles(themeId, themeDocument, cssRules);
new SearchViewStylesContribution().contributeStyles(themeId, themeDocument, cssRules);
}
return cssRules.join('\n');

View file

@ -20,4 +20,16 @@ suite('ExtHostWorkspace', function () {
'm:/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart');
});
test('asRelativePath, same paths, #11402', function () {
const root = '/home/aeschli/workspaces/samples/docker';
const input = '/home/aeschli/workspaces/samples/docker';
const ws = new ExtHostWorkspace(new TestThreadService(), root);
assert.equal(ws.getRelativePath(input), input);
const input2 = '/home/aeschli/workspaces/samples/docker/a.file';
assert.equal(ws.getRelativePath(input2), 'a.file');
});
});