Skip to content

Commit a3a2b90

Browse files
committed
docs: add some code comments
1 parent 9ff0857 commit a3a2b90

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/extensionData.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export class ExtensionData {
3737

3838
public constructor(extensionPath: string | null = null) {
3939
// Set the path if provided, otherwise default to this extension's path.
40+
//
41+
// For this extension's path, we use `__dirname` and go up two levels
42+
// (from "out/src" to the extension root). This path is also used to locate all other
43+
// user-installed extensions later for the `userExtensionsPath` discovery path.
4044
this.extensionPath = extensionPath ?? path.join(__dirname, "../../");
4145

4246
this.packageJsonData = this.getExtensionPackageJsonData();
@@ -88,6 +92,9 @@ export class ExtensionData {
8892

8993
private setExtensionDiscoveryPaths() {
9094
// The path to the user extensions.
95+
//
96+
// On Windows/Linux/Mac: ~/.vscode[-server|remote]/extensions
97+
// On WSL: ~/.vscode-[server|remote]/extensions
9198
const userExtensionsPath = isWsl ? path.join(vscode.env.appRoot, "../../", "extensions") : path.join(this.extensionPath, "../");
9299

93100
this.extensionDiscoveryPaths.set("userExtensionsPath", userExtensionsPath);

0 commit comments

Comments
 (0)