Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 #7356

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"msjsdiag.debugger-for-chrome": "workspace"
},
"files.insertFinalNewline": true
}
}
9 changes: 1 addition & 8 deletions build/gulpfile.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ var editorEntryPoints = [
];

var editorResources = [
'out-build/vs/{base,editor}/**/*.{svg,png}',
'!out-build/vs/base/browser/ui/splitview/**/*',
'!out-build/vs/base/browser/ui/toolbar/**/*',
'!out-build/vs/base/browser/ui/octiconLabel/**/*',
'!out-build/vs/base/browser/ui/codiconLabel/**/*',
'!out-build/vs/workbench/**',
'!**/test/**'
'out-editor-build/vs/base/browser/ui/codiconLabel/**/*.ttf'
];

var BUNDLED_FILE_HEADER = [
Expand Down Expand Up @@ -92,7 +86,6 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
],
redirects: {
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
'vs/base/browser/ui/codiconLabel/codiconLabel': 'vs/base/browser/ui/codiconLabel/codiconLabel.mock',
},
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
Expand Down
52 changes: 27 additions & 25 deletions build/lib/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function createESMSourcesAndResources2(options) {
write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t'));
continue;
}
if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file)) {
if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) {
// Transport the files directly
write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file)));
continue;
Expand Down Expand Up @@ -250,35 +250,37 @@ function transportCSS(module, enqueue, write) {
const filename = path.join(SRC_DIR, module);
const fileContents = fs.readFileSync(filename).toString();
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
const inlineResourcesLimit = 300000; //3000; // see https://github.com/Microsoft/monaco-editor/issues/336
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64', inlineResourcesLimit);
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64');
write(module, newContents);
return true;
function _rewriteOrInlineUrls(contents, forceBase64, inlineByteLimit) {
function _rewriteOrInlineUrls(contents, forceBase64) {
return _replaceURL(contents, (url) => {
let imagePath = path.join(path.dirname(module), url);
let fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
if (fileContents.length < inlineByteLimit) {
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
let DATA = ';base64,' + fileContents.toString('base64');
if (!forceBase64 && /\.svg$/.test(url)) {
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
let newText = fileContents.toString()
.replace(/"/g, '\'')
.replace(/</g, '%3C')
.replace(/>/g, '%3E')
.replace(/&/g, '%26')
.replace(/#/g, '%23')
.replace(/\s+/g, ' ');
let encodedData = ',' + newText;
if (encodedData.length < DATA.length) {
DATA = encodedData;
}
const fontMatch = url.match(/^(.*).ttf\?(.*)$/);
if (fontMatch) {
const relativeFontPath = `${fontMatch[1]}.ttf`; // trim the query parameter
const fontPath = path.join(path.dirname(module), relativeFontPath);
enqueue(fontPath);
return relativeFontPath;
}
const imagePath = path.join(path.dirname(module), url);
const fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
let DATA = ';base64,' + fileContents.toString('base64');
if (!forceBase64 && /\.svg$/.test(url)) {
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
let newText = fileContents.toString()
.replace(/"/g, '\'')
.replace(/</g, '%3C')
.replace(/>/g, '%3E')
.replace(/&/g, '%26')
.replace(/#/g, '%23')
.replace(/\s+/g, ' ');
let encodedData = ',' + newText;
if (encodedData.length < DATA.length) {
DATA = encodedData;
}
return '"data:' + MIME + DATA + '"';
}
enqueue(imagePath);
return url;
return '"data:' + MIME + DATA + '"';
});
}
function _replaceURL(contents, replacer) {
Expand Down
57 changes: 29 additions & 28 deletions build/lib/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
continue;
}

if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file)) {
if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) {
// Transport the files directly
write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file)));
continue;
Expand Down Expand Up @@ -290,40 +290,41 @@ function transportCSS(module: string, enqueue: (module: string) => void, write:
const filename = path.join(SRC_DIR, module);
const fileContents = fs.readFileSync(filename).toString();
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
const inlineResourcesLimit = 300000;//3000; // see https://github.com/Microsoft/monaco-editor/issues/336

const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64', inlineResourcesLimit);
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64');
write(module, newContents);
return true;

function _rewriteOrInlineUrls(contents: string, forceBase64: boolean, inlineByteLimit: number): string {
function _rewriteOrInlineUrls(contents: string, forceBase64: boolean): string {
return _replaceURL(contents, (url) => {
let imagePath = path.join(path.dirname(module), url);
let fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));

if (fileContents.length < inlineByteLimit) {
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
let DATA = ';base64,' + fileContents.toString('base64');

if (!forceBase64 && /\.svg$/.test(url)) {
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
let newText = fileContents.toString()
.replace(/"/g, '\'')
.replace(/</g, '%3C')
.replace(/>/g, '%3E')
.replace(/&/g, '%26')
.replace(/#/g, '%23')
.replace(/\s+/g, ' ');
let encodedData = ',' + newText;
if (encodedData.length < DATA.length) {
DATA = encodedData;
}
}
return '"data:' + MIME + DATA + '"';
const fontMatch = url.match(/^(.*).ttf\?(.*)$/);
if (fontMatch) {
const relativeFontPath = `${fontMatch[1]}.ttf`; // trim the query parameter
const fontPath = path.join(path.dirname(module), relativeFontPath);
enqueue(fontPath);
return relativeFontPath;
}

enqueue(imagePath);
return url;
const imagePath = path.join(path.dirname(module), url);
const fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
let DATA = ';base64,' + fileContents.toString('base64');

if (!forceBase64 && /\.svg$/.test(url)) {
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
let newText = fileContents.toString()
.replace(/"/g, '\'')
.replace(/</g, '%3C')
.replace(/>/g, '%3E')
.replace(/&/g, '%26')
.replace(/#/g, '%23')
.replace(/\s+/g, ' ');
let encodedData = ',' + newText;
if (encodedData.length < DATA.length) {
DATA = encodedData;
}
}
return '"data:' + MIME + DATA + '"';
});
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/configuration-editing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "vscode://defaultsettings/settings.json",
"fileMatch": "vscode://defaultsettings/*/*.json",
"url": "vscode://schemas/settings/default"
},
{
Expand Down
61 changes: 54 additions & 7 deletions extensions/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@
},
{
"command": "git.clean",
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
},
{
"command": "git.cleanAll",
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
},
{
"command": "git.commit",
Expand Down Expand Up @@ -763,7 +763,7 @@
{
"command": "git.cleanAll",
"group": "5_stage",
"when": "scmProvider == git && !gitFreshRepository"
"when": "scmProvider == git"
},
{
"command": "git.stashIncludeUntracked",
Expand Down Expand Up @@ -831,7 +831,7 @@
},
{
"command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification"
},
{
Expand All @@ -841,7 +841,7 @@
},
{
"command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline"
},
{
Expand All @@ -850,6 +850,53 @@
"group": "inline"
}
],
"scm/resourceFolder/context": [
{
"command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "1_modification"
},
{
"command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "inline"
},
{
"command": "git.unstage",
"when": "scmProvider == git && scmResourceGroup == index",
"group": "1_modification"
},
{
"command": "git.unstage",
"when": "scmProvider == git && scmResourceGroup == index",
"group": "inline"
},
{
"command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification"
},
{
"command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification"
},
{
"command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline"
},
{
"command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline"
},
{
"command": "git.ignore",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification@3"
}
],
"scm/resourceState/context": [
{
"command": "git.stage",
Expand Down Expand Up @@ -933,12 +980,12 @@
},
{
"command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification"
},
{
"command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline"
},
{
Expand Down
2 changes: 1 addition & 1 deletion extensions/git/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"command.syncRebase": "Sync (Rebase)",
"command.publish": "Publish Branch",
"command.showOutput": "Show Git Output",
"command.ignore": "Add File to .gitignore",
"command.ignore": "Add to .gitignore",
"command.stashIncludeUntracked": "Stash (Include Untracked)",
"command.stash": "Stash",
"command.stashPop": "Pop Stash...",
Expand Down
12 changes: 1 addition & 11 deletions extensions/git/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { commands, Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, SourceControlInputBoxValidation, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, Decoration, Memento, SourceControlInputBoxValidationType, OutputChannel, LogLevel, env, ProgressOptions, CancellationToken } from 'vscode';
import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, SourceControlInputBoxValidation, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, Decoration, Memento, SourceControlInputBoxValidationType, OutputChannel, LogLevel, env, ProgressOptions, CancellationToken } from 'vscode';
import { Repository as BaseRepository, Commit, Stash, GitError, Submodule, CommitOptions, ForcePushMode } from './git';
import { anyEvent, filterEvent, eventToPromise, dispose, find, isDescendant, IDisposable, onceEvent, EmptyDisposable, debounceEvent, combinedDisposable } from './util';
import { memoize, throttle, debounce } from './decorators';
Expand Down Expand Up @@ -633,7 +633,6 @@ export class Repository implements Disposable {

private isRepositoryHuge = false;
private didWarnAboutLimit = false;
private isFreshRepository: boolean | undefined = undefined;

private disposables: Disposable[] = [];

Expand Down Expand Up @@ -1507,15 +1506,6 @@ export class Repository implements Disposable {
// set count badge
this.setCountBadge();

// Disable `Discard All Changes` for "fresh" repositories
// https://github.com/Microsoft/vscode/issues/43066
const isFreshRepository = !this._HEAD || !this._HEAD.commit;

if (this.isFreshRepository !== isFreshRepository) {
commands.executeCommand('setContext', 'gitFreshRepository', isFreshRepository);
this.isFreshRepository = isFreshRepository;
}

this._onDidChangeStatus.fire();
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/json-language-features/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"jsonc-parser": "^2.1.1",
"request-light": "^0.2.4",
"vscode-json-languageservice": "^3.3.3",
"vscode-json-languageservice": "^3.3.4",
"vscode-languageserver": "^5.3.0-next.8",
"vscode-nls": "^4.1.1",
"vscode-uri": "^2.0.3"
Expand Down
8 changes: 4 additions & 4 deletions extensions/json-language-features/server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ request-light@^0.2.4:
https-proxy-agent "^2.2.1"
vscode-nls "^4.0.0"

vscode-json-languageservice@^3.3.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.3.tgz#f7e512a2cd5e82fecbebf507d6fceaea47661297"
integrity sha512-5vL3OXTUuQpn6+tGd47dopio+7WwbtIZ07zfYMzAUX8eVWPZjfEsLeSWmQk5Xw+vwgu+j5zC4koz5UofLDGGRA==
vscode-json-languageservice@^3.3.4:
version "3.3.4"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.4.tgz#4ff67580491d3a5dc469f4a78643f20adff0278d"
integrity sha512-/nuI4uDBfxyVyeGtBdYwP/tIaXYKOoymUOSozYKLzsmrDmu555gZpzc11LrARa96z92wSaa5hfjTtNMAoM2mxw==
dependencies:
jsonc-parser "^2.1.1"
vscode-languageserver-types "^3.15.0-next.2"
Expand Down
3 changes: 1 addition & 2 deletions extensions/markdown-language-features/media/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ pre.hljs code > div {
overflow: auto;
}

/** Theming */

pre code {
color: var(--vscode-editor-foreground);
tab-size: 4;
}

/** Theming */

.vscode-light pre {
background-color: rgba(220, 220, 220, 0.4);
Expand Down
1 change: 1 addition & 0 deletions extensions/merge-conflict/src/codelensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
this.codeLensRegistrationHandle = vscode.languages.registerCodeLensProvider([
{ scheme: 'file' },
{ scheme: 'untitled' },
{ scheme: 'vscode-userdata' },
], this);
}
}
Loading