thrownewError(localize('configNotFound',"'{0}' can not be resolved because setting '{1}' not found.",match,argument));
}
if(types.isObject(config)){
thrownewError(localize('configNoString',"'{0}' can not be resolved because '{1}' is a structured value.",match,argument));
}
thrownewError(localize('configNoString',"'{0}' can not be resolved because '{1}' is a structured value.",match,argument));
returnconfig;
}
thrownewError(localize('missingConfigName',"'{0}' can not be resolved because no settings name is given.",match));
default:{
if(argument){
constfolder=this.accessor.getFolderUri(argument);
if(folder){
folderUri=folder;
}
}
// common error handling for all variables that require an open folder and accept a folder name argument
switch(variable){
case'workspaceRoot':
case'workspaceFolder':
if(folderUri){
returnnormalizeDriveLetter(folderUri.fsPath);
case'workspaceRootFolderName':
case'workspaceFolderBasename':
case'relativeFile':
if(argument){
constfolder=this.accessor.getFolderUri(argument);
if(folder){
folderUri=folder;
}else{
thrownewError(localize('canNotFindFolder',"'{0}' can not be resolved. No such folder '{1}'.",match,argument));
}
}
if(this.accessor.getWorkspaceFolderCount()>1){
thrownewError(localize('canNotResolveWorkspaceFolderMultiRoot',"'{0}' can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",match));
if(!folderUri){
if(this.accessor.getWorkspaceFolderCount()>1){
thrownewError(localize('canNotResolveWorkspaceFolderMultiRoot',"'{0}' can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",match));
}
thrownewError(localize('canNotResolveWorkspaceFolder',"'{0}' can not be resolved. Please open a folder.",match));
}
thrownewError(localize('canNotResolveWorkspaceFolder',"'{0}' can not be resolved. Please open a folder.",match));
break;
default:
break;
}
// common error handling for all variables that require an open file
switch(variable){
case'file':
case'relativeFile':
case'fileDirname':
case'fileExtname':
case'fileBasename':
case'fileBasenameNoExtension':
if(!filePath){
thrownewError(localize('canNotResolveFile',"'{0}' can not be resolved. Please open an editor.",match));
thrownewError(localize('canNotResolveFolderBasenameMultiRoot',"'{0}' can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",match));
}
thrownewError(localize('canNotResolveFolderBasename',"'{0}' can not be resolved. Please open a folder.",match));
returnpaths.basename(folderUri.fsPath);
case'lineNumber':
constlineNumber=this.accessor.getLineNumber();
if(lineNumber){
returnlineNumber;
}
thrownewError(localize('canNotResolveLineNumber',"'{0}' can not be resolved. Please open an editor.",match));
thrownewError(localize('canNotResolveLineNumber',"'{0}' can not be resolved. Make sure to have a line selected in the active editor.",match));