Skip to content

Commit

Permalink
Merge pull request #299 from CompuIves/fix/local-changes
Browse files Browse the repository at this point in the history
fix: ensure that local change commands are registered
  • Loading branch information
CGNonofr authored Jan 2, 2024
2 parents 36d6a27 + 27d0d9e commit d25a893
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions rollup/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ const REMOVE_COMMANDS = new Set([
'debug.startFromConfig',
'debug.installAdditionalDebuggers',
'REMOVE_ROOT_FOLDER_COMMAND_ID',
'debug.openView'
'debug.openView',
'_files.windowOpen',
'_files.newWindow'
])

const KEEP_COLORS = new Set([
Expand Down Expand Up @@ -159,9 +161,15 @@ function isCallPure (file: string, functionName: string, node: recast.types.name
}

if (functionName === 'CommandsRegistry.registerCommand') {
if (file.includes('fileActions.contribution') || file.includes('workspaceCommands') || file.includes('mainThreadCLICommands')) {
if (file.includes('workspaceCommands') || file.includes('mainThreadCLICommands')) {
return true
}

const firstParam = args[0]!
if (firstParam.type === 'StringLiteral') {
const commandId = firstParam.value
return REMOVE_COMMANDS.has(commandId)
}
}

// Remove Registry.add calls
Expand Down

0 comments on commit d25a893

Please sign in to comment.