Lemon brother sorted out 50 computer related e-books, pay attention to the public number “back-end technology School”, reply “1024” I send to you, reply “into the group” pull you into the reader technology 100 people communication group.

“This article launches personal wechat official account”, click to read the original article

Recently, I encountered an interesting bug about the VSCode editor plug-in. Recently, I was very busy with the project. To be honest, the problem of the IDE that I usually used at this time affected my mood very much. “It’s like you’re driving on the highway, eating hot pot and singing, and suddenly you get a flat tire, and you say you’re not angry.”

However, the process of finding the bug and promoting the bug repair was interesting. “I finally located and reproduced the bug through a series of attempts, and raised an issue to the official Microsoft warehouse of this project, and finally got the fix in the latest version. I share this interesting process with everyone”.

“Also to show you how to through the way of the issue involved in the open source project”, of course, there are many means of open source projects, “you can contribute to project source code, or even as an ambassador to help promote project, find the bug in project issue is also a way to participate in”, anyhow involved first, to discover the joys of the open source!

Weird error

Last week, it was another night in the company. It seemed to be the same as usual. Lemon was working overtime, quickly beating his mechanical keyboard, skillfully browsing the project source code with VSCode, and pressing F12+Shift to see where this function was quoted. This VSCode unexpectedly does not listen to it, can not check the result of reference, and the terminal prompts the following error:

FE: 'Compiler exited with error - No IL available'FE: 'Compiler exited with error - No IL available'Copy the code

At first, I thought it was a single project analysis problem, “don’t panic, the problem is not big”.

Later changed a project to try, “no matter how I repeatedly friction my white keyboard cap, still can not come out to find the reference to the results of the interface”, then found that the coarse event. If you want to do a good job, you have to do a good job. Even if it’s a little late, stop it. Kangkang, who’s doing this?


I’ve written several articles on how to build remote development environments with VSCode, and how to configure the development environment. I’m a big fan of VSCode.

How to configure vscode remote development tools

Good use of VSCode 13 plug-ins and 8 shortcuts, work efficiency increased 10 times

Continue to say before, if you can’t find references, that will bring great inconvenience to coding and reading the source code, “this function is the basic function of the IDE, if even this function is useless, then I want you this VSCode”? If I can’t fix it I’ll probably have to ditch it and go back to Visual Studio or CLion.

However, VSCode remote development is really delicious, and have been used to THE VSCode operation, before giving up still want to struggle, to see whether it can be rescued? But if it doesn’t work, there is no time to stop, the project will continue, the biggest thing is to change an IDE to continue to play, and even want to face no longer say VSCode incense.


Let’s find the bug

Although THIS plug-in is not written by me, I follow the general programmer’s idea of troubleshooting bugs, through the following steps to find the cause of the problem step by step, and finally promote the official version update to fix, let’s have a look.

Software problems?

“First, let’s see if the VSCode version is the cause of the problem”. I check the version information of VSCode by following the steps below.

Check the version

Carefully check the difference between the version number and the official website, and compare the time before and after the problem occurred.

OK, “it should not be caused by VSCode version upgrade”.

VSCode version confirmation

Configuration problem?

Since it is not the VSCode upgrade version caused by the problem, that is strange, the day is fine at night suddenly why not? Doesn’t this plugin want to work overtime? I was lost in thought, but then I thought, “could I have changed the C++ environment configuration file carefully?”

“Here is a knowledge point to write down, to test”. VSCode has a configuration file called c_cpp_properties.json, which is used to configure basic C/C++ project information, such as “predefined macros, specified compiler path, predefined header search path, etc.”.

{
    "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 } Copy the code

I’m sure there’s a problem with the include search path configuration, so I’m going to check the configuration file, and then I’m going to hit Ctrl+Shift+P “Find all commands and configurations” (” Knock on the blackboard! C++ Edit = c++ Edit = c++ Edit = c++ Edit

cpp_json

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ‘Compiler exited with error – No IL available’, mentality is a bit broken.


Environmental issues?

It’s a bit weird to get to the point where you say, “I’m almost sure it’s the Linux development environment, but I’m not sure if it’s my machine or VSCode on Linux, so what do I do? Let’s prove it’s Linux.”

I tried not to open the remote development mode, pulled the project on the remote Linux machine directly to the local folder of the host machine, and opened the local project on the host machine with VSCode. “It works very well, and there is no error message at all. By now, it is completely confirmed that this bug only appears in the Linux environment.”

The night is deep, get up to drink a cup of water, look at the time, overtime bus to the end of the fast.


Matter already so far, look really want to turn off remote development, reconfigure all project in the local, on the surface still advise oneself to seek reason again, have no matter, the problem is not big.

Plug-in issues?

After drinking the water, I sat down and thought, “is it possible that the C++ extension has a problem? Everyone knows that VSCode is only an editor that can make it into a C++ IDE with the support of C++ plug-ins or extensions behind it.”

Is the following black black this product, it is the man behind VSCode can support C++ development, as we all know VSCode is Microsoft’s pro son, look at this plug-in author Microsoft seems to be Microsoft’s own family development of the plug-in, before release must be through strict testing, the problem is not big.

C + + extension

But now nobody can be trusted, not even Microsoft’s own plugins, pretend to be calm and analyze a wave.


After careful consideration (which didn’t happen), I finally decided to do the programmer’s trick: “Reboot and try, uninstall and reinstall.”

Click uninstall, uninstall complete, click install, reload complete, restart loading, in one go.

Excited to rub his hands, ready to witness the miracle again, WTF, the problem is still not solved, to tell you the truth, to do this, Brother Lemon can be said to be very desperate.


The path of light

There is only one truth

Go back to sleep anyway, you’ll have everything in your dream, and you’ll have new ideas the next day.

Sure enough, the next day I had a new idea, although it didn’t work to uninstall the reload plug-in, but we programmers have one last trick: “back version”!

It was time to show the real technology, “veteran programmers must know, often standing in the river where there is no wet shoes, version release problems, quickly back to save life is routine operation”.


There is reason to suspect that “Microsoft dropped an important feature when they released the latest version of this plugin”. However, this thing has been sent out, and it is not the back-end service of the server that says it can be rolled back. If this plug-in is really a bug, it can only be fixed in the next version, or we can operate and roll back.

Find the plug-in and perform the rollback as follows:

Install the lower version

Lemon had not released the latest fix at that time, but installed the plugin with the problem version 1.0.0. “Look at this version number, it should be a big version with big changes, so it is normal to have problems”.

The key is “you can see that the release time of this version is exactly the time when I discovered the bug”, this time it feels closer to the truth, at least in terms of the timing, it is reasonable to suspect that there is a problem with this plugin, back to the last stable version 0.29.0

Select the plug-in installation version

“This time the magic really happened,” find reference function “it came back”! In addition, FE: ‘Compiler exited with error – No IL available’ did not appear. In order to further confirm my judgment, I upgraded the plug-in to version 1.0.0 (stable), and sure enough, the problem just happened again.

“At this point, the bug is successfully located and reproducible. The temporary solution is to roll back to the last stable version.”

Offline installation

In addition, I would like to remind you that other students in the company also encountered this problem. When I was helping other students solve this problem, I found that some students may have network problems when upgrading directly, leading to online upgrade failure, and an error was reported:

Automatic upgrade download failed. Procedure

At this time, you can go to the website I sent above to download the offline version of the plug-in installation package, after the next, according to the following operations to upgrade, the effect and online upgrade.

Procedure For installing plug-ins offline

Note, for some well-known reasons, “if you can’t open the official website or the download speed is slow, you can add my personal wechat and note” download plug-in “, I will send you the downloaded plug-in “.

Push version updates

The issue reported bugs

Is that it? Of course not. So I decided to go to the official warehouse of The plugin to issue it to them.” “Class, look at the blackboard!”

The issue of Github project is used for team collaboration management, and the feature to be implemented or the bug to be fixed can be recorded in the form of issue. Therefore, if we find the bug of open source project, we can report the bug in the form of issue to open source project. Remind the project team to follow up.

Here is Microsoft’s official C/C + + plugin making warehouse address: https://github.com/microsoft/vscode-cpptools

I wrote the following to this issue, although it is described in English, you should can understand I will not translate word by word, computer related English only so few words back and forth, the watch you can write, the effect is to describe the bugs and problems I encountered environment configuration information, convenient their positioning and recurring problems.

C/C++ Extension 1.0.0 some feature Not working When using in remote-SSH Remote Development #6176

Issue description

In fact, after the above operation, lemon must have problems with their version, “but friendly communication is the only purpose to promote the problem as soon as possible, why bother to write code”, without directly saying that they have problems. I wonder if there is a problem with this latest Extension? Ha ha

The perfect solution

Lunch hour when I mention issue is 12 o ‘clock, when the American side should remain in the morning, I don’t think must have responded so quickly, little brother programmers abroad is still in bed, how to also have to go to work in the morning to see after the reply, “but never expected around 5 o ‘clock in the afternoon, received a reply, really fast”.

Communication issue

“But wait, something seems to be wrong”, notice that the specific time is not shown in the picture above, only 2 days ago. When I saw the message notification, I was a little surprised at the speed of processing, so I was curious to open the github homepage for the processing of issue.

The developer of VS Code C++ Extension is Redmod WA in the us. The time is 05:03 in the us. The developer is working on the bug at 5am. “This is also too excellent, as expected the big guys are writing code in the middle of the night do not sleep, see the sun at 5 am I believe”.


Checking the

“Here, this bug from the appearance of my machine, to locate the search, the final fix is a perfect solution”. Here attached the official version of the link: https://github.com/microsoft/vscode-cpptools/releases, there are mentioned in the bug fix.

Version update

According to the latest 1.0.0 release notes, “if you use VSCode for Linux/MAC or use Linux from a host remotely as I do, you may encounter the bug I described in this article.” I found the bug in the automatic upgrade from 0.29.0 to 1.0.0. Therefore, I issued an issue to version 1.0.0. Microsoft officially fixed the above bug in version 1.0.1, “See the timeline in one picture”.

Version of the list

“If you’re using the 0.29.0 plugin, it’s fine to upgrade, but if you’re using 1.0.0, be aware that this version is problematic in the scenarios described in this article, and it’s best to upgrade to the latest version as soon as possible,” lemon advises.

“If the article is helpful to you, please do not hesitate to” like, comment, forward “to encourage me to continue to create.”

Wechat can search the public number “back-end technology school” reply “1024” to get 50 computer e-books, reply “into the group” pull you into the reader technology exchange hundred crowd, the article continues to update every week, we see next period!