首页 > 编程语言 >VSCode 的扩展包C/C++ IntelliSense, debugging, and code browsing的IntelliSense功能无法使用

VSCode 的扩展包C/C++ IntelliSense, debugging, and code browsing的IntelliSense功能无法使用

时间:2023-03-12 14:32:32浏览次数:55  
标签:bin debugging code VSCode 扩展 vscode cpptools IntelliSense


文章目录

  • ​​1.说明​​
  • ​​2.结论​​
  • ​​3.c_cpp_properties.json文件的配置​​

1.说明

  • 在公司内网条件下,即出现以下的错误,就是不能连接微软的相关网站,​​从github上更新离线vs code​​​扩展包的结果就是,扩展包安装完毕,却不能完全使用。
    eg:C/C++ IntelliSense, debugging, and code browsing(VSCode Cpptools)内网条件下,依赖包可能不能更新完全,代码的跳转等功能不能使用,这是扩展包C/C++ IntelliSensese的问题,甚至出现以下的错误:
无法启动 C/C++ 语言服务器。IntelliSense 功能将被禁用。
错误: Missing binary at c:\Users\XXXXX\.vscode\extensions\ms-vscode.cpptools-0.26.2\bin\Microsoft.VSCode.CPP.Extension.exe
  • 这是因为VSCode Cpptools的扩展包相关的依赖包需要下载,即会在c:\Users\XXXXX.vscode\extensions\ms-vscode.cpptools-0.26.2\目录下(目录因人而异,但是大致差不多)的package.json文件中,进行相关依赖包的下载,该package.json文件的大致内容是
....
{
"description": "Visual Studio Windows Debugger",
"url": "https://go.microsoft.com/fwlink/?linkid=2082216",
"platforms": [
"win32"
],
"binaries": []
}
],
"__metadata": {
"id": "690b692e-e8a9-493f-b802-8089d50ac1b2",
"publisherDisplayName": "Microsoft",
"publisherId": "5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee"
}
....

2.结论

  • 参考下面的blog以及我的报错可知:是因为bin目录下面缺少Microsoft.VSCode.CPP.Extension.exe导致,所以我将相关的缺少文件添加到相关目录就解决了问题,最终实现了vs code的代码跳转功能
  • 我将VSCode Cpptools的相关所有依赖包以及我的VSCode Cpptools完整扩展包上传了,如果你缺少什么就加什么,也可以将这些包分别全加进行,参考我的完整扩展包即可,若还是不行,可以将我的完整扩展包替换掉你原来的扩展包!!!

(1)解压这些文件,会出来三个文件夹:bin,debugAdapters,LLVM。
把debugAdapters,LLVM这两个文件夹直接放在插件根目录一般是C:\Users\用户名\.vscode\extensions\ms-vscode.cpptools-0.20.1;

(2)把bin文件夹里的文件:Microsoft.VSCode.CPP.Extension.exe,Microsoft.VSCode.CPP.IntelliSense.Msvc.exe
放到C:\Users\用户名\.vscode\extensions\ms-vscode.cpptools-0.20.1\bin文件夹下。

(3)ms-vscode.cpptools-0.26.2是我已经做好的VSCode Cpptools完整扩展包
我的vs code版本是:1.40.2
  • 内网条件下,最好关掉vs code的更新,方法如下:
  • 内网条件下,最好关闭掉扩展包的更新,关闭扩展包的更新的设置如下,设置完后,就会如下图所示

3.c_cpp_properties.json文件的配置

  • 由于外网原因,可能不会在你的项目中配置c_cpp_properties.json文件,该文件就是加速find内容而已,要或者不要都可以
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
  • 所放位置如下:

参考:

VSCode离线安装C/C++插件以及依赖包

停止vscode的更新
https://jingyan.baidu.com/article/fc07f98940163812ffe5193b.html


标签:bin,debugging,code,VSCode,扩展,vscode,cpptools,IntelliSense
From: https://blog.51cto.com/u_12740336/6115848

相关文章

  • Codeforces Round 857 (Div. 2)
    题目链接A核心思路读懂题目也就不难了。//Problem:A.Likes//Contest:Codeforces-CodeforcesRound857(Div.2)//URL:https://codeforces.com/contest/180......
  • Codeforces比赛规则梳理
    1、排名div选手们按Rating以1700为界划分为Div.1和Div.2两类,Div.1的比赛较难,Div.1的ABC三题会和Div.2的CDE三题相同。每次比赛结束后Rating都会依据此前各个选手的Rating和......
  • Codeforces Round #666 (Div. 2)D. Stoned Game(博弈问题)
    problemT和HL玩游戏,n堆石头,玩家轮流在石堆中选择一个(但不能是上一个人取的那堆)取一个石子一旦有一方不能取石头则判输solution统计所有石头数,如果总数小于mx(最多石头的一堆)......
  • gitcode_上传代码成功之后的一些命令
    gitcode上传代码之后的一些命令Gitglobalsetupgitconfig--globaluser.name"小怪兽"gitconfig--globaluser.email"[email protected]"Createanewreposito......
  • 搭建良好编写体验的webgl编程环境 vscode+vit
    因为webgl代码是以字符串的形式嵌入在javascript代码中,这对于我们编写webgl代码的体验不友好,本文介绍如何搭建友好webgl编程环境:需要安装的vscode插件WebGLGLSLEdito......
  • Codeforces Round 857 (Div. 2)
    更好的阅读第一次进入时加载缓慢,请耐心等待。赛时降智,菜是原罪。A.Likes简单题。#include<bits/stdc++.h>usingnamespacestd;intT,n,a[11111],s[11111];intm......
  • leetcode-1394-easy
    FindLuckyIntegerinAnArrayGivenanarrayofintegersarr,aluckyintegerisanintegerthathasafrequencyinthearrayequaltoitsvalue.Returnthe......
  • leetcode-1408-easy
    StringMatchinginanArrayGivenanarrayofstringwords,returnallstringsinwordsthatisasubstringofanotherword.Youcanreturntheanswerinanyo......
  • leetcode-836-easy
    RectangleOverlapAnaxis-alignedrectangleisrepresentedasalist[x1,y1,x2,y2],where(x1,y1)isthecoordinateofitsbottom-leftcorner,and(x2,y2)......
  • leetcode-1122-easy
    RelativeSortArrayGiventwoarraysarr1andarr2,theelementsofarr2aredistinct,andallelementsinarr2arealsoinarr1.Sorttheelementsofarr1su......