Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
534 changes: 534 additions & 0 deletions .eslint-allowed-bracket-notation-files

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ src/vs/workbench/services/extensions/common/extensionPoints.json @TylerLeonhardt
# review is required to make sure TypeScript is not a better choice.
.eslint-allowed-javascript-files @alexr00 @alexdima @sbatten @TylerLeonhardt

# Allowlist for the `local/code-no-bracket-notation-for-identifiers` lint rule.
# Adding entries here permits bracket notation for identifier properties;
# review is required to make sure dot notation cannot be used instead.
.eslint-allowed-bracket-notation-files @alexdima @dmitrivMS
116 changes: 105 additions & 11 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,115 @@
# Apply this file to CodeQL default setup with the repository property:
# github-codeql-config-file: ./.github/codeql/codeql-config.yml
# Applied by .github/workflows/codeql.yml.
paths-ignore:
# Keep directory exclusions scoped: product code imports helpers from some
# extension src/test directories.
- 'test/**'
- 'src/**/test/**'
- 'build/**/test/**'
# Development, build, packaging, and CI tooling, not shipped product code.
- '.agents/**'
- '.eslint-plugin-local/**'
- '.github/**'
- '.vscode-test.js'
- '.vscode/**'
- 'build/**'
- 'cli/build.rs'
- 'eslint.config.js'
- 'extensions/**/.esbuild.*'
- 'extensions/*/build/**'
- 'extensions/*/esbuild*.mts'
- 'extensions/*/scripts/**'
- 'extensions/copilot/.eslintplugin/**'
- 'extensions/copilot/.mocha-multi-reporters.js'
- 'extensions/copilot/.mocharc.js'
- 'extensions/copilot/.vscode-test.mjs'
- 'extensions/copilot/.vscode/**'
- 'extensions/copilot/chat-lib/vitest.config.ts'
- 'extensions/copilot/script/**'
- 'extensions/copilot/vite.config.ts'
- 'extensions/esbuild*.mts'
- 'extensions/postinstall.mjs'
- 'extensions/search-result/syntaxes/generateTMLanguage.js'
- 'gulpfile.mjs'
- 'scripts/**'

# Generated build output and dependencies; analyze the product sources instead.
- '**/node_modules/**'
- '**/out/**'
- '.build/**'
- 'cli/target/**'
- 'coverage/**'
- 'extensions/**/dist/**'
- 'out*/**'

# Test directories, fixtures, and helpers.
- 'cli/tests/**'
- '.eslint-plugin-local/tests/**'
- 'extensions/*/server/**/test/**'
- 'extensions/*/test-workspace/**'
- 'extensions/*/test/**'
- 'extensions/*/tests/**'
- 'extensions/configuration-editing/src/test/**'
- 'extensions/copilot/src/extension/**/test/**'
- 'extensions/copilot/src/extension/agents/node/adapters/openaiAdapterForSTests.ts'
- 'extensions/copilot/src/extension/typescriptContext/serverPlugin/fixtures/**'
- 'extensions/copilot/src/lib/**/test/**'
- 'extensions/copilot/src/platform/**/test/**'
- 'extensions/copilot/src/platform/commands/common/mockRunCommandExecutionService.ts'
- 'extensions/copilot/src/platform/notebook/common/mockAlternativeContentService.ts'
- 'extensions/copilot/src/platform/tasks/common/testTasksService.ts'
- 'extensions/copilot/src/sanity-test-extension.ts'
- 'extensions/copilot/src/shared-fetch-utils/**/test/**'
- 'extensions/copilot/src/test-extension.ts'
# Standalone chat-lib rewrites runtime VS Code API imports to util/common/test/shims.
# These are required runtime dependencies, not tests; exclude only their test-only siblings.
- 'extensions/copilot/src/util/common/test/annotatedSrc.ts'
- 'extensions/copilot/src/util/common/test/mockChatResponseStream.ts'
- 'extensions/copilot/src/util/common/test/simpleMock.ts'
- 'extensions/copilot/src/util/common/test/testUtils.ts'
- 'extensions/copilot/src/util/node/test/**'
- 'extensions/copilot/src/util/test/**'
- 'extensions/emmet/src/test/**'
- 'extensions/git-base/src/test/**'
- 'extensions/git/src/test/**'
- 'extensions/github-authentication/src/test/**'
- 'extensions/github/src/test/**'
- 'extensions/ipynb/src/test/**'
- 'extensions/markdown-language-features/src/test/**'
- 'extensions/microsoft-authentication/src/**/test/**'
- 'extensions/notebook-renderers/src/test/**'
- 'extensions/npm/src/test/**'
- 'extensions/terminal-suggest/fixtures/**'
- 'extensions/terminal-suggest/src/**/test/**'
- 'extensions/typescript-language-features/src/test-all.ts'
- 'extensions/typescript-language-features/src/test/**'
- 'extensions/vscode-api-tests/**'
- 'extensions/vscode-colorize-perf-tests/**'
- 'extensions/vscode-colorize-tests/**'
- 'extensions/vscode-test-resolver/**'
- 'src/**/test/**'
- 'src/vs/workbench/contrib/terminal/browser/terminalTestHelpers.ts'
- 'test/**'

# Keep exact suffixes: themes.test.contribution.ts ships in the product.
- '**/*.fixture.cjs'
- '**/*.fixture.cts'
- '**/*.fixture.js'
- '**/*.fixture.jsx'
- '**/*.fixture.mjs'
- '**/*.fixture.mts'
- '**/*.fixture.ts'
- '**/*.fixture.tsx'
- '**/*.sanity-test.ts'
- '**/*.sanity-test.tsx'
- '**/*.spec.cjs'
- '**/*.spec.cts'
- '**/*.spec.js'
- '**/*.spec.jsx'
- '**/*.spec.mjs'
- '**/*.spec.mts'
- '**/*.spec.ts'
- '**/*.spec.tsx'
- '**/*.stest.ts'
- '**/*.stest.tsx'
- '**/*.test.cjs'
- '**/*.test.cts'
- '**/*.test.js'
- '**/*.test.jsx'
- '**/*.test.mjs'
- '**/*.test.cjs'
- '**/*.test.mts'
- '**/*.test.ts'
- '**/*.test.tsx'
- '**/*.test.mts'
- '**/*.test.cts'
3 changes: 3 additions & 0 deletions .github/workflows/chat-lib-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: chat-lib tests

on:
pull_request:
branches:
- main
- 'release/*'
workflow_dispatch:

permissions:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CodeQL

on:
push:
branches:
- main
- 'release/**/*'
pull_request:
branches:
- main
- 'release/**/*'
schedule:
- cron: '17 19 * * 6'

permissions: {}

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
packages: read
security-events: write
strategy:
fail-fast: false
matrix:
# Other detected languages occur only in test fixtures or build tooling.
include:
- language: javascript-typescript
build-mode: none
- language: rust
build-mode: none

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Initialize CodeQL
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
dependency-caching: true
config-file: ./.github/codeql/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
category: /language:${{ matrix.language }}
3 changes: 3 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
branches:
- main
- 'release/*'
paths:
- .github/workflows/copilot-setup-steps.yml

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/monaco-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
- name: Run Monaco Editor Checks
run: npm run monaco-compile-check

- name: Check generated Monaco declarations
run: npm run gulp monacodts-check

- name: Editor Distro & ESM
run: npm run gulp editor-distro

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/telemetry.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: 'Telemetry'
on: pull_request

on:
pull_request:
branches:
- main
- 'release/*'

permissions: {}
jobs:
check-metadata:
Expand Down
30 changes: 0 additions & 30 deletions CodeQL.yml

This file was deleted.

2 changes: 2 additions & 0 deletions build/azure-pipelines/dependencies-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ parameters:
type: string

variables:
- name: Codeql.SkipTaskAutoInjection
value: true
- name: NPM_REGISTRY
value: "https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/"
- name: VSCODE_QUALITY
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/product-build-ado-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ parameters:
- name: VSCODE_CLI_CANARY_VERSION
displayName: "Product @github/copilot runtime version ('auto' = infer from an SDK override)"
type: string
default: 1.0.84-canary.67.g6496fad.unsigned
default: 1.0.84-canary.70.gdb75d0d.unsigned

variables:
- name: VSCODE_PRIVATE_BUILD
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/product-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ parameters:
- name: VSCODE_CLI_CANARY_VERSION
displayName: "Product @github/copilot runtime version ('auto' = infer from an SDK override)"
type: string
default: 1.0.84-canary.67.g6496fad.unsigned
default: 1.0.84-canary.70.gdb75d0d.unsigned

variables:
- name: VSCODE_BUILD_TITLE_PREFIX
Expand Down
4 changes: 4 additions & 0 deletions build/azure-pipelines/publish-types/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ trigger:

pr: none

variables:
- name: Codeql.SkipTaskAutoInjection
value: true

pool:
vmImage: ubuntu-latest

Expand Down
14 changes: 13 additions & 1 deletion build/gulpfile.editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { createReporter } from './lib/reporter.ts';
import monacoPackage from './monaco/package.json' with { type: 'json' };

const root = path.dirname(import.meta.dirname);
const standaloneEnumsPath = path.join(root, 'src/vs/editor/common/standalone/standaloneEnums.ts');
const sha1 = getVersion(root);
const semver = monacoPackage.version;
const headerVersion = semver + '(' + sha1 + ')';
Expand Down Expand Up @@ -226,7 +227,18 @@ task.task('editor-distro',
task.task('monacodts', task.define('monacodts', () => {
const result = monacoapi.execute();
fs.writeFileSync(result.filePath, result.content);
fs.writeFileSync(path.join(root, 'src/vs/editor/common/standalone/standaloneEnums.ts'), result.enums);
fs.writeFileSync(standaloneEnumsPath, result.enums);
return Promise.resolve(true);
}));

task.task('monacodts-check', task.define('monacodts-check', () => {
const result = monacoapi.execute();
const currentEnums = fs.readFileSync(standaloneEnumsPath).toString();
const normalizedCurrentEnums = currentEnums.replace(/\r\n/g, '\n');
const normalizedGeneratedEnums = result.enums.replace(/\r\n/g, '\n');
if (!result.isTheSame || normalizedCurrentEnums !== normalizedGeneratedEnums) {
throw new Error('Monaco declarations are no longer up to date. Run `npm run gulp monacodts` and commit the generated files.');
}
return Promise.resolve(true);
}));

Expand Down
17 changes: 11 additions & 6 deletions build/next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,17 @@ function fileContentMapperPlugin(outDir: string, target: BuildTarget): esbuild.P
// Inject built-in extensions list
if (contents.includes('/*BUILD->INSERT_BUILTIN_EXTENSIONS*/')) {
if (builtinExtensionsReplacement === undefined) {
// Web target uses .build/web/extensions (from compileWebExtensionsBuildTask)
// Other targets use .build/extensions
const extensionsRoot = target === 'web' ? '.build/web/extensions' : '.build/extensions';
const builtinExtensions = JSON.stringify(scanBuiltinExtensions(extensionsRoot));
// Remove the outer brackets since the placeholder is inside an array literal
builtinExtensionsReplacement = builtinExtensions.substring(1, builtinExtensions.length - 1);
if (target === 'web' || target === 'server-web') {
// Web target uses .build/web/extensions (from compileWebExtensionsBuildTask)
// while server-web uses .build/extensions.
const extensionsRoot = target === 'web' ? '.build/web/extensions' : '.build/extensions';
const builtinExtensions = JSON.stringify(scanBuiltinExtensions(extensionsRoot));
// Remove the outer brackets since the placeholder is inside an array literal
builtinExtensionsReplacement = builtinExtensions.substring(1, builtinExtensions.length - 1);
} else {
// Native targets never consume the web-only bundled extension list.
builtinExtensionsReplacement = '';
}
}
contents = contents.replace('/*BUILD->INSERT_BUILTIN_EXTENSIONS*/', () => builtinExtensionsReplacement!);
modified = true;
Expand Down
20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const allowedJavaScriptFiles = fs.readFileSync(path.join(import.meta.dirname, '.
.map(line => line.trim())
.filter(line => line && !line.startsWith('#'));

const allowedBracketNotationFiles = fs.readFileSync(path.join(import.meta.dirname, '.eslint-allowed-bracket-notation-files'), 'utf8')
.toString()
.split(/\r\n|\n/)
.map(line => line.trim())
.filter(line => line && !line.startsWith('#'));

export default defineConfig(
// Global ignores
{
Expand Down Expand Up @@ -144,6 +150,20 @@ export default defineConfig(
]
},
},
// Disallow bracket notation for property names that can use dot notation.
{
files: [
'**/*.{js,cjs,mjs,ts,tsx,mts,cts}',
'.eslint-plugin-local/**/*.ts',
],
ignores: allowedBracketNotationFiles,
plugins: {
'local': pluginLocal,
},
rules: {
'local/code-no-bracket-notation-for-identifiers': 'warn',
},
},
// TS
{
files: [
Expand Down
5 changes: 0 additions & 5 deletions extensions/copilot/CodeQL.yml

This file was deleted.

Loading
Loading