提交 197b7a17 编写于 作者: A Alex Dima

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

......@@ -21,7 +21,7 @@ export function activate(context: ExtensionContext) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'cssServerMain.js'));
// The debug options for the server
let debugOptions = { execArgv: ['--nolazy', '--inspect=6004'] };
let debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -8,7 +8,7 @@
"node": "*"
},
"dependencies": {
"vscode-css-languageservice": "^3.0.2",
"vscode-css-languageservice": "^3.0.3",
"vscode-languageserver": "^3.5.0"
},
"devDependencies": {
......
......@@ -122,7 +122,7 @@ function updateConfiguration(settings: Settings) {
}
let pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {};
const validationDelayMs = 200;
const validationDelayMs = 500;
// The content of a text document has changed. This event is emitted
// when the text document first opened or when its content has changed.
......
......@@ -6,9 +6,9 @@
version "7.0.43"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
vscode-css-languageservice@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.2.tgz#ae0c43836318455aa290c777556394d6127b8f6c"
vscode-css-languageservice@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.3.tgz#02cc4efa5335f5104e0a2f3b6920faaf59db4f7a"
dependencies:
vscode-languageserver-types "3.5.0"
vscode-nls "^2.0.1"
......
......@@ -701,11 +701,21 @@
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "1_modification"
},
{
"command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "navigation"
},
{
"command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "inline"
},
{
"command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "inline0"
},
{
"command": "git.openChange",
"when": "scmProvider == git && scmResourceGroup == index",
......@@ -731,6 +741,11 @@
"when": "scmProvider == git && scmResourceGroup == index",
"group": "inline"
},
{
"command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == index",
"group": "inline0"
},
{
"command": "git.openChange",
"when": "scmProvider == git && scmResourceGroup == workingTree",
......@@ -766,6 +781,11 @@
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline"
},
{
"command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline0"
},
{
"command": "git.ignore",
"when": "scmProvider == git && scmResourceGroup == workingTree",
......@@ -979,4 +999,4 @@
"@types/which": "^1.0.28",
"mocha": "^3.2.0"
}
}
}
\ No newline at end of file
......@@ -504,7 +504,10 @@ export class CommandCenter {
}
if (resource) {
uris = [...resourceStates.map(r => r.resourceUri), resource.resourceUri];
const resources = ([resource, ...resourceStates] as Resource[])
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED);
uris = resources.map(r => r.resourceUri);
}
}
......@@ -1313,25 +1316,26 @@ export class CommandCenter {
return;
}
const picks = remotes.map(r => ({ label: r.name, description: r.url }));
const remotePicks = remotes.map(r => ({ label: r.name, description: r.url }));
const placeHolder = localize('pick remote pull repo', "Pick a remote to pull the branch from");
const pick = await window.showQuickPick(picks, { placeHolder });
const remotePick = await window.showQuickPick(remotePicks, { placeHolder });
if (!pick) {
if (!remotePick) {
return;
}
const branchName = await window.showInputBox({
placeHolder: localize('branch name', "Branch name"),
prompt: localize('provide branch name', "Please provide a branch name"),
ignoreFocusOut: true
});
const remoteRefs = repository.refs;
const remoteRefsFiltered = remoteRefs.filter(r => (r.remote === remotePick.label));
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name})) as {label : string; description : string}[];
const branchPick = await window.showQuickPick(branchPicks, { placeHolder });
if (!branchName) {
if (!branchPick) {
return;
}
repository.pull(false, pick.label, branchName);
const remoteCharCnt = remotePick.label.length;
repository.pull(false, remotePick.label, branchPick.label.slice(remoteCharCnt+1));
}
@command('git.pull', { repository: true })
......
......@@ -1150,7 +1150,7 @@ export class Repository {
}
async getRefs(): Promise<Ref[]> {
const result = await this.run(['for-each-ref', '--format', '%(refname) %(objectname)']);
const result = await this.run(['for-each-ref', '--format', '%(refname) %(objectname)', '--sort', '-committerdate']);
const fn = (line: string): Ref | null => {
let match: RegExpExecArray | null;
......
......@@ -8,7 +8,7 @@
import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, ConfigurationChangeEvent } from 'vscode';
import { Repository, RepositoryState } from './repository';
import { memoize, sequentialize, debounce } from './decorators';
import { dispose, anyEvent, filterEvent, IDisposable, isDescendant } from './util';
import { dispose, anyEvent, filterEvent, IDisposable, isDescendant, find, firstIndex } from './util';
import { Git, GitErrorCodes } from './git';
import * as path from 'path';
import * as fs from 'fs';
......@@ -27,7 +27,7 @@ class RepositoryPick implements QuickPickItem {
.join(' ');
}
constructor(public readonly repository: Repository) { }
constructor(public readonly repository: Repository, public readonly index: number) { }
}
export interface ModelChangeEvent {
......@@ -256,7 +256,16 @@ export class Model {
throw new Error(localize('no repositories', "There are no available repositories"));
}
const picks = this.openRepositories.map(e => new RepositoryPick(e.repository));
const picks = this.openRepositories.map((e, index) => new RepositoryPick(e.repository, index));
const active = window.activeTextEditor;
const repository = active && this.getRepository(active.document.fileName);
const index = firstIndex(picks, pick => pick.repository === repository);
// Move repository pick containing the active text editor to appear first
if (index > -1) {
picks.unshift(...picks.splice(index, 1));
}
const placeHolder = localize('pick repo', "Choose a repository");
const pick = await window.showQuickPick(picks, { placeHolder });
......
......@@ -105,7 +105,7 @@ export class Resource implements SourceControlResourceState {
}
};
private getIconPath(theme: string): Uri | undefined {
private getIconPath(theme: string): Uri {
switch (this.type) {
case Status.INDEX_MODIFIED: return Resource.Icons[theme].Modified;
case Status.MODIFIED: return Resource.Icons[theme].Modified;
......@@ -123,7 +123,6 @@ export class Resource implements SourceControlResourceState {
case Status.DELETED_BY_US: return Resource.Icons[theme].Conflict;
case Status.BOTH_ADDED: return Resource.Icons[theme].Conflict;
case Status.BOTH_MODIFIED: return Resource.Icons[theme].Conflict;
default: return void 0;
}
}
......@@ -182,7 +181,7 @@ export class Resource implements SourceControlResourceState {
return { strikeThrough, faded, tooltip, light, dark, letter, color, source: 'git.resource' /*todo@joh*/ };
}
get letter(): string | undefined {
get letter(): string {
switch (this.type) {
case Status.INDEX_MODIFIED:
case Status.MODIFIED:
......@@ -207,12 +206,10 @@ export class Resource implements SourceControlResourceState {
case Status.BOTH_ADDED:
case Status.BOTH_MODIFIED:
return 'C';
default:
return undefined;
}
}
get color(): ThemeColor | undefined {
get color(): ThemeColor {
switch (this.type) {
case Status.INDEX_MODIFIED:
case Status.MODIFIED:
......@@ -235,8 +232,6 @@ export class Resource implements SourceControlResourceState {
case Status.BOTH_ADDED:
case Status.BOTH_MODIFIED:
return new ThemeColor('gitDecoration.conflictingResourceForeground');
default:
return undefined;
}
}
......@@ -261,7 +256,7 @@ export class Resource implements SourceControlResourceState {
}
}
get resourceDecoration(): DecorationData | undefined {
get resourceDecoration(): DecorationData {
const title = this.tooltip;
const abbreviation = this.letter;
const color = this.color;
......
......@@ -195,6 +195,16 @@ export function uniqueFilter<T>(keyFn: (t: T) => string): (t: T) => boolean {
};
}
export function firstIndex<T>(array: T[], fn: (t: T) => boolean): number {
for (let i = 0; i < array.length; i++) {
if (fn(array[i])) {
return i;
}
}
return -1;
}
export function find<T>(array: T[], fn: (t: T) => boolean): T | undefined {
let result: T | undefined = undefined;
......
......@@ -39,7 +39,7 @@ export function activate(context: ExtensionContext) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'htmlServerMain.js'));
// The debug options for the server
let debugOptions = { execArgv: ['--nolazy', '--inspect=6004'] };
let debugOptions = { execArgv: ['--nolazy', '--inspect=6045'] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -168,7 +168,7 @@ connection.onDidChangeConfiguration((change) => {
});
let pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {};
const validationDelayMs = 200;
const validationDelayMs = 500;
// The content of a text document has changed. This event is emitted
// when the text document first opened or when its content has changed.
......
......@@ -67,7 +67,7 @@ export function activate(context: ExtensionContext) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'jsonServerMain.js'));
// The debug options for the server
let debugOptions = { execArgv: ['--nolazy', '--inspect'] };
let debugOptions = { execArgv: ['--nolazy', '--inspect=6046'] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -232,7 +232,7 @@ documents.onDidClose(event => {
});
let pendingValidationRequests: { [uri: string]: NodeJS.Timer; } = {};
const validationDelayMs = 200;
const validationDelayMs = 500;
function cleanPendingValidation(textDocument: TextDocument): void {
let request = pendingValidationRequests[textDocument.uri];
......
......@@ -23,7 +23,7 @@
["'", "'"]
],
"indentationRules": {
"increaseIndentPattern": "^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|(.*\\sdo\\b)|(.*=\\s*(case|if|unless)))\\b[^\\{;]*$",
"increaseIndentPattern": "^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|(\"|'|\/).*\\4)*(#.*)?$",
"decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)"
}
}
......@@ -750,7 +750,7 @@ export const MainContext = {
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors'),
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors'),
MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews'),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', ProxyType.CustomMarshaller),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures'),
MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages'),
MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService'),
MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService'),
......
......@@ -88,7 +88,7 @@ export class SCMMenus implements IDisposable {
const primary: IAction[] = [];
const secondary: IAction[] = [];
const result = { primary, secondary };
fillInActions(menu, { shouldForwardArgs: true }, result, g => g === 'inline');
fillInActions(menu, { shouldForwardArgs: true }, result, g => /^inline/.test(g));
menu.dispose();
contextKeyService.dispose();
......
......@@ -244,6 +244,9 @@ function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, ic
let languageIds = associations.languageIds;
if (languageIds) {
if (!languageIds.jsonc && languageIds.json) {
languageIds.jsonc = languageIds.json;
}
for (let languageId in languageIds) {
addSelector(`${qualifier} .${escapeCSS(languageId)}-lang-file-icon.file-icon::before`, languageIds[languageId]);
result.hasFileIcons = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册