May 31, 2021 Article blog
Recently encountered an interesting bug, is about the VSCode editor plug-in, the project time is very tight, to be honest at this time the usual easy-going IDE problems very affect the mood. "It's like you're driving on a highway, eating hot pot and singing, and suddenly the tires are blowing, and you're not angry."
But the process of finding bugs and pushing for bug fixes is a bit interesting, "finally locating and re-emerging the bug through a series of attempts, and bringing issue to the official Microsoft repository of the project, which was eventually fixed in the latest version and shared this interesting process with everyone."
"Also show you how to participate in open source projects by mentioning issue", of course, there are many ways to participate in open source projects, "you can contribute source code to the project, even as an ambassador to help promote the project, find the bug of the project and then mention issue is also a way to participate", in short, get involved before you can find the fun of open source!
Last week, another night in the company, as if there is no difference with the usual, lemon brother in overtime, quickly tap their own mechanical keyboard, skilled with VSCode to browse the project source code, press
F12+Shift
to see where this function was referenced, strange things happened, this VSCode it did not listen to the call, can not find the results of the reference, and the terminal prompt is the following error:
快速信息操作失败: FE: 'Compiler exited with error - No IL available'
快速信息操作失败: FE: 'Compiler exited with error - No IL available'
At first I thought it was a single engineering analysis problem, "No panic, not a big problem".
Later changed the engineering attempt, "no matter how I repeatedly rub my white keyboard cap, always can not come out to find the results of the reference interface", only then found that the rough big thing. Work to do good must first although the progress is a bit catch up, or stop Kangkang who is messing around?
If you can't find the reference, it will be very inconvenient to encode and read the source code, "This function is the basic function of the IDE, if even this function is disabled, then I want you this VSCode what use?" If I can't fix it, I guess I'll run away from it and use it back to Visual Studio or CLion.
But VSCode remote development is really fragrant, and has been used to VSCode operation, before giving up still want to struggle, see can not be salvaged? But if it really can't, there's no time to die, the project has to go on, it's a big deal to change the IDE to continue to play, and even think about the face no longer say VSCode incense.
Although I didn't write this plug-in, I followed the general programmer's idea of troubleshooting bugs, step by step through the next few steps to find out the cause of the problem, and eventually push for an official version update to fix it, let's take a look.
"First of all, let's see if it's a problem caused by a VSCode version upgrade." As follows, I check the version information for VSCode.
Carefully check the difference between the version number and the official website, comparing the time of the problem has not been upgraded before and after the new version.
OK, "should not be a problem caused by a VSCode version upgrade."
Since it's not a problem caused by a VSCode upgrade, it's strange that a good night's day and night suddenly don't work? D oesn't this plug-in want to work overtime? I fell into a meditative, but immediately moved, "Will you carefully change the C?
"Here's a knowledge point to write down, to test."
VSCode has a profile called
c_cpp_properties.json
which is primarily used to configure the underlying information of the C/C?project, such as:
"Predefined macros, specified compiler paths, predefined header file search paths, and so on."
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/lemon/handsome/thirdparty/**",
"/lemon/smart/inc/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
As smart as I am, it must be that there is a problem with the
include
search path configuration of this project, which led to the failure to find the reference, hurry to check the profile, so expertly knock down
Ctrl+Shift+P
"Find all commands and configurations"
("Knock on the blackboard!").
This command is very common, back down"),
enter the keyword
c++ Edit
did match the profile, open is the profile above.
But it seems that the file path is right, no matter, dead horse when live horse doctor, first all delete reconfiguration again to see the effect, after an operation excited check whether it is useful, but egg, or that damn tip
FE: 'Compiler exited with error - No IL available'
the mentality is a bit of a collapse.
It's a bit weird to find out, and to get to this point, "I can almost tell if something's wrong with the Linux development environment, but I'm not sure if it's my machine environment or vsCode itself under Linux, so what?" Let's prove it's a problem under Linux first!
I tried not to open the remote development mode, the remote Linux machine project directly to the host local folder, and then use VSCode to open the host on the local project, "it actually works very well, there is no error prompt, to this point, it is completely certain that this bug only appeared in the Linux environment."
"The night has been deep, get up for a glass of water, look at the next time, overtime bus is almost to the end of the shift. 」
Things have come to this point, it seems that really want to turn off remote development, in the local reconfiguration of all the projects, on the surface or advise themselves to find reasons again, nothing, the problem is not big.
After drinking the water, I sat down and thought, "Could there be something wrong with the expansion of C??" As we all know, VSCode can only be said to be an editor, can make him change to the C?IDE is completely behind the C? plug-in or called extension support."
Is the following black and black goods, it is VSCode can support the development of the man behind the development of C, it is well known that VSCode is Microsoft's own son, look at this plug-in author
Microsoft
also seems to be Microsoft's own family developed plug-ins, before release must have been rigorously tested, the problem is not big.
But now no one can believe that even Microsoft's own plug-in can not be trusted, pretend to calm analysis of a wave.
After careful thinking (but not at all), the final decision was made to come up with a programmer's must-kill technique: "Try restarting, uninstall and reload".
Click uninstall, uninstall complete, click install, reload complete, restart loading, in one go.
Excited small hands, ready to witness the miracle again, WTF, the problem is still not resolved, to tell you the truth, to do this part, lemon brother can be said to have been very desperate.
No matter go back to sleep first, there is everything in the dream, maybe the next day during the day there are new ideas.
Sure enough, the next day I had a new idea, and although it didn't work to uninstall the plug-in, our programmer had one last trick: "Fallback Version"!
It's time to perform real technology, "senior programmers certainly understand, often in the riverside station where there are non-wet shoes, version release problems, hasten to back life is the normal operation."
Then we have reason to suspect: "Microsoft got rid of an important feature when it released the latest version of this plug-in." But this thing sent out, is not the service side background service said fallback can fall back, if this plug-in is really bug can only wait for the next version of the repair, or our own operation fallback bar.
Find the plug-in and fall back as follows:
Lemon was not out of the latest repair version when the fallback, installed the problem version 1.0.0 plug-in, "look at this version number should be a larger version of the big change, the problem is normal."
The key is " to see that this release point is exactly the time I found the bug " , this time feeling closer and closer to the truth , at least in time is a bit of a match , there is reason to suspect that the plug-in is out of order , fall back to the previous stable version 0.29.0
"This miracle really happened, "Find Reference" it's back!"
And there's no
FE: 'Compiler exited with error - No IL available'
error prompt, in order to further confirm my judgment, I upgraded the plug-in to version 1.0.0 (stable), and then there was a problem.
"At this point, the bug is positioned successfully and can be re-verified, and the temporary solution is to fall back to the previous stable version."
Also remind, the company's other students also encountered this problem, I help other students to solve this problem, found that some people directly upgrade may have network problems, resulting in online upgrade can not, report errors:
At this time can go to the above I sent the official website to download the offline version of the plug-in installation package, after the end, according to the following operation upgrade can be, the effect and online upgrade the same.
Note that for some well-known reasons, "If you can't open the official website or download slowly, you can add my personal WeChat at the end of the text, note "Download plug-in" I send you downloaded plug-in".
Is that over? O
f course not.
them
issue
here for students who don't understand the Github open source project, what is
issue
"Class, look at the blackboard"!
❝ The issue of the Github project is used for team collaboration management and can record the feature to be implemented or the bug to be fixed in the form of a lift, so if we find a bug for an open source project, we can report the bug in the form of an open source project, alerting the project team to fix the follow-up.
Here's the github warehouse address for Microsoft's official C/C?plug-in: https://github.com/microsoft/vscode-cpptools
I went to write down the following issue, although it is described in English, we should be able to understand I do not translate verbatim, computer-related English back and forth on a few words, read more will write, to the broader meaning is to describe the bugs and problems I encountered when the environmental configuration information, convenient for them to locate and re-emerge problems.
issue title:
C/C++ Extension 1.0.0 some feature Not working When using in Remote-SSH remote development #6176
And described in detail the problems I encountered, in fact, after the above meal operation, lemons must be their version of the problem,
"but also friendly communication to promote the problem as soon as possible to solve the problem is the purpose, write the code why difficult to write code",
did not directly say that they have a problem, but euphemistically asked the next
I wonder if there is a problem with this latest Extension ?
Haha
I mention is at noon meal around 12 o'clock, when the United States side should still be early in the morning, I think certainly not so soon there is a reply, foreign programmers are still sleeping, how can also go to work in the morning to see the reply after, "but Wan Wan did not expect to receive a reply around 5 pm, really fast."
"But, wait, it seems that something is wrong",
note that the specific time in the image above has not been shown, just show a
2 days ago
when I saw the message notice a little surprised to deal with so quickly, curious to open the processing issue brother's github home page introduction.
The reply was from a software development engineer at Microsoft
VS Code C++ Extension
then positioned as
Redmod, WA
and specifically checked that it was
05:03
U.S. time at the time, and that the guy was working on the bug at 5 a.m.
"It's too good, and sure enough, the big guys write code in the middle of the night without sleeping, and I believe it when I see the 5 a.m. sun."
"Here, this bug is the perfect solution, from appearing on my machine to locating the lookup." Here's the official version link: https://github.com/microsoft/vscode-cpptools/releases with bugs that mention this fix.
Follow the latest release instructions for version 1.0.1. "If you use the Linux/MAC version of VSCode or, as I did, remotely developed the Linux version from the host, you may encounter the bug I said in this article", I automatically upgraded to 1.0.0 found bugs at 0.29.0, so I reported an issue to version 1.0.0, Microsoft officially fixed the above bug in version 1.0.1, "a picture to see the timeline."
Lemon here suggested: is using the 0.29.0 version of the plug-in students do not rise is not a big problem, but if you are using the 1.0.0 version, then pay attention to, this version in the scenario described in this article is problematic, or timely upgrade to the latest version as well.
In fact, today's scene is also a true reflection of the daily work of programmers, we are dealing with similar things every day, strange bugs have a thousand ways to produce, to do is to find out how he produced the cause, from this point of view programmers are All Sherlock Holmes.
This article comes from the public number: Back-end Technical School, by LemonCoder
Above is
W3Cschool编程狮
about
the discovery of VSCode a bug, Microsoft engineers actually reply in the early hours of the morning...
Related to the introduction, I hope to help you.