-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ampscript extensions checker * implemented different warning message for MCFS extension
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import * as vscode from 'vscode'; | ||
|
||
export function extensionsChecks() { | ||
const extensionHandlers = { | ||
// "publisher.extensionName": | ||
"sergey-agadzhanov.AMPscript": { | ||
// handler returns false if the extension is incompatible, true otherwise. | ||
// handler can also run additional actions in the case there's a need. | ||
handler: () => { | ||
vscode.window.showInformationMessage(`The extension MCFS [AMPScript] is incompatible with AMPscript Core and will prevent AMPscript Core from debugging AMPscript.`); | ||
return false; | ||
} | ||
} | ||
}; | ||
|
||
let allSupported = true; | ||
for (let extensionId in extensionHandlers) { | ||
const extension = vscode.extensions.getExtension(extensionId); | ||
if (extension) { | ||
const handler = extensionHandlers[extensionId as keyof typeof extensionHandlers].handler; | ||
if (handler) { | ||
const result = handler(); | ||
if (result === false) { | ||
allSupported = false; | ||
} | ||
} | ||
} | ||
} | ||
return allSupported; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters