Merge remote-tracking branch 'origin/master'

This commit is contained in:
João Moreno 2020-11-05 15:18:06 +01:00
commit 5afaec5c21
No known key found for this signature in database
GPG key ID: 896B853774D1A575
17 changed files with 164 additions and 21 deletions

View file

@ -347,7 +347,9 @@ export class CommandCenter {
right = toGitUri(resource.resourceUri, resource.resourceGroupType === ResourceGroupType.Index ? 'index' : 'wt', { submoduleOf: repository.root });
}
} else {
if (resource.type !== Status.DELETED_BY_THEM) {
if (resource.type === Status.DELETED_BY_US || resource.type === Status.DELETED_BY_THEM) {
left = toGitUri(resource.resourceUri, '~1');
} else {
left = this.getLeftResource(resource);
}

View file

@ -5737,4 +5737,4 @@
"match": "\\S+"
}
}
}
}

View file

@ -5737,4 +5737,4 @@
"match": "\\S+"
}
}
}
}

View file

@ -14,4 +14,4 @@
}
],
"version": 1
}
}

View file

@ -210,4 +210,4 @@
]
}
}
}
}

View file

@ -210,4 +210,4 @@
]
}
}
}
}

View file

@ -26,7 +26,19 @@
],
"license": "TextMate Bundle License",
"version": "0.0.0"
},
{
"component": {
"type": "git",
"git": {
"name": "microsoft/vscode-markdown-tm-grammar",
"repositoryUrl": "https://github.com/microsoft/vscode-markdown-tm-grammar",
"commitHash": "11cf764606cb2cde54badb5d0e5a0758a8871c4b"
}
},
"license": "MIT",
"version": "0.0.0"
}
],
"version": 1
}
}

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/4be9cb335581f3559166c319607dac9100103083",
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/f051a36bd9713dd722cbe1bdde9c8240d12f00b4",
"name": "Markdown",
"scopeName": "text.html.markdown",
"patterns": [
@ -2190,9 +2190,18 @@
},
"13": {
"name": "punctuation.definition.string.end.markdown"
},
"14": {
"name": "string.other.link.description.title.markdown"
},
"15": {
"name": "punctuation.definition.string.begin.markdown"
},
"16": {
"name": "punctuation.definition.string.end.markdown"
}
},
"match": "(?x)\n \\s* # Leading whitespace\n (\\[)([^]]+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n",
"match": "(?x)\n \\s* # Leading whitespace\n (\\[)([^]]+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in double quotes…\n | ((').+?(')) # or in single quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n",
"name": "meta.link.reference.def.markdown"
},
"list_paragraph": {
@ -2453,10 +2462,19 @@
"name": "punctuation.definition.string.markdown"
},
"15": {
"name": "string.other.link.description.title.markdown"
},
"16": {
"name": "punctuation.definition.string.markdown"
},
"17": {
"name": "punctuation.definition.string.markdown"
},
"18": {
"name": "punctuation.definition.metadata.markdown"
}
},
"match": "(?x)\n (\\!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
"match": "(?x)\n (\\!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in double quotes…\n | ((').+?(')) # or in single quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
"name": "meta.image.inline.markdown"
},
"image-ref": {
@ -2616,10 +2634,19 @@
"name": "punctuation.definition.string.end.markdown"
},
"16": {
"name": "string.other.link.description.title.markdown"
},
"17": {
"name": "punctuation.definition.string.begin.markdown"
},
"18": {
"name": "punctuation.definition.string.end.markdown"
},
"19": {
"name": "punctuation.definition.metadata.markdown"
}
},
"match": "(?x)\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
"match": "(?x)\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in double quotes…\n | ((').+?(')) # or in single quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
"name": "meta.link.inline.markdown"
},
"link-ref": {

View file

@ -6,12 +6,12 @@
"git": {
"name": "rust-syntax",
"repositoryUrl": "https://github.com/dustypomerleau/rust-syntax",
"commitHash": "f3eb2221c8c334f1aae1fbc7af9a6c0b753bb29b"
"commitHash": "19f9aa86c0850b98db175754f019a2e79413353e"
}
},
"license": "MIT",
"description": "A TextMate-style grammar for Rust.",
"version": "0.2.10"
"version": "0.2.13"
}
],
"version": 1

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/dustypomerleau/rust-syntax/commit/f3eb2221c8c334f1aae1fbc7af9a6c0b753bb29b",
"version": "https://github.com/dustypomerleau/rust-syntax/commit/19f9aa86c0850b98db175754f019a2e79413353e",
"name": "Rust",
"scopeName": "source.rust",
"patterns": [
@ -141,6 +141,12 @@
}
},
"patterns": [
{
"include": "#block-comments"
},
{
"include": "#comments"
},
{
"include": "#keywords"
},
@ -458,7 +464,7 @@
"name": "punctuation.brackets.angle.rust"
}
},
"end": "\\{",
"end": "\\{|;",
"endCaptures": {
"0": {
"name": "punctuation.brackets.curly.rust"
@ -540,9 +546,66 @@
{
"include": "#lvariables"
},
{
"include": "#constants"
},
{
"include": "#gtypes"
},
{
"include": "#functions"
},
{
"include": "#lifetimes"
},
{
"include": "#macros"
},
{
"include": "#namespaces"
},
{
"include": "#punctuation"
},
{
"include": "#strings"
},
{
"include": "#types"
},
{
"include": "#variables"
}
]
},
{
"comment": "function/method calls with turbofish",
"name": "meta.function.call.rust",
"begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::<.*>\\()",
"beginCaptures": {
"1": {
"name": "entity.name.function.rust"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.brackets.round.rust"
}
},
"patterns": [
{
"include": "#block-comments"
},
{
"include": "#comments"
},
{
"include": "#keywords"
},
{
"include": "#lvariables"
},
{
"include": "#constants"
},
@ -558,6 +621,9 @@
{
"include": "#macros"
},
{
"include": "#namespaces"
},
{
"include": "#punctuation"
},

View file

@ -14,4 +14,4 @@
}
],
"version": 1
}
}

View file

@ -516,4 +516,4 @@
]
}
}
}
}

View file

@ -69,6 +69,14 @@ export function count(value: string, character: string): number {
return result;
}
export function truncate(value: string, maxLength: number, suffix = '…'): string {
if (value.length <= maxLength) {
return value;
}
return `${value.substr(0, maxLength)}${suffix}`;
}
/**
* Removes all occurrences of needle from the beginning and end of haystack.
* @param haystack string to trim

View file

@ -417,4 +417,9 @@ suite('Strings', () => {
test('getGraphemeBreakType', () => {
assert.equal(strings.getGraphemeBreakType(0xBC1), strings.GraphemeBreakType.SpacingMark);
});
test('truncate', () => {
assert.equal('hello world', strings.truncate('hello world', 100));
assert.equal('hello…', strings.truncate('hello world', 5));
});
});

View file

@ -142,7 +142,7 @@ export class ChokidarWatcherService extends Disposable implements IWatcherServic
}
if (this.verboseLogging) {
this.log(`Start watching with chockidar: ${realBasePath}, excludes: ${excludes.join(',')}, usePolling: ${usePolling ? 'true, interval ' + pollingInterval : 'false'}`);
this.log(`Start watching with chokidar: ${realBasePath}, excludes: ${excludes.join(',')}, usePolling: ${usePolling ? 'true, interval ' + pollingInterval : 'false'}`);
}
let chokidarWatcher: chokidar.FSWatcher | null = chokidar.watch(realBasePath, watcherOpts);

View file

@ -23,6 +23,7 @@ import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remot
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { isWeb } from 'vs/base/common/platform';
import { once } from 'vs/base/common/functional';
import { truncate } from 'vs/base/common/strings';
export class RemoteStatusIndicator extends Disposable implements IWorkbenchContribution {
@ -200,10 +201,10 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
this.renderRemoteStatusIndicator(nls.localize('host.open', "Opening Remote..."), nls.localize('host.open', "Opening Remote..."), undefined, true /* progress */);
break;
case 'disconnected':
this.renderRemoteStatusIndicator(`$(alert) ${nls.localize('disconnectedFrom', "Disconnected from {0}", hostLabel)}`, nls.localize('host.tooltipDisconnected', "Disconnected from {0}", hostLabel));
this.renderRemoteStatusIndicator(`$(alert) ${nls.localize('disconnectedFrom', "Disconnected from {0}", truncate(hostLabel, 40))}`, nls.localize('host.tooltipDisconnected', "Disconnected from {0}", hostLabel));
break;
default:
this.renderRemoteStatusIndicator(`$(remote) ${hostLabel}`, nls.localize('host.tooltip', "Editing on {0}", hostLabel));
this.renderRemoteStatusIndicator(`$(remote) ${truncate(hostLabel, 40)}`, nls.localize('host.tooltip', "Editing on {0}", hostLabel));
}
}

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ICodeEditor, isCodeEditor, isDiffEditor, isCompositeEditor } from 'vs/editor/browser/editorBrowser';
import { ICodeEditor, isCodeEditor, isDiffEditor, isCompositeEditor, getCodeEditor } from 'vs/editor/browser/editorBrowser';
import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl';
import { ScrollType } from 'vs/editor/common/editorCommon';
import { IResourceEditorInput } from 'vs/platform/editor/common/editor';
@ -69,12 +69,34 @@ export class CodeEditorService extends CodeEditorServiceImpl {
}
private async doOpenCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
// Special case: we want to detect the request to open an editor that
// is different from the current one to decide wether the current editor
// should be pinned or not. This ensures that the source of a navigation
// is not being replaced by the target. An example is "Goto definition"
// that otherwise would replace the editor everytime the user navigates.
if (
source && // we need to know the origin of the navigation
!input.options?.pinned && // we only need to look at preview editors that open
!sideBySide && // we only need to care if editor opens in same group
!isEqual(source.getModel()?.uri, input.resource) // we only need to do this if the editor is about to change
) {
for (const visiblePane of this.editorService.visibleEditorPanes) {
if (getCodeEditor(visiblePane.getControl()) === source) {
visiblePane.group.pinEditor();
break;
}
}
}
// Open as editor
const control = await this.editorService.openEditor(input, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
if (control) {
const widget = control.getControl();
if (isCodeEditor(widget)) {
return widget;
}
if (isCompositeEditor(widget) && isCodeEditor(widget.activeCodeEditor)) {
return widget.activeCodeEditor;
}