vscode 离线安装插件

文章目录

    • 前言
    • 过程中的log
    • [Remote - SSH 安装到 local](#Remote - SSH 安装到 local)
    • [利用 remote-ssh 在 remote 机器上安装插件](#利用 remote-ssh 在 remote 机器上安装插件)

前言

c 复制代码
以
local  : remote-ssh
remote : c/c++ clangd
为例
注意 : 这三个插件 就可以满足 远程 阅读并调试 C 代码,当然还有和这三个插件相关的 "工具或服务器" 和 配置
	远程 : remote-ssh	ssh & sshd & vscode-server.tar.gz
	阅读 : clangd  		clangd-server
	调试 : c/c++ 		gdb & launch.json
c 复制代码
Download Extension
  • VSCode Remote Development
c 复制代码
VSCode Remote Development 插件包括以下插件:

Remote - SSH
Remote - SSH: Editing Configuration Files
Remote - SSH: Explorer
Remote - SSH: URI
Remote - Development
Remote - Containers
Remote - WSL
这些插件可以帮助您在远程服务器、容器或 Windows Subsystem for Linux (WSL) 上进行开发,并提供与本地开发环境相同的体验。
  • 配置
c 复制代码
主要是一些路径相关的配置
右键 插件 , 点击 Extension Settings 
此时搜索框会呈现出 一个 插件的名字,在其后 空格, 然后输入 path 搜索即可

过程中的log

  • 全局log
c 复制代码
在 VS Code 中打开命令面板,方法是按下 Ctrl+Shift+P(Windows 和 Linux)或 Cmd+Shift+P(macOS)。
输入 Developer: Toggle Developer Tools 并选择该选项,这将打开开发者工具。
  • 使用 remote-ssh 时会产生的log
c 复制代码
Remote-SSH:Show Log

Remote - SSH 安装到 local

  • 1.离线安装Remote - SSH 到local
c 复制代码
下载插件
打开VSCode,点击扩展,然后点击右侧的三个点,选择从VSIX文件安装
  • 2.设置 local 的ssh
c 复制代码
"remote.SSH.path" : "/path/to/ssh.exe"  // 本地的ssh客户端绝对地址
c 复制代码
打开vscode 输出,查看commit id

https://update.code.visualstudio.com/commit:将保存的ID拷贝至这里/server-linux-x64/stable

下载得到 vscode-sever.tar.gz

安装到 ~/.vscode-server/bin/
  • 4.设置 remote vscode-server 的path
c 复制代码
// remote 侧的 vscode-server 安装的地址
"remote.SSH.serverInstallPath": {
    "1": "~/.vscode-server/bin/" // ~/.vscode-server/bin/ 下有 code-server
},

或者 右键 Remote-SSH , 点击 Extension Settings
	User -> Remote.SSH: Server Install Path

利用 remote-ssh 在 remote 机器上安装插件

c/c++

  • 离线安装
c 复制代码
将插件放置到 remote 机器上
remote-ssh 连上之后 // 注意, 和之前不同,这次是 "remote-ssh 连上之后" , 则会安装到 remote 机器上
打开VSCode,点击扩展,然后点击右侧的三个点,选择从VSIX文件安装
注意: 下载的 c/c++ 插件要和 服务器相匹配,例如是 linux X64
  • 默认安装路径
c 复制代码
~/.vscode-server/extensions/extensions.json // 插件描述
~/.vscode-server/extensions/clangd // clangd 插件所在目录 // 注意clangd插件和 clangd 服务器是不同的!
~/.vscode-server/extensions/cpptools // c/c++ 插件所在目录

~/.vscode-server/data/ 				// 所有插件的数据

~/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435 // vscode-server 所在目录 // 注意 : 这不是一个插件

clangd

  • 安装 和 c/c++ 一样
  • 配置 clangd 服务器
c 复制代码
去 https://github.com/clangd/clangd/releases 下载 clangd 二进制文件
然后安装到 ~/bin 下,然后设置 将 export PATH=~/bin:$PATH 写入~/.bashrc
然后重启 vscode
相关推荐
MicrosoftReactor9 小时前
技术速递|超越一刀切:为 GitHub Copilot CLI 和 VS Code 实现决策路由
vscode·ai·github·copilot·决策路由
2501_9159184118 小时前
Windows 上开发 React Native iOS,真机调试、Fast Refresh 与打包 ipa
windows·vscode·react native·ios·个人开发·swift·敏捷流程
golang学习记1 天前
Zed Git重大更新:目录级对比支持分栏Diff
git·vscode·zed
2501_915106322 天前
iOS 单元测试怎么跑?用 KXApp 在 VS Code 里跑 XCTest 和 Swift Testing
ide·vscode·ios·单元测试·个人开发·swift·敏捷流程
golang学习记3 天前
VS Code Agents新特性:标签页式工作区选择器
vscode
golang学习记4 天前
VS Code Agents 新快捷键:一键穿梭主编辑器与Agent窗口
vscode·编辑器
2501_915106325 天前
Windows 用 KXBuild 开发 iOS 项目,CocoaPods、SPM 怎么处理?
windows·vscode·ios·个人开发·swift·敏捷流程·cocoapods
2501_915909065 天前
KXApp 能打开哪些 iOS 项目?xcodeproj 与 CocoaPods 支持清单
ide·vscode·ios·个人开发·xcode·敏捷流程·cocoapods
2501_916008896 天前
Windows 上写第一个 SwiftUI App,KXBuild 空工程起步,跑到 iPhone 真机
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
Piink6 天前
Mac使用Vscode教程
ide·vscode·macos