Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into octref/live-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Mar 18, 2020
2 parents 600a776 + 1c2c8ba commit 196562b
Show file tree
Hide file tree
Showing 66 changed files with 10,065 additions and 242 deletions.
142 changes: 0 additions & 142 deletions .github/commands.yml
Original file line number Diff line number Diff line change
@@ -1,154 +1,12 @@
# {
# perform: true,
# commands: [
# {
# type: 'comment',
# name: 'findDuplicates',
# allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
# action: 'comment',
# comment: "Potential duplicates:\n${potentialDuplicates}"
# }
# ]
# }

{
perform: true,
commands: [
{
type: 'comment',
name: 'question',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: '*question'
},
{
type: 'label',
name: '*question',
allowTriggerByBot: true,
action: 'close',
comment: "Please ask your question on [StackOverflow](https://aka.ms/vscodestackoverflow). We have a great community over [there](https://aka.ms/vscodestackoverflow). They have already answered thousands of questions and are happy to answer yours as well. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
},
{
type: 'label',
name: '*dev-question',
allowTriggerByBot: true,
action: 'close',
comment: "We have a great developer community [over on slack](https://aka.ms/vscode-dev-community) where extension authors help each other. This is a great place for you to ask questions and find support.\n\nHappy Coding!"
},
{
type: 'label',
name: '*extension-candidate',
allowTriggerByBot: true,
action: 'close',
comment: "We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the [VS Code Marketplace](https://aka.ms/vscodemarketplace). Just in case, in a few simple steps you can get started [writing your own extension](https://aka.ms/vscodewritingextensions). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
},
{
type: 'label',
name: '*not-reproducible',
allowTriggerByBot: true,
action: 'close',
comment: "We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines might help you with that.\n\nHappy Coding!"
},
{
type: 'label',
name: '*out-of-scope',
allowTriggerByBot: true,
action: 'close',
comment: "We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process [here](https://aka.ms/vscode-out-of-scope). If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.\n\nIf you wonder what we are up to, please see our [roadmap](https://aka.ms/vscoderoadmap) and [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nThanks for your understanding and happy coding!"
},
{
type: 'comment',
name: 'causedByExtension',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: '*caused-by-extension'
},
{
type: 'label',
name: '*caused-by-extension',
allowTriggerByBot: true,
action: 'close',
comment: "This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the [marketplace](https://aka.ms/vscodemarketplace) for VS Code. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
},
{
type: 'label',
name: '*as-designed',
allowTriggerByBot: true,
action: 'close',
comment: "The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
},
{
type: 'label',
name: '*english-please',
allowTriggerByBot: true,
action: 'close',
comment: "This issue is being closed because its description is not in English, that makes it hard for us to work on it. Please open a new issue with an English description. You might find [Bing Translator](https://www.bing.com/translator) useful."
},
{
type: 'comment',
name: 'duplicate',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: '*duplicate'
},
{
type: 'label',
name: '*duplicate',
allowTriggerByBot: true,
action: 'close',
comment: "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues [here](https://aka.ms/vscodeissuesearch). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
},
{
type: 'comment',
name: 'confirm',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'confirmed',
removeLabel: 'confirmation-pending'
},
{
type: 'comment',
name: 'confirmationPending',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'confirmation-pending',
removeLabel: 'confirmed'
},
{
type: 'comment',
name: 'findDuplicates',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'comment',
comment: "Potential duplicates:\n${potentialDuplicates}"
},
{
type: 'comment',
name: 'needsMoreInfo',
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'needs more info',
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
},
{
type: 'label',
name: '~needs more info',
action: 'updateLabels',
addLabel: 'needs more info',
removeLabel: '~needs more info',
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
},
{
type: 'comment',
name: 'a11ymas',
allowUsers: ['AccessibilityTestingTeam-TCS', 'dixitsonali95', 'Mohini78', 'ChitrarupaSharma', 'mspatil110', 'umasarath52', 'v-umnaik'],
action: 'updateLabels',
addLabel: 'a11ymas'
},
{
type: 'label',
name: '*off-topic',
action: 'close',
comment: "Thanks for creating this issue. We think this issue is unactionable or unrelated to the goals of this project. Please follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
}
]
}
10 changes: 5 additions & 5 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
with:
repository: 'JacksonKearl/vscode-triage-github-actions'
ref: v2
# - name: Run Commands
# uses: ./commands
# with:
# token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
# config-path: commands
- name: Run Commands
uses: ./commands
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
config-path: commands
24 changes: 12 additions & 12 deletions .github/workflows/copycat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
with:
repository: 'JacksonKearl/vscode-triage-github-actions'
ref: v2
# - name: Run CopyCat (JacksonKearl/testissues)
# uses: ./copycat
# with:
# token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
# owner: JacksonKearl
# repo: testissues
# - name: Run CopyCat (chrmarti/testissues)
# uses: ./copycat
# with:
# token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
# owner: chrmarti
# repo: testissues
- name: Run CopyCat (JacksonKearl/testissues)
uses: ./copycat
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
owner: JacksonKearl
repo: testissues
- name: Run CopyCat (chrmarti/testissues)
uses: ./copycat
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
owner: chrmarti
repo: testissues
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
"name": "vs/workbench/contrib/preferences",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/notebook",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/quickaccess",
"project": "vscode-workbench"
Expand Down
24 changes: 21 additions & 3 deletions src/vs/base/browser/ui/list/listView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,32 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
this.scrollableElement.triggerScrollFromMouseWheelEvent(browserEvent);
}

updateElementHeight(index: number, size: number): void {
updateElementHeight(index: number, size: number, anchorIndex: number | null): void {
if (this.items[index].size === size) {
return;
}

const lastRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);

const heightDiff = index < lastRenderRange.start ? size - this.items[index].size : 0;
let heightDiff = 0;

if (index < lastRenderRange.start) {
// do not scroll the viewport if resized element is out of viewport
heightDiff = size - this.items[index].size;
} else {
if (anchorIndex !== null && anchorIndex > index && anchorIndex <= lastRenderRange.end) {
// anchor in viewport
// resized elemnet in viewport and above the anchor
heightDiff = size - this.items[index].size;
} else {
heightDiff = 0;
}
}

this.rangeMap.splice(index, 1, [{ size: size }]);
this.items[index].size = size;

this.render(lastRenderRange, this.lastRenderTop + heightDiff, this.lastRenderHeight, undefined, undefined, true);
this.render(lastRenderRange, Math.max(0, this.lastRenderTop + heightDiff), this.lastRenderHeight, undefined, undefined, true);

this.eventuallyUpdateScrollDimensions();

Expand Down Expand Up @@ -1134,6 +1148,10 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
return 0;
}

if (!!this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(item.element)) {
return 0;
}

const size = item.size;

if (!this.setRowHeight && item.row && item.row.domNode) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
}

updateElementHeight(index: number, size: number): void {
this.view.updateElementHeight(index, size);
this.view.updateElementHeight(index, size, null);
}

rerender(): void {
Expand Down
10 changes: 9 additions & 1 deletion src/vs/base/common/iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ export namespace Iterable {
return false;
}

export function* map<T, R>(iterable: Iterable<T>, fn: (t: T) => R): IterableIterator<R> {
export function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {
for (const element of iterable) {
if (predicate(element)) {
return yield element;
}
}
}

export function* map<T, R>(iterable: Iterable<T>, fn: (t: T) => R): Iterable<R> {
for (const element of iterable) {
return yield fn(element);
}
Expand Down
10 changes: 10 additions & 0 deletions src/vs/editor/browser/editorBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,16 @@ export function isDiffEditor(thing: any): thing is IDiffEditor {
}
}

/**
*@internal
*/
export function isCompositeEditor(thing: any): thing is editorCommon.ICompositeCodeEditor {
return thing
&& typeof thing === 'object'
&& typeof (<editorCommon.ICompositeCodeEditor>thing).onDidChangeActiveEditor === 'function';

}

/**
*@internal
*/
Expand Down
19 changes: 19 additions & 0 deletions src/vs/editor/common/editorCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { IMarkdownString } from 'vs/base/common/htmlContent';
import { IDisposable } from 'vs/base/common/lifecycle';
import { Event } from 'vs/base/common/event';
import { URI, UriComponents } from 'vs/base/common/uri';
import { ConfigurationChangedEvent, IComputedEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions';
import { IPosition, Position } from 'vs/editor/common/core/position';
Expand Down Expand Up @@ -529,6 +530,24 @@ export interface IDiffEditor extends IEditor {
getModifiedEditor(): IEditor;
}

/**
* @internal
*/
export interface ICompositeCodeEditor {

/**
* An event that signals that the active editor has changed
*/
readonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;

/**
* The active code editor iff any
*/
readonly activeCodeEditor: IEditor | undefined;
// readonly editors: readonly ICodeEditor[] maybe supported with uris
}


/**
* An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.
*/
Expand Down
6 changes: 6 additions & 0 deletions src/vs/editor/common/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ export interface ITextModel {
*/
equalsTextBuffer(other: ITextBuffer): boolean;

/**
* Get the underling text buffer.
* @internal
*/
getTextBuffer(): ITextBuffer;

/**
* Get the text in a certain range.
* @param range The range describing what text to get.
Expand Down
5 changes: 5 additions & 0 deletions src/vs/editor/common/model/textModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ export class TextModel extends Disposable implements model.ITextModel {
return this._buffer.equals(other);
}

public getTextBuffer(): model.ITextBuffer {
this._assertNotDisposed();
return this._buffer;
}

private _emitContentChangedEvent(rawChange: ModelRawContentChangedEvent, change: IModelContentChangedEvent): void {
if (this._isDisposing) {
// Do not confuse listeners by emitting any event after disposing
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/contrib/find/findDecorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export class FindDecorations implements IDisposable {
return result;
}

private static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({
public static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
zIndex: 13,
className: 'currentFindMatch',
Expand All @@ -276,7 +276,7 @@ export class FindDecorations implements IDisposable {
}
});

private static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({
public static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
className: 'findMatch',
showIfCollapsed: true,
Expand All @@ -290,7 +290,7 @@ export class FindDecorations implements IDisposable {
}
});

private static readonly _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({
public static readonly _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
className: 'findMatch',
showIfCollapsed: true
Expand Down
4 changes: 2 additions & 2 deletions src/vs/platform/actions/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,14 @@ export function registerAction2(ctor: { new(): Action2 }): IDisposable {
KeybindingsRegistry.registerKeybindingRule({
...item,
id: command.id,
when: ContextKeyExpr.and(command.precondition, item.when)
when: command.precondition ? ContextKeyExpr.and(command.precondition, item.when) : item.when
});
}
} else if (keybinding) {
KeybindingsRegistry.registerKeybindingRule({
...keybinding,
id: command.id,
when: ContextKeyExpr.and(command.precondition, keybinding.when)
when: command.precondition ? ContextKeyExpr.and(command.precondition, keybinding.when) : keybinding.when
});
}

Expand Down
Loading

0 comments on commit 196562b

Please sign in to comment.