提交 4b2dfa96 编写于 作者: A Arash Arbabi

Merge branch 'master' of https://github.com/microsoft/vscode

......@@ -223,7 +223,7 @@ export function activate(context: ExtensionContext) {
let languageConfiguration: LanguageConfiguration = {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|[^\s{}\[\],:]+/,
indentationRules: {
increaseIndentPattern: /^.*(\{[^}]*|\[[^\]]*)$/,
increaseIndentPattern: /({+(?=([^"]*"[^"]*")*[^"}]*$))|(\[+(?=([^"]*"[^"]*")*[^"\]]*$))/,
decreaseIndentPattern: /^\s*[}\]],?\s*$/
}
};
......
{
"name": "code-oss-dev",
"version": "1.37.0",
"version": "1.38.0",
"distro": "f9c5d20222a2776b589107efa7d2e3aa4b80050d",
"author": {
"name": "Microsoft Corporation"
......@@ -158,4 +158,4 @@
"windows-mutex": "0.3.0",
"windows-process-tree": "0.2.4"
}
}
\ No newline at end of file
}
......@@ -223,4 +223,4 @@ export class ButtonGroup extends Disposable {
}
}
}
}
\ No newline at end of file
}
......@@ -3633,6 +3633,75 @@ suite('Editor Controller - Indentation Rules', () => {
model.dispose();
mode.dispose();
});
test('', () => {
class JSONMode extends MockMode {
private static readonly _id = new LanguageIdentifier('indentRulesMode', 4);
constructor() {
super(JSONMode._id);
this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), {
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
indentationRules: {
increaseIndentPattern: new RegExp('^.*\\{[^}\"\\\']*$|^.*\\([^\\)\"\\\']*$|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$|^\\s*\\{\\}$'),
decreaseIndentPattern: new RegExp('^\\s*(\\s*/[*].*[*]/\\s*)*\\}|^\\s*(\\s*/[*].*[*]/\\s*)*\\)|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$'),
}
}));
}
}
let mode = new JSONMode();
let model = createTextModel(
[
'{',
' "scripts: {"',
' "watch": "a {"',
' "build{": "b"',
' "tasks": []',
' "tasks": ["a"]',
' "}"',
'"}"'
].join('\n'),
{
tabSize: 2,
indentSize: 2
},
mode.getLanguageIdentifier()
);
withTestCodeEditor(null, { model: model, autoIndent: true }, (editor, cursor) => {
moveTo(cursor, 3, 19, false);
assertCursor(cursor, new Selection(3, 19, 3, 19));
cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard');
assert.deepEqual(model.getLineContent(4), ' ');
moveTo(cursor, 5, 18, false);
assertCursor(cursor, new Selection(5, 18, 5, 18));
cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard');
assert.deepEqual(model.getLineContent(6), ' ');
moveTo(cursor, 7, 15, false);
assertCursor(cursor, new Selection(7, 15, 7, 15));
cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard');
assert.deepEqual(model.getLineContent(8), ' ');
assert.deepEqual(model.getLineContent(9), ' ]');
moveTo(cursor, 10, 18, false);
assertCursor(cursor, new Selection(10, 18, 10, 18));
cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard');
assert.deepEqual(model.getLineContent(11), ' ]');
});
model.dispose();
mode.dispose();
});
});
interface ICursorOpts {
......
......@@ -597,8 +597,16 @@ export class CustomTreeView extends Disposable implements ITreeView {
private async doRefresh(elements: ITreeItem[]): Promise<void> {
if (this.tree) {
this.refreshing = true;
await Promise.all(elements.map(element => this.tree.updateChildren(element, true)));
elements.map(element => this.tree.rerender(element));
const parents: Set<ITreeItem> = new Set<ITreeItem>();
elements.forEach(element => {
if (element !== this.root) {
const parent = this.tree.getParentElement(element);
parents.add(parent);
} else {
parents.add(element);
}
});
await Promise.all(Array.from(parents.values()).map(element => this.tree.updateChildren(element, true)));
this.refreshing = false;
this.updateContentAreas();
if (this.focused) {
......
......@@ -970,14 +970,9 @@ export class SettingsEditor2 extends BaseEditor {
// If a single setting is being refreshed, it's ok to refresh now if that is not the focused setting
if (key) {
const focusedKey = focusedSetting.getAttribute(AbstractSettingRenderer.SETTING_KEY_ATTR);
/**
* Update `list`s live if focused item is whole list or list item,
* as they have a separate "submit edit" step built in before this
*/
if (
focusedKey === key &&
!DOM.hasClass(focusedSetting, 'setting-item-list') &&
!DOM.hasClass(focusedSetting, 'setting-item-contents')
if (focusedKey === key &&
// update `list`s live, as they have a separate "submit edit" step built in before this
(focusedSetting.parentElement && !DOM.hasClass(focusedSetting.parentElement, 'setting-item-list'))
) {
this.updateModifiedLabelForKey(key);
......
......@@ -450,11 +450,11 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ResizePaneDownTe
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ScrollToPreviousCommandAction, ScrollToPreviousCommandAction.ID, ScrollToPreviousCommandAction.LABEL, {
primary: 0,
mac: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow }
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Scroll To Previous Command', category);
}, ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())), 'Terminal: Scroll To Previous Command', category);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ScrollToNextCommandAction, ScrollToNextCommandAction.ID, ScrollToNextCommandAction.LABEL, {
primary: 0,
mac: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow }
}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Scroll To Next Command', category);
}, ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())), 'Terminal: Scroll To Next Command', category);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectToPreviousCommandAction, SelectToPreviousCommandAction.ID, SelectToPreviousCommandAction.LABEL, {
primary: 0,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow }
......
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SimpleFindWidget } from 'vs/editor/contrib/find/simpleFindWidget';
import { SimpleFindWidget } from 'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_INPUT_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/contrib/terminal/common/terminal';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
......
......@@ -1445,7 +1445,8 @@ export class TerminalInstance implements ITerminalInstance {
}
public toggleEscapeSequenceLogging(): void {
this._xterm.setOption('logLevel', 'debug');
const isDebug = this._xterm.getOption('logLevel') === 'debug';
this._xterm.setOption('logLevel', isDebug ? 'info' : 'debug');
}
public getInitialCwd(): Promise<string> {
......
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SimpleFindWidget } from 'vs/editor/contrib/find/simpleFindWidget';
import { SimpleFindWidget } from 'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
......@@ -54,4 +54,4 @@ export class WebviewFindWidget extends SimpleFindWidget {
protected onFindInputFocusTrackerFocus() { }
protected onFindInputFocusTrackerBlur() { }
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册