diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index ae84f5be7f6..4ab5c3a0c74 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -6603,7 +6603,6 @@ "src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts": 227, "src/shared/plugins/contributions/plugin-custom-editor-contribution.test.ts": 238, "src/shared/plugins/contributions/plugin-panel-contribution.test.ts": 240, - "src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts": 232, "src/shared/plugins/declarative/plugin-declarative-catalog-rich.test.ts": 147, "src/shared/plugins/declarative/plugin-declarative-example.test.ts": 198, "src/shared/plugins/declarative/plugin-declarative-tree.test.ts": 168, diff --git a/src/shared/plugins/artifacts/plugin-syntax-artifact.test.ts b/src/shared/plugins/artifacts/plugin-syntax-artifact.test.ts index a9c3c0e398c..315f42a7dc2 100644 --- a/src/shared/plugins/artifacts/plugin-syntax-artifact.test.ts +++ b/src/shared/plugins/artifacts/plugin-syntax-artifact.test.ts @@ -11,18 +11,6 @@ function grammar(scopeName: string, body: Record = {}): string } describe('plugin syntax artifacts', () => { - it('refuses oversized and deeply nested grammars', () => { - const huge = grammar('source.demo', { comment: 'x'.repeat(1024 * 1024) }) - expect(() => parsePluginGrammarArtifact(huge, 'source.demo')).toThrow('exceeds') - let nested: Record = { match: 'a' } - for (let depth = 0; depth < 80; depth += 1) { - nested = { patterns: [nested] } - } - expect(() => - parsePluginGrammarArtifact(grammar('source.demo', { patterns: [nested] }), 'source.demo') - ).toThrow('nested too deeply') - }) - it('requires includes inside the plugin to resolve and lets outside scopes degrade', () => { const main = parsePluginGrammarArtifact( grammar('source.demo', { diff --git a/src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts b/src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts index c972e4b38a1..25641d2f847 100644 --- a/src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts +++ b/src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { parsePluginManifest, pluginManifestSchema } from '../manifest/plugin-manifest' +import { pluginManifestSchema } from '../manifest/plugin-manifest' function manifest(contributes: Record): Record { return { @@ -16,75 +16,6 @@ function manifest(contributes: Record): Record } describe('content-pack manifest contributions', () => { - it('still requires a worker entry for non-alias commands', () => { - expect( - parsePluginManifest( - manifest({ commands: [{ id: 'content-pack.run', title: 'Run content pack' }] }) - ) - ).toMatchObject({ ok: false, error: expect.stringContaining('worker command') }) - }) - - it.each([ - [ - 'unknown alias target', - { - commands: [{ id: 'open', title: 'Open', action: 'missing.action' }] - }, - 'unknown built-in action' - ], - [ - 'unknown command reference', - { keybindings: [{ command: 'missing', key: 'Mod+K' }] }, - 'unknown contributed command' - ], - [ - 'invalid chord', - { - commands: [{ id: 'open', title: 'Open', action: 'view.tasks' }], - keybindings: [{ command: 'open', key: 'Mod+NotAKey' }] - }, - 'key' - ], - [ - 'global binding for a worktree command', - { - commands: [{ id: 'open', title: 'Open', context: 'workspace', action: 'view.tasks' }], - keybindings: [{ command: 'open', key: 'Mod+K', when: 'global' }] - }, - "command's when" - ], - [ - 'platform-equivalent duplicate chords', - { - commands: [ - { id: 'first', title: 'First', action: 'view.tasks' }, - { id: 'second', title: 'Second', action: 'sidebar.left.toggle' } - ], - keybindings: [ - { command: 'first', key: 'Mod+K' }, - { command: 'second', key: 'Ctrl+K' } - ] - }, - 'duplicate keybinding' - ] - ])('rejects %s', (_label, contributes, error) => { - expect(parsePluginManifest(manifest(contributes))).toMatchObject({ - ok: false, - error: expect.stringContaining(error) - }) - }) - - it.each([ - ['language pack', { languagePacks: [{ locale: 'en_US', path: 'locale.json' }] }], - // Shape-legal but ill-formed: the regex alone let these load with dates falling back to English. - ['duplicate region', { languagePacks: [{ locale: 'en-US-US', path: 'locale.json' }] }], - ['unknown subtag', { languagePacks: [{ locale: 'en-aaa', path: 'locale.json' }] }], - ['language pack path', { languagePacks: [{ locale: 'pt-BR', path: '../outside.json' }] }], - ['VM recipe', { vmRecipes: [{ path: '\\\\server\\recipe.json' }] }] - ])('rejects unsafe or malformed %s contributions', (_label, contributes) => { - expect(parsePluginManifest(manifest(contributes)).ok).toBe(false) - }) - it('rejects duplicate ids, locales, paths, and bindings', () => { const parsed = pluginManifestSchema.safeParse( manifest({ diff --git a/src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts b/src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts deleted file mode 100644 index 46d8e49d6f3..00000000000 --- a/src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parsePluginManifest } from '../manifest/plugin-manifest' -import { - buildPluginApprovalRequest, - formatPluginApprovalMessage -} from '../approval/plugin-cli-approval' - -function manifest(statusBarItems: unknown[], engines = '>=1.4.248') { - return { - manifestVersion: 2, - execution: 'declarative', - id: 'status-demo', - name: 'Status demo', - version: '1.0.0', - engines: { orca: engines }, - contributes: { - commands: [{ id: 'demo.tasks', title: 'Open tasks', action: 'view.tasks' }], - statusBarItems - } - } -} - -describe('contributes.statusBarItems', () => { - it('lists items in the dev-load and inspect approval, and binds the fingerprint to them', () => { - const subject = (items: unknown[]) => { - const parsed = parsePluginManifest(manifest(items)) - if (!parsed.ok) { - throw new Error(parsed.error) - } - return { - pluginKey: 'dev:status-demo', - manifest: parsed.manifest, - consentFingerprint: 'c', - contentIdentity: 'h', - isDev: true - } - } - const request = buildPluginApprovalRequest( - subject([{ id: 'tasks', text: '3 open' }]), - 'dev-load' - ) - expect(formatPluginApprovalMessage(request)).toContain('statusBarItems "3 open"') - expect( - buildPluginApprovalRequest(subject([{ id: 'tasks', text: '4 open' }]), 'dev-load') - .approvalFingerprint - ).not.toBe(request.approvalFingerprint) - }) -})