vscode离线安装插件

背景:项目工程使用内网,无法使用互联网直接安装,只能通过离线安装

1、vue语法高亮vetur插件

2、代码修改记录Gitlens插件

插件下载地址:Extensions for Visual Studio family of products | Visual Studio Marketplace

下载好插件,在vscode安装目录,

windows系统查询vscode安装目录命令

复制代码
where code

在bin目录下执行命令

复制代码
# xxx.visx 是插件包的名称加后缀
code --install-extension xxx.visx

遇到问题

1、安装成功,但是工程不起作用

原因:使用的vscode版本不支持当前插件,需要下载低版本的插件

2、插件没有下载按钮

方法一:f12,在面板console执行js代码

复制代码
    //--------------------------marketplace.visualstudio.com----download-------------------------------//
    let vsMarketDownloader = (function () {
        return {
            addDownloadBtn: function () {
                if (window.location.host.toUpperCase() !== 'MARKETPLACE.VISUALSTUDIO.COM') return false;
                let arr = window.location.href.split('?')[1].split('=')[1].split('.');
                let author = arr[0];
                let id = arr[1];
                var histories = document.querySelectorAll('tr.version-history-container-row');
                for (var i = 1; i < histories.length; i++) {
                    let version = histories[i].firstChild.textContent;
                    let a = document.createElement('a');
                    a.className = 'bowtie-icon bowtie-install';
                    a.style = 'margin-left: 1rem;'
                    a.href = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${author}/vsextensions/${id}/${version}/vspackage`;
                    histories[i].firstChild.appendChild(a);
                }
                return true;
            }
        }
    })();
    setTimeout(() => {
        vsMarketDownloader.addDownloadBtn();
    }, 1200);

方法二:在git下载GitLens离线插件安装 vscode(无download extension选项)_gitlens插件下载-CSDN博客

相关推荐
与自己和解7411 小时前
使用ssh实现 VScode 直连 ubuntu
vscode·ubuntu·ssh
honkun61 小时前
vue 表格组件 vxe-table 实现拖拽列字段自动生成透视表汇总
前端·javascript·vue.js
leoZ2312 小时前
第 4 篇:布局骨架——页面壳、栅格、卡片
前端·javascript·vue.js·opencv·计算机视觉·数据挖掘·语音识别
何以解忧,唯有..2 小时前
Vue 3 模板语法详解:从插值到指令的完整指南
前端·javascript·vue.js
捷瑞电子工坊3 小时前
Ubuntu 下安装 VSCode 和 gcc 的简单步骤
vscode·ubuntu·代码编辑器·安装教程·gcc·deb·snap
sunoo-2293 小时前
【网络编程 + 数据库】select 与 epoll 核心区别详解 + SQLite 入门到 C 接口全攻略
linux·网络·数据库·vscode·学习·sqlite
雪芽蓝域zzs4 小时前
第十四节:后端返回权限动态路由
前端·javascript·vue.js
Rain5094 小时前
谁动了我的 URL?——记一次微前端“灵异 Bug“的排查实录
前端·vue.js·人工智能·前端框架·bug·ai编程
2501_915106324 小时前
第一次开发 iPhone App,可能碰到的问题,解决办法
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
何以解忧,唯有..5 小时前
Vue 3 响应式核心:ref() 与 reactive() 的深入解析与实战
前端·javascript·vue.js