首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >多设置配置文件

多设置配置文件
EN

Stack Overflow用户
提问于 2022-10-19 00:08:23
回答 1查看 38关注 0票数 2

多个配置配置文件。

假设我使用了两种或两种以上的技术。例如PHP和JS (nodejs)。

有可能有一个PHP概要文件,其中vscode将全部设置为php,而另一个配置文件的vscode全部设置为nodejs。

我提出这个问题,这样我就不必在vscode中填充那些在那时我不会使用的扩展。只使用与当时使用的技术相关的内容。

有可能这样做吗?

EN

回答 1

Stack Overflow用户

发布于 2022-10-19 01:30:48

您可以在专用文件夹中安装一组特定于技术的扩展,并启动配置为使用该文件夹的vscode实例。

例如(对于Mac,我可以想象Windows上的过程是类似的):

我从一个包含nodephp项目的文件夹以及一个将安装扩展的空vscode-ext开始:

代码语言:javascript
运行
复制
❯ # ~/src/local/vscode-multi-project

❯ tree
.
├── node
│   └── index.js
├── php
│   └── index.php
└── vscode-ext

3 directories, 2 files

将特定于项目的扩展安装到各自的文件夹中(也可以使用UI )。

代码语言:javascript
运行
复制
❯ code --extensions-dir vscode-ext/node --install-extension chris-noring.node-snippets
Installing extensions...
Installing extension 'chris-noring.node-snippets'...
(node:54394) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Electron --trace-deprecation ...` to show where the warning was created)
Extension 'chris-noring.node-snippets' v1.3.3 was successfully installed.

❯ code --extensions-dir vscode-ext/php --install-extension xdebug.php-debug
Installing extensions...
Installing extension 'xdebug.php-debug'...
(node:54476) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Electron --trace-deprecation ...` to show where the warning was created)

❯ tree -L 3
.
├── node
│   └── index.js
├── php
│   └── index.php
└── vscode-ext
    ├── node
    │   └── chris-noring.node-snippets-1.3.3
    └── php
        └── xdebug.php-debug-1.29.0

7 directories, 2 files

确保安装了扩展

代码语言:javascript
运行
复制
❯ code --extensions-dir vscode-ext/node node

代码语言:javascript
运行
复制
❯ code --extensions-dir vscode-ext/php php

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74118617

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档