Skip to content

Commit e7dd992

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebornix/awake-lion
2 parents 2043283 + 0422c8f commit e7dd992

File tree

2,330 files changed

+126000
-84806
lines changed

Some content is hidden

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

2,330 files changed

+126000
-84806
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/microsoft/vscode/wiki/How-to-Contribute
3+
properties:
4+
resources:
5+
- resource: Microsoft.WinGet.DSC/WinGetPackage
6+
directives:
7+
description: Install Git
8+
allowPrerelease: true
9+
settings:
10+
id: Git.Git
11+
source: winget
12+
- resource: Microsoft.WinGet.DSC/WinGetPackage
13+
id: npm
14+
directives:
15+
description: Install NodeJS version >=16.17.x and <17
16+
allowPrerelease: true
17+
settings:
18+
id: OpenJS.NodeJS.LTS
19+
version: "16.20.0"
20+
source: winget
21+
- resource: NpmDsc/NpmPackage
22+
id: yarn
23+
dependsOn:
24+
- npm
25+
directives:
26+
description: Install Yarn
27+
allowPrerelease: true
28+
settings:
29+
Name: 'yarn'
30+
Global: true
31+
PackageDirectory: '${WinGetConfigRoot}\..\'
32+
- resource: Microsoft.WinGet.DSC/WinGetPackage
33+
directives:
34+
description: Install Python 3.10
35+
allowPrerelease: true
36+
settings:
37+
id: Python.Python.3.10
38+
source: winget
39+
- resource: Microsoft.WinGet.DSC/WinGetPackage
40+
id: vsPackage
41+
directives:
42+
description: Install Visual Studio 2022 (any edition is OK)
43+
allowPrerelease: true
44+
settings:
45+
id: Microsoft.VisualStudio.2022.BuildTools
46+
source: winget
47+
- resource: Microsoft.VisualStudio.DSC/VSComponents
48+
dependsOn:
49+
- vsPackage
50+
directives:
51+
description: Install required VS workloads
52+
allowPrerelease: true
53+
settings:
54+
productId: Microsoft.VisualStudio.Product.BuildTools
55+
channelId: VisualStudio.17.Release
56+
includeRecommended: true
57+
components:
58+
- Microsoft.VisualStudio.Workload.VCTools
59+
- resource: YarnDsc/YarnInstall
60+
dependsOn:
61+
- npm
62+
directives:
63+
description: Install dependencies
64+
allowPrerelease: true
65+
settings:
66+
PackageDirectory: '${WinGetConfigRoot}\..\'
67+
configurationVersion: 0.2.0

.eslintplugin/code-amd-node-module.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as eslint from 'eslint';
7+
import { join } from 'path';
8+
9+
10+
export = new class ApiProviderNaming implements eslint.Rule.RuleModule {
11+
12+
readonly meta: eslint.Rule.RuleMetaData = {
13+
messages: {
14+
amdX: 'Use `import type` for import declarations, use `amdX#importAMDNodeModule` for import expressions'
15+
}
16+
};
17+
18+
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
19+
20+
const modules = new Set<string>();
21+
22+
try {
23+
const { dependencies, optionalDependencies } = require(join(__dirname, '../package.json'));
24+
const all = Object.keys(dependencies).concat(Object.keys(optionalDependencies));
25+
for (const key of all) {
26+
modules.add(key);
27+
}
28+
29+
} catch (e) {
30+
console.error(e);
31+
throw e;
32+
}
33+
34+
35+
const checkImport = (node: any) => {
36+
37+
if (node.type !== 'Literal' || typeof node.value !== 'string') {
38+
return;
39+
}
40+
41+
if (node.parent.importKind === 'type') {
42+
return;
43+
}
44+
45+
if (!modules.has(node.value)) {
46+
return;
47+
}
48+
49+
context.report({
50+
node,
51+
messageId: 'amdX'
52+
});
53+
}
54+
55+
return {
56+
['ImportExpression Literal']: checkImport,
57+
['ImportDeclaration Literal']: checkImport
58+
};
59+
}
60+
};

.eslintplugin/code-import-patterns.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface ConditionalPattern {
1818

1919
interface RawImportPatternsConfig {
2020
target: string;
21-
layer?: 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-browser' | 'electron-main';
21+
layer?: 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-main';
2222
test?: boolean;
2323
restrictions: string | (string | ConditionalPattern)[];
2424
}
@@ -77,7 +77,7 @@ export = new class implements eslint.Rule.RuleModule {
7777
return this._optionsCache.get(options)!;
7878
}
7979

80-
type Layer = 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-browser' | 'electron-main';
80+
type Layer = 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-main';
8181

8282
interface ILayerRule {
8383
layer: Layer;
@@ -96,7 +96,6 @@ export = new class implements eslint.Rule.RuleModule {
9696
{ layer: 'browser', deps: orSegment(['common', 'browser']), isBrowser: true },
9797
{ layer: 'electron-sandbox', deps: orSegment(['common', 'browser', 'electron-sandbox']), isBrowser: true },
9898
{ layer: 'node', deps: orSegment(['common', 'node']), isNode: true },
99-
{ layer: 'electron-browser', deps: orSegment(['common', 'browser', 'node', 'electron-sandbox', 'electron-browser']), isBrowser: true, isNode: true },
10099
{ layer: 'electron-main', deps: orSegment(['common', 'node', 'electron-main']), isNode: true },
101100
];
102101

@@ -181,8 +180,9 @@ export = new class implements eslint.Rule.RuleModule {
181180
const restrictions = (typeof option.restrictions === 'string' ? [option.restrictions] : option.restrictions).slice(0);
182181

183182
if (targetIsVS) {
184-
// Always add "vs/nls"
183+
// Always add "vs/nls" and "vs/amdX"
185184
restrictions.push('vs/nls');
185+
restrictions.push('vs/amdX'); // TODO@jrieken remove after ESM is real
186186
}
187187

188188
if (targetIsVS && option.layer) {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as eslint from 'eslint';
7+
8+
export = new class ApiProviderNaming implements eslint.Rule.RuleModule {
9+
10+
readonly meta: eslint.Rule.RuleMetaData = {
11+
messages: {
12+
slow: 'Native private fields are much slower and should only be used when needed. Ignore this warning if you know what you are doing, use compile-time private otherwise. See https://github.com/microsoft/vscode/issues/185991#issuecomment-1614468158 for details',
13+
}
14+
};
15+
16+
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
17+
18+
return {
19+
['PropertyDefinition PrivateIdentifier']: (node: any) => {
20+
context.report({
21+
node,
22+
messageId: 'slow'
23+
});
24+
},
25+
['MethodDefinition PrivateIdentifier']: (node: any) => {
26+
context.report({
27+
node,
28+
messageId: 'slow'
29+
});
30+
}
31+
};
32+
}
33+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as eslint from 'eslint';
7+
import { TSESTree } from '@typescript-eslint/experimental-utils';
8+
9+
export = new class ApiTypeDiscrimination implements eslint.Rule.RuleModule {
10+
11+
readonly meta: eslint.Rule.RuleMetaData = {
12+
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines' },
13+
messages: {
14+
noTypeDiscrimination: 'Do not use type descrimination properties'
15+
}
16+
};
17+
18+
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
19+
return {
20+
['TSPropertySignature[optional=undefined] TSTypeAnnotation TSLiteralType Literal']: (node: any) => {
21+
22+
const raw = String((<TSESTree.Literal>node).raw)
23+
24+
if (/^('|").*\1$/.test(raw)) {
25+
26+
context.report({
27+
node: node,
28+
messageId: 'noTypeDiscrimination'
29+
});
30+
}
31+
}
32+
}
33+
}
34+
};

.eslintrc.json

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
}
7070
],
7171
"local/code-translation-remind": "warn",
72+
"local/code-no-native-private": "warn",
7273
"local/code-no-nls-in-standalone-editor": "warn",
7374
"local/code-no-standalone-editor": "warn",
7475
"local/code-no-unexternalized-strings": "warn",
@@ -87,12 +88,6 @@
8788
"common",
8889
"browser"
8990
],
90-
"electron-browser": [
91-
"common",
92-
"browser",
93-
"node",
94-
"electron-sandbox"
95-
],
9691
"electron-main": [
9792
"common",
9893
"node"
@@ -136,6 +131,7 @@
136131
"rules": {
137132
"local/vscode-dts-create-func": "warn",
138133
"local/vscode-dts-literal-or-types": "warn",
134+
"local/vscode-dts-string-type-literals": "warn",
139135
"local/vscode-dts-interface-naming": "warn",
140136
"local/vscode-dts-cancellation": "warn",
141137
"local/vscode-dts-use-thenable": "warn",
@@ -198,6 +194,14 @@
198194
]
199195
}
200196
},
197+
{
198+
"files": [
199+
"src/**/{common,browser}/**/*.ts"
200+
],
201+
"rules": {
202+
"local/code-amd-node-module": "warn"
203+
}
204+
},
201205
{
202206
"files": [
203207
"src/**/*.ts"
@@ -210,7 +214,6 @@
210214
// imports that are allowed in all files of layers:
211215
// - browser
212216
// - electron-sandbox
213-
// - electron-browser
214217
"when": "hasBrowser",
215218
"allow": [
216219
"vs/css!./**/*"
@@ -219,7 +222,6 @@
219222
{
220223
// imports that are allowed in all files of layers:
221224
// - node
222-
// - electron-browser
223225
// - electron-main
224226
"when": "hasNode",
225227
"allow": [
@@ -229,6 +231,9 @@
229231
"@vscode/ripgrep",
230232
"@vscode/iconv-lite-umd",
231233
"@vscode/policy-watcher",
234+
"@vscode/proxy-agent",
235+
"@vscode/spdlog",
236+
"@vscode/windows-process-tree",
232237
"assert",
233238
"child_process",
234239
"console",
@@ -237,6 +242,7 @@
237242
"electron",
238243
"events",
239244
"fs",
245+
"fs/promises",
240246
"graceful-fs",
241247
"http",
242248
"https",
@@ -248,21 +254,20 @@
248254
"os",
249255
"path",
250256
"perf_hooks",
251-
"spdlog",
257+
"readline",
252258
"stream",
253259
"string_decoder",
254260
"tas-client-umd",
255261
"tls",
256262
"url",
257263
"util",
258264
"v8-inspect-profiler",
259-
"vscode-proxy-agent",
260265
"vscode-regexpp",
261266
"vscode-textmate",
262-
"windows-process-tree",
263267
"worker_threads",
264268
"xterm",
265269
"xterm-addon-canvas",
270+
"xterm-addon-image",
266271
"xterm-addon-search",
267272
"xterm-addon-serialize",
268273
"xterm-addon-unicode11",
@@ -297,14 +302,12 @@
297302
// - src/vs/base/browser
298303
// - src/vs/base/electron-sandbox
299304
// - src/vs/base/node
300-
// - src/vs/base/electron-browser
301305
// - src/vs/base/electron-main
302306
// - src/vs/base/test/common
303307
// - src/vs/base/test/worker
304308
// - src/vs/base/test/browser
305309
// - src/vs/base/test/electron-sandbox
306310
// - src/vs/base/test/node
307-
// - src/vs/base/test/electron-browser
308311
// - src/vs/base/test/electron-main
309312
//
310313
// When /~ is used in the restrictions, it will be replaced with the correct
@@ -601,6 +604,12 @@
601604
"vs/workbench/workbench.common.main"
602605
]
603606
},
607+
{
608+
"target": "src/vs/amdX.ts",
609+
"restrictions": [
610+
"vs/base/common/*"
611+
]
612+
},
604613
{
605614
"target": "src/vs/workbench/{workbench.desktop.main.nls.js,workbench.web.main.nls.js}",
606615
"restrictions": []

.git-blame-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ae1452eea678f5266ef513f22dacebb90955d6c9
1515
# joaomoreno: add ghooks dev dependency
1616
0dfc06e0f9de5925de792cdf9f0e6597bb25908f
1717

18+
# joaomoreno: line endings
19+
12ab70d329a13dd5b18d892cd40edd7138259bc3
20+
1821
# mjbvz: organize imports
1922
494cbbd02d67e87727ec885f98d19551aa33aad1
2023
a3cb14be7f2cceadb17adf843675b1a59537dbbd

.github/classifier.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@
199199
"sash-widget": {"assign": ["joaomoreno"]},
200200
"scm": {"assign": ["lszomoru"]},
201201
"screencast-mode": {"assign": ["joaomoreno"]},
202-
"search": {"assign": ["andreamah"]},
203-
"search-api": {"assign": ["andreamah"]},
204-
"search-editor": {"assign": ["andreamah"]},
202+
"search": {"assign": ["andreamah", "roblourens"]},
203+
"search-api": {"assign": ["andreamah", "roblourens"]},
204+
"search-editor": {"assign": ["andreamah", "roblourens"]},
205205
"search-replace": {"assign": ["sandy081"]},
206206
"semantic-tokens": {"assign": ["alexdima", "aeschli"]},
207207
"server": {"assign": ["alexdima"]},

0 commit comments

Comments
 (0)