Skip to content

Cannot locate the config file under remote env #7

@luliangce

Description

@luliangce

current version find the config file(etc. python.json) from System's User Dir

get userSnippetFilePath(): string {
        let platform: string = os.platform();
        let AppDataPath: string;
        switch (platform) {
            case 'win32':
                AppDataPath = process.env['VSCODE_APPDATA'] || process.env['APPDATA'] || path.join(process.env['USERPROFILE'] || "", 'AppData', 'Roaming');
                break;
            case 'darwin':
                AppDataPath = process.env['VSCODE_APPDATA'] || path.join(os.homedir(), 'Library', 'Application Support');
                break;
            case 'linux':
                AppDataPath = process.env['VSCODE_APPDATA'] || process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config');
                break;
            default: throw new Error('Platform not supported');
        }
        return path.join(AppDataPath, "Code", "User", "snippets", `${this.language}.json`)
    }

unfortunately, this didn't work well with vscode-remote environment.

i will try fix this in next few days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions