MCPcopy Create free account
hub / github.com/Marus/cortex-debug / getWsFolder

Method getWsFolder

src/frontend/extension.ts:658–682  ·  view source on GitHub ↗
(folder: string, def: vscode.WorkspaceFolder, childName)

Source from the content-addressed store, hash-verified

656 }
657
658 private getWsFolder(folder: string, def: vscode.WorkspaceFolder, childName): vscode.WorkspaceFolder {
659 if (folder) {
660 const orig = folder;
661 const normalize = (fsPath: string) => {
662 fsPath = path.normalize(fsPath).replace(/\\/g, '/');
663 fsPath = (fsPath === '/') ? fsPath : fsPath.replace(/\/+$/, '');
664 if (process.platform === 'win32') {
665 fsPath = fsPath.toLowerCase();
666 }
667 return fsPath;
668 };
669 // Folder is always a full path name
670 folder = normalize(folder);
671 for (const f of vscode.workspace.workspaceFolders) {
672 const tmp = normalize(f.uri.fsPath);
673 if ((f.uri.fsPath === folder) || (f.name === folder) || (tmp === folder)) {
674 return f;
675 }
676 }
677 vscode.window.showInformationMessage(
678 `Chained configuration for '${childName}' specified folder is '${orig}' normalized path is '${folder}'` +
679 ' did not match any workspace folders. Using parents folder.');
680 }
681 return def;
682 }
683
684 private getCurrentArgs(session: vscode.DebugSession): ConfigurationArguments | vscode.DebugConfiguration {
685 if (!session) {

Callers 1

startChainedConfigsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected