Skip to content

Commit 414ce91

Browse files
authored
Merge branch 'main' into issue2961
2 parents 7ca7a7f + e4b6657 commit 414ce91

File tree

225 files changed

+7510
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+7510
-1259
lines changed

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
}
1313
},
1414
"files.associations": {
15-
"cglicenses.json": "jsonc"
15+
"cglicenses.json": "jsonc",
16+
"*.tst": "typescript"
1617
},
1718
"search.exclude": {
1819
"**/node_modules": true,
@@ -27,7 +28,8 @@
2728
"test/automation/out/**": true,
2829
"test/integration/browser/out/**": true,
2930
"src/vs/base/test/node/uri.test.data.txt": true,
30-
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true
31+
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true,
32+
"src/vs/editor/test/node/diffing/fixtures/**": true,
3133
},
3234
"lcov.path": [
3335
"./.build/coverage/lcov.info",

build/lib/extensions.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName) {
104104
// check for a webpack configuration files, then invoke webpack
105105
// and merge its output with the files stream.
106106
const webpackConfigLocations = glob.sync(path.join(extensionPath, '**', webpackConfigFileName), { ignore: ['**/node_modules'] });
107-
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
107+
const webpackStreams = webpackConfigLocations.flatMap(webpackConfigPath => {
108108
const webpackDone = (err, stats) => {
109109
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
110110
if (err) {
@@ -118,27 +118,30 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName) {
118118
result.emit('error', compilation.warnings.join('\n'));
119119
}
120120
};
121-
const webpackConfig = {
122-
...require(webpackConfigPath),
123-
...{ mode: 'production' }
124-
};
125-
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
126-
return webpackGulp(webpackConfig, webpack, webpackDone)
127-
.pipe(es.through(function (data) {
128-
data.stat = data.stat || {};
129-
data.base = extensionPath;
130-
this.emit('data', data);
131-
}))
132-
.pipe(es.through(function (data) {
133-
// source map handling:
134-
// * rewrite sourceMappingURL
135-
// * save to disk so that upload-task picks this up
136-
const contents = data.contents.toString('utf8');
137-
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
138-
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
139-
}), 'utf8');
140-
this.emit('data', data);
141-
}));
121+
const exportedConfig = require(webpackConfigPath);
122+
return (Array.isArray(exportedConfig) ? exportedConfig : [exportedConfig]).map(config => {
123+
const webpackConfig = {
124+
...config,
125+
...{ mode: 'production' }
126+
};
127+
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
128+
return webpackGulp(webpackConfig, webpack, webpackDone)
129+
.pipe(es.through(function (data) {
130+
data.stat = data.stat || {};
131+
data.base = extensionPath;
132+
this.emit('data', data);
133+
}))
134+
.pipe(es.through(function (data) {
135+
// source map handling:
136+
// * rewrite sourceMappingURL
137+
// * save to disk so that upload-task picks this up
138+
const contents = data.contents.toString('utf8');
139+
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
140+
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
141+
}), 'utf8');
142+
this.emit('data', data);
143+
}));
144+
});
142145
});
143146
es.merge(...webpackStreams, es.readArray(files))
144147
// .pipe(es.through(function (data) {

build/lib/extensions.ts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string):
121121
{ ignore: ['**/node_modules'] }
122122
));
123123

124-
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
124+
const webpackStreams = webpackConfigLocations.flatMap(webpackConfigPath => {
125125

126126
const webpackDone = (err: any, stats: any) => {
127127
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
@@ -137,29 +137,32 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string):
137137
}
138138
};
139139

140-
const webpackConfig = {
141-
...require(webpackConfigPath),
142-
...{ mode: 'production' }
143-
};
144-
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
145-
146-
return webpackGulp(webpackConfig, webpack, webpackDone)
147-
.pipe(es.through(function (data) {
148-
data.stat = data.stat || {};
149-
data.base = extensionPath;
150-
this.emit('data', data);
151-
}))
152-
.pipe(es.through(function (data: File) {
153-
// source map handling:
154-
// * rewrite sourceMappingURL
155-
// * save to disk so that upload-task picks this up
156-
const contents = (<Buffer>data.contents).toString('utf8');
157-
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
158-
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
159-
}), 'utf8');
160-
161-
this.emit('data', data);
162-
}));
140+
const exportedConfig = require(webpackConfigPath);
141+
return (Array.isArray(exportedConfig) ? exportedConfig : [exportedConfig]).map(config => {
142+
const webpackConfig = {
143+
...config,
144+
...{ mode: 'production' }
145+
};
146+
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
147+
148+
return webpackGulp(webpackConfig, webpack, webpackDone)
149+
.pipe(es.through(function (data) {
150+
data.stat = data.stat || {};
151+
data.base = extensionPath;
152+
this.emit('data', data);
153+
}))
154+
.pipe(es.through(function (data: File) {
155+
// source map handling:
156+
// * rewrite sourceMappingURL
157+
// * save to disk so that upload-task picks this up
158+
const contents = (<Buffer>data.contents).toString('utf8');
159+
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
160+
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
161+
}), 'utf8');
162+
163+
this.emit('data', data);
164+
}));
165+
});
163166
});
164167

165168
es.merge(...webpackStreams, es.readArray(files))
@@ -506,7 +509,7 @@ export async function webpackExtensions(taskName: string, isWatch: boolean, webp
506509

507510
for (const { configPath, outputRoot } of webpackConfigLocations) {
508511
const configOrFnOrArray = require(configPath);
509-
function addConfig(configOrFnOrArray: webpack.Configuration | ((env: unknown,args: unknown) => webpack.Configuration) | webpack.Configuration[]) {
512+
function addConfig(configOrFnOrArray: webpack.Configuration | ((env: unknown, args: unknown) => webpack.Configuration) | webpack.Configuration[]) {
510513
for (const configOrFn of Array.isArray(configOrFnOrArray) ? configOrFnOrArray : [configOrFnOrArray]) {
511514
const config = typeof configOrFn === 'function' ? configOrFn({}, {}) : configOrFn;
512515
if (outputRoot) {

build/monaco/monaco.d.ts.recipe

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export interface ICommandHandler {
7373
#include(vs/editor/common/core/wordHelper): IWordAtPosition
7474
#includeAll(vs/editor/common/model): IScrollEvent
7575
#include(vs/editor/common/diff/smartLinesDiffComputer): IChange, ICharChange, ILineChange
76+
#include(vs/editor/common/diff/documentDiffProvider): IDocumentDiffProvider, IDocumentDiffProviderOptions, IDocumentDiff
77+
#include(vs/editor/common/diff/linesDiffComputer): LineRangeMapping, LineRange, RangeMapping
7678
#include(vs/editor/common/core/dimension): IDimension
7779
#includeAll(vs/editor/common/editorCommon): IScrollEvent
7880
#includeAll(vs/editor/common/textModelEvents):

extensions/markdown-language-features/server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"out/**/*.js"
1515
],
1616
"dependencies": {
17+
"@vscode/l10n": "^0.0.10",
1718
"vscode-languageserver": "^8.0.2",
1819
"vscode-languageserver-textdocument": "^1.0.5",
1920
"vscode-languageserver-types": "^3.17.1",
20-
"vscode-markdown-languageservice": "^0.2.0",
21-
"vscode-nls": "^5.2.0",
21+
"vscode-markdown-languageservice": "^0.3.0-alpha.2",
2222
"vscode-uri": "^3.0.3"
2323
},
2424
"devDependencies": {

extensions/markdown-language-features/server/package/README.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

extensions/markdown-language-features/server/package/package.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

extensions/markdown-language-features/server/src/server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { CancellationToken, Connection, InitializeParams, InitializeResult, Note
77
import { TextDocument } from 'vscode-languageserver-textdocument';
88
import * as lsp from 'vscode-languageserver-types';
99
import * as md from 'vscode-markdown-languageservice';
10-
import * as nls from 'vscode-nls';
1110
import { URI } from 'vscode-uri';
1211
import { getLsConfiguration, LsConfiguration } from './config';
1312
import { ConfigurationManager } from './configuration';
@@ -16,8 +15,7 @@ import { LogFunctionLogger } from './logging';
1615
import * as protocol from './protocol';
1716
import { IDisposable } from './util/dispose';
1817
import { VsCodeClientWorkspace } from './workspace';
19-
20-
const localize = nls.loadMessageBundle();
18+
import * as l10n from '@vscode/l10n';
2119

2220
interface MdServerInitializationOptions extends LsConfiguration { }
2321

@@ -204,7 +202,7 @@ export async function startServer(connection: Connection, serverConfig: {
204202

205203
if (params.context.only?.some(kind => kind === 'source' || kind.startsWith('source.'))) {
206204
const action: lsp.CodeAction = {
207-
title: localize('organizeLinkDefAction.title', "Organize link definitions"),
205+
title: l10n.t("Organize link definitions"),
208206
kind: organizeLinkDefKind,
209207
data: <OrganizeLinkActionData>{ uri: document.uri }
210208
};

0 commit comments

Comments
 (0)