Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tyriar/terminal_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Nov 5, 2021
2 parents 4400020 + c7a84f9 commit ae66110
Show file tree
Hide file tree
Showing 77 changed files with 812 additions and 439 deletions.
9 changes: 6 additions & 3 deletions build/azure-pipelines/publish-types/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ trigger:

pr: none

pool:
vmImage: ubuntu-latest

steps:
- task: NodeTool@0
inputs:
Expand All @@ -17,7 +20,7 @@ steps:

- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
CHANNEL="G1C14HJ2F"
CHANNEL="C1C14HJ2F"
if [ "$TAG_VERSION" == "1.999.0" ]; then
MESSAGE="<!here>. Someone pushed 1.999.0 tag. Please delete it ASAP from remote and local."
Expand Down Expand Up @@ -59,11 +62,11 @@ steps:
- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
CHANNEL="G1C14HJ2F"
CHANNEL="C1C14HJ2F"
MESSAGE="DefinitelyTyped/DefinitelyTyped#vscode-types-$TAG_VERSION created. Endgame champion, please open this link, examine changes and create a PR:"
LINK="https://github.com/DefinitelyTyped/DefinitelyTyped/compare/vscode-types-$TAG_VERSION?quick_pull=1&body=Updating%20VS%20Code%20Extension%20API.%20See%20https%3A%2F%2Fgit.luolix.top%2Fmicrosoft%2Fvscode%2Fissues%2F70175%20for%20details."
MESSAGE2="[@eamodio, @jrieken, @kmaetzel, @egamma]. Please review and merge PR to publish @types/vscode."
MESSAGE2="[@jrieken, @kmaetzel, @egamma]. Please review and merge PR to publish @types/vscode."
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
Expand Down
3 changes: 2 additions & 1 deletion extensions/git/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1927,8 +1927,9 @@ export class Repository implements Disposable {
if (HEAD !== undefined) {
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
const showActionButton = config.get<string>('showUnpublishedCommitsButton', 'whenEmpty');
const postCommitCommand = config.get<string>('postCommitCommand');

if (showActionButton === 'always' || (showActionButton === 'whenEmpty' && workingTree.length === 0 && index.length === 0 && untracked.length === 0 && merge.length === 0)) {
if (showActionButton === 'always' || (showActionButton === 'whenEmpty' && workingTree.length === 0 && index.length === 0 && untracked.length === 0 && merge.length === 0 && postCommitCommand !== 'sync' && postCommitCommand !== 'push')) {
if (HEAD.name && HEAD.commit) {
if (HEAD.upstream) {
if (HEAD.ahead) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/gulp/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class FolderDetector {
for (const filename of await fs.promises.readdir(root)) {

const ext = path.extname(filename);
if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') {
if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs' && ext !== '.ts') {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/markdown-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
"customEditors": [
{
"viewType": "vscode.markdown.preview.editor",
"displayName": "Markdown Preview (Experimental)",
"displayName": "Markdown Preview",
"priority": "option",
"selector": [
{
Expand Down
21 changes: 17 additions & 4 deletions extensions/markdown-language-features/preview-src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ window.addEventListener('message', async event => {

case 'updateView':
if (event.data.source === documentResource) {
console.log('updateView', event.data.line);
onUpdateView(event.data.line);
}
return;
Expand Down Expand Up @@ -155,7 +154,6 @@ window.addEventListener('message', async event => {
// Move styles to head
// This prevents an ugly flash of unstyled content
const styles = newRoot.querySelectorAll('link');

for (const style of styles) {
style.remove();
}
Expand All @@ -165,7 +163,22 @@ window.addEventListener('message', async event => {
childrenOnly: true,
onBeforeElUpdated: (fromEl, toEl) => {
if (areEqual(fromEl, toEl)) {
fromEl.setAttribute('data-line', toEl.getAttribute('data-line')!);
// areEqual doesn't look at `data-line` so copy those over

const fromLines = fromEl.querySelectorAll('[data-line]');
const toLines = fromEl.querySelectorAll('[data-line]');
if (fromLines.length !== toLines.length) {
console.log('unexpected line number change');
}

for (let i = 0; i < fromLines.length; ++i) {
const fromChild = fromLines[i];
const toChild = toLines[i];
if (toChild) {
fromChild.setAttribute('data-line', toChild.getAttribute('data-line')!);
}
}

return false;
}

Expand Down Expand Up @@ -241,7 +254,7 @@ document.addEventListener('click', event => {

window.addEventListener('scroll', throttle(() => {
updateScrollProgress();
console.log('scroll');

if (scrollDisabledCount > 0) {
scrollDisabledCount -= 1;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function activate(
new TypeScriptVersion(
TypeScriptVersionSource.Bundled,
vscode.Uri.joinPath(context.extensionUri, 'dist/browser/typescript/tsserver.web.js').toString(),
API.fromSimpleString('4.4.1')));
API.fromSimpleString('4.5.0')));

const lazyClientHost = createLazyClientHost(context, false, {
pluginManager,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "code-oss-dev",
"version": "1.62.0",
"version": "1.63.0",
"distro": "68b7698bb44bb140dfd35df9825ea6825edf87af",
"author": {
"name": "Microsoft Corporation"
Expand Down Expand Up @@ -205,7 +205,7 @@
"vinyl-fs": "^3.0.0",
"vscode-debugprotocol": "1.50.0",
"vscode-nls-dev": "^3.3.1",
"vscode-telemetry-extractor": "^1.8.0",
"vscode-telemetry-extractor": "^1.9.3",
"webpack": "^5.42.0",
"webpack-cli": "^4.7.2",
"webpack-stream": "^6.1.2",
Expand Down
44 changes: 37 additions & 7 deletions src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ export function computeScreenAwareSize(cssPx: number): number {
/**
* Open safely a new window. This is the best way to do so, but you cannot tell
* if the window was opened or if it was blocked by the browser's popup blocker.
* If you want to tell if the browser blocked the new window, use `windowOpenNoOpenerWithSuccess`.
* If you want to tell if the browser blocked the new window, use {@link windowOpenWithSuccess}.
*
* See https://github.com/microsoft/monaco-editor/issues/601
* To protect against malicious code in the linked site, particularly phishing attempts,
Expand All @@ -1201,19 +1201,49 @@ export function windowOpenNoOpener(url: string): void {
}

/**
* Open safely a new window. This technique is not appropriate in certain contexts,
* like for example when the JS context is executing inside a sandboxed iframe.
* If it is not necessary to know if the browser blocked the new window, use
* `windowOpenNoOpener`.
* Open a new window in a popup. This is the best way to do so, but you cannot tell
* if the window was opened or if it was blocked by the browser's popup blocker.
* If you want to tell if the browser blocked the new window, use {@link windowOpenWithSuccess}.
*
* Note: this does not set {@link window.opener} to null. This is to allow the opened popup to
* be able to use {@link window.close} to close itself. Because of this, you should only use
* this function on urls that you trust.
*
* In otherwords, you should almost always use {@link windowOpenNoOpener} instead of this function.
*/
const popupWidth = 780, popupHeight = 640;
export function windowOpenPopup(url: string): void {
const left = Math.floor(window.screenLeft + window.innerWidth / 2 - popupWidth / 2);
const top = Math.floor(window.screenTop + window.innerHeight / 2 - popupHeight / 2);
window.open(
url,
'_blank',
`width=${popupWidth},height=${popupHeight},top=${top},left=${left}`
);
}

/**
* Attempts to open a window and returns whether it succeeded. This technique is
* not appropriate in certain contexts, like for example when the JS context is
* executing inside a sandboxed iframe. If it is not necessary to know if the
* browser blocked the new window, use {@link windowOpenNoOpener}.
*
* See https://github.com/microsoft/monaco-editor/issues/601
* See https://github.com/microsoft/monaco-editor/issues/2474
* See https://mathiasbynens.github.io/rel-noopener/
*
* @param url the url to open
* @param noOpener whether or not to set the {@link window.opener} to null. You should leave the default
* (true) unless you trust the url that is being opened.
* @returns boolean indicating if the {@link window.open} call succeeded
*/
export function windowOpenNoOpenerWithSuccess(url: string): boolean {
export function windowOpenWithSuccess(url: string, noOpener = true): boolean {
const newTab = window.open();
if (newTab) {
(newTab as any).opener = null;
if (noOpener) {
// see `windowOpenNoOpener` for details on why this is important
(newTab as any).opener = null;
}
newTab.location.href = url;
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/base/common/codicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export namespace CSSIcon {
export const iconNameSegment = '[A-Za-z0-9]+';
export const iconNameExpression = '[A-Za-z0-9\\-]+';
export const iconModifierExpression = '~[A-Za-z]+';
export const iconNameCharacter = '[A-Za-z0-9\\-~]';

const cssIconIdRegex = new RegExp(`^(${iconNameExpression})(${iconModifierExpression})?$`);

Expand Down
3 changes: 2 additions & 1 deletion src/vs/base/common/iconLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ltrim } from 'vs/base/common/strings';
export const iconStartMarker = '$(';

const iconsRegex = new RegExp(`\\$\\(${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?\\)`, 'g'); // no capturing groups
const iconNameCharacterRegexp = new RegExp(CSSIcon.iconNameCharacter);

const escapeIconsRegex = new RegExp(`(\\\\)?${iconsRegex.source}`, 'g');
export function escapeIcons(text: string): string {
Expand Down Expand Up @@ -103,7 +104,7 @@ function doParseLabelWithIcons(text: string, firstIconIndex: number): IParsedLab
// within icon
else if (currentIconStart !== -1) {
// Make sure this is a real icon name
if (/^[a-z0-9\-]$/i.test(char)) {
if (iconNameCharacterRegexp.test(char)) {
currentIconValue += char;
} else {
// This is not a real icon, treat it as text
Expand Down
5 changes: 5 additions & 0 deletions src/vs/base/test/common/iconLabels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ suite('Icon Labels', () => {
filterOk(matchesFuzzyIconAware, 'unt', parseLabelWithIcons('$(primitive-dot) $(file-text) Untitled-1'), [
{ start: 30, end: 33 },
]);

// Testing #136172
filterOk(matchesFuzzyIconAware, 's', parseLabelWithIcons('$(loading~spin) start'), [
{ start: 16, end: 17 },
]);
});

test('stripIcons', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class SharedProcessMain extends Disposable {
this._register(toDisposable(() => collectorAppender.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
appenders.push(collectorAppender);
}
const appInsightsAppender = new AppInsightsAppender('monacoworkbench', null, productService.aiConfig.asimovKey, insiders ? false : testCollector);
const appInsightsAppender = new AppInsightsAppender('monacoworkbench', null, productService.aiConfig.asimovKey, insiders ? false : testCollector, testCollector && insiders);
this._register(toDisposable(() => appInsightsAppender.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
appenders.push(appInsightsAppender);
}
Expand Down
7 changes: 5 additions & 2 deletions src/vs/editor/common/model/bracketPairs/bracketPairsImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ export class BracketPairs extends Disposable implements IBracketPairs {
this.onDidChangeEmitter.fire();
}
} else {
this.bracketPairsTree.clear();
this.onDidChangeEmitter.fire();
if (this.bracketPairsTree.value) {
this.bracketPairsTree.clear();
// Important: Don't call fire if there was no change!
this.onDidChangeEmitter.fire();
}
}
}

Expand Down
Loading

0 comments on commit ae66110

Please sign in to comment.