更多新鲜技术资讯,欢迎关注公众号: 深度极客
了解更多开源技术,请关注以上公众号
步骤一:搭建环境
参考官方文档进行编译:
https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source
如果已经编译过,可以rm ~/.cache/node-gyp 删除缓存
1.首先安装nodejs和npm
sudo apt-get install nodejs
sudo apt-get install npm
2.安装yarn和node-gyp
npm install --global yarn
npm install -g node-gyp
如果之前已经安装,可以使用清除命令:
清除缓存命令:yarn cache clean
(安装node二进制包,更新包)https://phoenixnap.com/kb/update-node-js-version
sudo npm install node-gyp 升级npm
解决 node-gyp graceful-fs错误(这个问题可以不用解决):https://github.com/apostrophecms/mechanic/issues/19
步骤二:安装依赖
打开vscode目录,执行yarn命令
报错:
1.native-keymap : https://blog.youkuaiyun.com/AS_JOPO/article/details/106436785
2.vscode-ripgrep: Command failed : 再执行yarn
3.electron: Command failed : 再执行yarn
其它命令未找到或有错误也是重新执行即可
步骤三:调试
执行完上述命令,再执行./scripts/code.sh就可以开始调试了
(如果执行脚本出现chrome-sandbox权限问题,请执行下面的命令:sudo chown root:root chrome-sandbox,sudo chmod 4755 chrome-sandbox)
调试过程可能发现vscode oss无法安装扩展,参照下面的解决办法:
1.在系统中找到product.json文件
2.在其中添加如下内容:
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
参考网址:
https://stackoverflow.com/questions/37143536/no-extensions-found-when-running-visual-studio-code-from-source
3.调试过程会出现需要手动打开cpptools里面的后端,不然调试会报错
:vscode-cpptools/vscode-cpptools/Extension/debugAdapters/bin/OpenDebugAD7
其它
查看端口号命令,用于查看调试后端是否启动:
netstat -tunlp | grep vscode
更多新鲜技术资讯,欢迎关注公众号: 深度极客
5820

被折叠的 条评论
为什么被折叠?



