In an extension I am writing, I want to redefine an existing setting in the workspace to point at a script I am packaging with the extension. On a mac this script lives in <
You can get that information by the asAbsolutePath()
method of the ExtensionContext.
This method gets you the absolute path of a resource for a given relative path (regarding your project root).
Therefore I suggest you to change your code to the following:
export async function activate(context: vscode.ExtensionContext) {
const execLocation = context.asAbsolutePath("script");
console.log("Absolute exec location: " + execLocation);