最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - How to retrieve the PATH variable from my vscode extension - Stack Overflow

programmeradmin2浏览0评论

I am building my own vscode extension and part of the task is to retrieve and edit the $PATH variable from my typescript code in the activation function. Here is what I tried

import * as vscode from 'vscode';
import { logger } from '../logger';
import { string } from 'yargs';
export const activate = async (context: vscode.ExtensionContext): Promise<void> => {
    
    const path = context.environmentVariableCollection.get('$PATH');

    logger.debug('Extension Pack activated');
};

The problem is that the function context.environmentVariableCollection.get('$PATH') always returns an undefined variable for some reason.

Any hints?

P.s. I am specifically asking how can I do it using the vscode API and not how to do it using Node.js

发布评论

评论列表(0)

  1. 暂无评论