Win10 x64 1809
My English is not good.
provider.ts
function resolvePath(path: string, associated: string): string {
if (workspace.workspaceFolders === undefined) {
return path;
}
let parsedFilePath = Path.parse(path);
let parsedWorkspacePath = Path.parse(workspace.workspaceFolders[0].uri.path);
let variables: any = {
// the path of the folder opened in VS Code
'workspaceFolder': parsedWorkspacePath.dir,
// the name of the folder opened in VS Code without any slashes (/)
'workspaceFolderBasename': parsedWorkspacePath.name,
// the current opened file
'file': path,
// the current opened file relative to workspaceFolder
'relativeFile': Path.relative(parsedWorkspacePath.dir, path),
// the current opened file's basename
'fileBasename': parsedFilePath.base,
// the current opened file's basename with no file extension
'fileBasenameNoExtension': parsedFilePath.name,
// the current opened file's dirname
'fileDirname': parsedFilePath.dir,
// the current opened file's extension
'fileExtname': parsedFilePath.ext,
};
const variablesRe = /\$\{(.*?)\}/g;
const resolvedPath = associated.replace(variablesRe, (match: string, name: string) => {
const value = variables[name];
if (value !== undefined) {
return value;
} else {
// leave original (unsubstituted) value if there is no such variable
return match;
}
});
// normalize a path, reducing '..' and '.' parts
return Path.normalize(resolvedPath);
}
For example,if my source file is E:/code/a.cpp,and my "disasexpl.associations" setting is the default:
This function returns \e:\code\a.S
So I think it should be this:
function resolvePath(path: string, associated: string): string {
if (workspace.workspaceFolders === undefined) {
return path;
}
let parsedFilePath = Path.parse(path);
let parsedWorkspacePath = Path.parse(workspace.workspaceFolders[0].uri.path);
let variables: any = {
// the path of the folder opened in VS Code
'workspaceFolder': parsedWorkspacePath.dir,
// the name of the folder opened in VS Code without any slashes (/)
'workspaceFolderBasename': parsedWorkspacePath.name,
// the current opened file
'file': path,
// the current opened file relative to workspaceFolder
'relativeFile': Path.relative(parsedWorkspacePath.dir, path),
// the current opened file's basename
'fileBasename': parsedFilePath.base,
// the current opened file's basename with no file extension
'fileBasenameNoExtension': parsedFilePath.name,
// the current opened file's dirname
'fileDirname': parsedFilePath.dir,
// the current opened file's extension
'fileExtname': parsedFilePath.ext,
};
const variablesRe = /\$\{(.*?)\}/g;
const resolvedPath = associated.replace(variablesRe, (match: string, name: string) => {
const value = variables[name];
if (value !== undefined) {
return value;
} else {
// leave original (unsubstituted) value if there is no such variable
return match;
}
});
return resolvedPath;
}
Win10 x64 1809 My English is not good. provider.ts
For example,if my source file is E:/code/a.cpp,and my "disasexpl.associations" setting is the default:
This function returns \e:\code\a.S So I think it should be this: