Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d27777a

Browse files
committed
Rewrite cschat by extending chat, and clean up the codebase
1 parent d79ab81 commit d27777a

File tree

257 files changed

+4173
-32274
lines changed

Some content is hidden

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

257 files changed

+4173
-32274
lines changed

.codestory.json

-1
This file was deleted.

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
* text=auto
2+
23
LICENSE.txt eol=crlf
34
ThirdPartyNotices.txt eol=crlf
5+
46
*.bat eol=crlf
57
*.cmd eol=crlf
68
*.ps1 eol=lf
79
*.sh eol=lf
810
*.rtf -text
911
**/*.json linguist-language=jsonc
10-
*.onnx filter=lfs diff=lfs merge=lfs -text

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ vscode.db
2020
product.overrides.json
2121
*.snap.actual
2222
.vscode-test
23-
24-
# CodeStory
25-
.codestory.json
26-
.aider*

.vscode/settings.json

+24-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"src/vs/base/test/common/filters.perf.data.js": true,
3333
"src/vs/base/test/node/uri.test.data.txt": true,
3434
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true,
35-
"src/vs/editor/test/node/diffing/fixtures/**": true
35+
"src/vs/editor/test/node/diffing/fixtures/**": true,
3636
},
3737
"files.readonlyInclude": {
3838
"**/node_modules/**/*.*": true,
@@ -51,7 +51,7 @@
5151
"extensions/**/out/**": true,
5252
"test/smoke/out/**": true,
5353
"test/automation/out/**": true,
54-
"test/integration/browser/out/**": true
54+
"test/integration/browser/out/**": true,
5555
},
5656
"files.readonlyExclude": {
5757
"build/builtin/*.js": true,
@@ -80,16 +80,24 @@
8080
"typescript.preferences.quoteStyle": "single",
8181
"json.schemas": [
8282
{
83-
"fileMatch": ["cgmanifest.json"],
84-
"url": "https://json.schemastore.org/component-detection-manifest.json"
83+
"fileMatch": [
84+
"cgmanifest.json"
85+
],
86+
"url": "https://json.schemastore.org/component-detection-manifest.json",
8587
},
8688
{
87-
"fileMatch": ["cglicenses.json"],
89+
"fileMatch": [
90+
"cglicenses.json"
91+
],
8892
"url": "./.vscode/cglicenses.schema.json"
8993
}
9094
],
9195
"git.ignoreLimitWarning": true,
92-
"git.branchProtection": ["main", "distro", "release/*"],
96+
"git.branchProtection": [
97+
"main",
98+
"distro",
99+
"release/*"
100+
],
93101
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
94102
"git.branchRandomName.enable": true,
95103
"git.pullBeforeCheckout": true,
@@ -112,9 +120,11 @@
112120
},
113121
"[rust]": {
114122
"editor.defaultFormatter": "rust-lang.rust-analyzer",
115-
"editor.formatOnSave": true
123+
"editor.formatOnSave": true,
116124
},
117-
"rust-analyzer.linkedProjects": ["cli/Cargo.toml"],
125+
"rust-analyzer.linkedProjects": [
126+
"cli/Cargo.toml"
127+
],
118128
"typescript.tsc.autoDetect": "off",
119129
"testing.autoRun.mode": "rerun",
120130
"conventionalCommits.scopes": [
@@ -135,11 +145,15 @@
135145
]
136146
},
137147
"extension-test-runner.debugOptions": {
138-
"outFiles": ["${workspaceFolder}/extensions/*/out/**/*.js"]
148+
"outFiles": [
149+
"${workspaceFolder}/extensions/*/out/**/*.js",
150+
]
139151
},
140152
"githubPullRequests.assignCreated": "${user}",
141153
"githubPullRequests.defaultMergeMethod": "squash",
142-
"githubPullRequests.ignoredPullRequestBranches": ["main"],
154+
"githubPullRequests.ignoredPullRequestBranches": [
155+
"main"
156+
],
143157
"application.experimental.rendererProfiling": true,
144158
"editor.experimental.asyncTokenization": true,
145159
"editor.experimental.asyncTokenizationVerification": true,

build/gulpfile.extensions.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const nodeUtil = require('util');
1212
const es = require('event-stream');
1313
const filter = require('gulp-filter');
1414
const util = require('./lib/util');
15-
const os = require('os');
1615
const { getVersion } = require('./lib/getVersion');
1716
const task = require('./lib/task');
1817
const watcher = require('./lib/watch');
@@ -32,9 +31,9 @@ const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
3231
// });
3332
const compilations = [
3433
'authentication-proxy/tsconfig.json',
34+
'codestory/tsconfig.json',
3535
'configuration-editing/build/tsconfig.json',
3636
'configuration-editing/tsconfig.json',
37-
'codestory/tsconfig.json',
3837
'css-language-features/client/tsconfig.json',
3938
'css-language-features/server/tsconfig.json',
4039
'debug-auto-launch/tsconfig.json',

build/gulpfile.vscode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
331331
} else if (platform === 'darwin') {
332332
const shortcut = gulp.src('resources/darwin/bin/code.sh')
333333
.pipe(replace('@@APPNAME@@', product.applicationName))
334-
.pipe(rename('bin/' + product.applicationName));
334+
.pipe(rename('bin/code'));
335335

336336
all = es.merge(all, shortcut);
337337
}

build/lib/builtInExtensions.js

+2-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/builtInExtensions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const root = path.dirname(path.dirname(__dirname));
3939
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
4040
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions || [];
4141
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions || [];
42-
const controlFilePath = path.join(os.homedir(), '.aide-dev', 'extensions', 'control.json');
42+
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
4343
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
4444

4545
function log(...messages: string[]): void {

build/lib/extensions.js

+6-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/extensions.ts

+8-43
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import * as es from 'event-stream';
77
import * as fs from 'fs';
8-
import * as os from 'os';
98
import * as cp from 'child_process';
109
import * as glob from 'glob';
1110
import * as gulp from 'gulp';
@@ -22,8 +21,6 @@ import * as ansiColors from 'ansi-colors';
2221
const buffer = require('gulp-buffer');
2322
import * as jsoncParser from 'jsonc-parser';
2423
import webpack = require('webpack');
25-
// const pLimit = require('p-limit');
26-
// const os = require('os');
2724
import { getProductionDependencies } from './dependencies';
2825
import { IExtensionDefinition, getExtensionStream } from './builtInExtensions';
2926
import { getVersion } from './getVersion';
@@ -33,28 +30,19 @@ const root = path.dirname(path.dirname(__dirname));
3330
const commit = getVersion(root);
3431
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
3532

36-
// Determine the maximum number of file descriptors the system allows
37-
// const maxFileDescriptors = os.platform() === 'win32' ? 2048 : os.sysconf('SC_OPEN_MAX');
38-
39-
// Calculate the limit based on available file descriptors
40-
// const limitValue = Math.min(100, 100); // You can adjust this as needed
41-
42-
// Create the dynamic limit function
43-
// const limit = pLimit(limitValue);
44-
4533
function minifyExtensionResources(input: Stream): Stream {
4634
const jsonFilter = filter(['**/*.json', '**/*.code-snippets'], { restore: true });
4735
return input
4836
.pipe(jsonFilter)
4937
.pipe(buffer())
50-
.pipe(es.map((f: File, callback) => {
38+
.pipe(es.mapSync((f: File) => {
5139
const errors: jsoncParser.ParseError[] = [];
5240
const value = jsoncParser.parse(f.contents.toString('utf8'), errors, { allowTrailingComma: true });
5341
if (errors.length === 0) {
5442
// file parsed OK => just stringify to drop whitespace and comments
5543
f.contents = Buffer.from(JSON.stringify(value));
5644
}
57-
callback(undefined, f);
45+
return f;
5846
}))
5947
.pipe(jsonFilter.restore);
6048
}
@@ -210,8 +198,6 @@ function fromLocalNormal(extensionPath: string): Stream {
210198

211199
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn })
212200
.then(fileNames => {
213-
fancyLog(`Listing out files for extension: ${ansiColors.yellow(path.basename(extensionPath))}`);
214-
fancyLog(`Files present: ${fileNames}`);
215201
const files = fileNames
216202
.map(fileName => path.join(extensionPath, fileName))
217203
.map(filePath => new File({
@@ -347,32 +333,21 @@ export function packageLocalExtensionsStream(forWeb: boolean, disableMangle: boo
347333
const absoluteManifestPath = path.join(root, manifestPath);
348334
const extensionPath = path.dirname(path.join(root, manifestPath));
349335
const extensionName = path.basename(extensionPath);
350-
fancyLog(`Manifest Path: ${ansiColors.yellow(absoluteManifestPath)} ${absoluteManifestPath} ${root}...`);
351336
return { name: extensionName, path: extensionPath, manifestPath: absoluteManifestPath };
352337
})
353-
.filter(({ name }) => {
354-
fancyLog(`Extension name which will be packaged: ${name}...`);
355-
return excludedExtensions.indexOf(name) === -1;
356-
})
338+
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
357339
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
358340
.filter(({ manifestPath }) => (forWeb ? isWebExtension(require(manifestPath)) : true))
359341
);
360342
const localExtensionsStream = minifyExtensionResources(
361343
es.merge(
362344
...localExtensionsDescriptions.map(extension => {
363-
fancyLog(`Extension name to package: ${extension.name}...`);
364345
return fromLocal(extension.path, forWeb, disableMangle)
365-
.pipe(rename(p => {
366-
const currentDirName = p.dirname;
367-
const newDirName = `extensions/${extension.name}/${p.dirname}`;
368-
p.dirname = `extensions/${extension.name}/${p.dirname}`;
369-
fancyLog(`Extension directory name changed from ${currentDirName} to ${newDirName}`);
370-
}));
346+
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
371347
})
372348
)
373349
);
374350

375-
376351
let result: Stream;
377352
if (forWeb) {
378353
result = localExtensionsStream;
@@ -395,20 +370,10 @@ export function packageLocalExtensionsStream(forWeb: boolean, disableMangle: boo
395370
}
396371

397372
export function packageMarketplaceExtensionsStream(forWeb: boolean): Stream {
398-
const platform = os.platform();
399-
fancyLog('platform', platform);
400-
let marketplaceExtensionsDescriptions: any[] = [];
401-
if (platform !== 'win32' && platform !== 'darwin') {
402-
// If we are in any environment other than windows and mac, we should
403-
// switch to not bundling the extensions here from the marketplace.
404-
marketplaceExtensionsDescriptions = [];
405-
} else {
406-
marketplaceExtensionsDescriptions = [
407-
...builtInExtensions.filter(({ name }) => (forWeb ? !marketplaceWebExtensionsExclude.has(name) : true)),
408-
...(forWeb ? webBuiltInExtensions : [])
409-
];
410-
}
411-
fancyLog('marketplaceExtensions: ', marketplaceExtensionsDescriptions.length);
373+
const marketplaceExtensionsDescriptions = [
374+
...builtInExtensions.filter(({ name }) => (forWeb ? !marketplaceWebExtensionsExclude.has(name) : true)),
375+
...(forWeb ? webBuiltInExtensions : [])
376+
];
412377
const marketplaceExtensionsStream = minifyExtensionResources(
413378
es.merge(
414379
...marketplaceExtensionsDescriptions

build/lib/i18n.resources.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@
186186
"name": "vs/workbench/contrib/csChat",
187187
"project": "vscode-workbench"
188188
},
189+
{
190+
"name": "vs/workbench/services/aiModel",
191+
"project": "vscode-workbench"
192+
},
189193
{
190194
"name": "vs/workbench/contrib/quickaccess",
191195
"project": "vscode-workbench"
@@ -430,10 +434,6 @@
430434
"name": "vs/workbench/services/keybinding",
431435
"project": "vscode-workbench"
432436
},
433-
{
434-
"name": "vs/workbench/services/aiModel",
435-
"project": "vscode-workbench"
436-
},
437437
{
438438
"name": "vs/workbench/services/lifecycle",
439439
"project": "vscode-workbench"

0 commit comments

Comments
 (0)