nRF Connect for VS Code bug related to ordering of extensions installation: non idempotency issue

I have tested this on Windows. This is a real killer: it turns out that it not only matters which extensions are present when using nRF Connect for VS Code, the order of installation matters. I will start with the simplest way to observe this problem. Then I will show a somewhat likely scenario.

1. Install nRF Connect for VS Code Extension Pack.

2. Uninstall or disable the C/C++ extension.

3. Install or enable the C/C++ extension to reverse step 2.

You now have all the correct extensions to use nRF Connect for VS Code. You also had the correct set of extensions after step 1, obviously. However, whereas after step 1, Intellisense worked, now, after step 3, if you open a file from the active application with the editor, you will see that none of the header files can be found by Intellisense. You can even uninstall and reinstall VS Code and the problem persists.

There is a solution:  disable and then reenable nRF Connect for VS Code Extension Pack or uninstall/reinstall that Extension Pack.

Here is a plausible scenario where somebody might fall into the trap: oftentimes a pop up occurs suggesting installing the C/C++ Extension Pack when the C/C++ extension is installed. Suppose I get enthused and install the C/C++ Extension Pack. Following that I will get a pop up telling me that one of the extensions in the C/C++ Extension Pack is incompatible with nRF for VS Code. So, I decide to simply remove the C/C++ Extension Pack. Now I have no Intellisense at all, and with some luck I realize that I have to reinstall the C/C++ extension. And that puts me in the post step 3 scenario: I have all the correct extensions installed for nRF Connect for VS Code, but Intellisense does not work.

Simply put, the lack of idempotency makes for a very brittle system. I spent over a day of concentrated effort to figure out why Intellisense was not working and how to fix it.

Can you do something to fix this? Thanks.

Regards,

Burt Silverman

  • Hi,

    There is a solution:  disable and then reenable nRF Connect for VS Code Extension Pack or uninstall/reinstall that Extension Pack.

    Instead of that, does it work for you to restart VS Code or run the command "Reload Window"?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd, thanks for looking at this. Your questions are to the point: indeed, I cannot replicate what I was seeing a few days ago, simply by uninstalling/disabling the C/C++ extension and then reinstalling/reenabling it. I mean, a few days ago restarting VS Code was having no effect (and I was not familiar with the Reload Window command at that time). What I did then to fix the problem was (eventually) delete anything appearing to be possibly relevant under \Users\Burt\AppData and \Users\Burt\.vscode and reinstall VS Code. So I am going to say that I am sure I got into a problem state, but I am unable to replicate it despite thinking that I had found a simple way to replicate it. I guess I will be optimistic and believe that it is unlikely I will fall into the trap again.

    Burt

  • Burt said:
    So I am going to say that I am sure I got into a problem state, but I am unable to replicate it despite thinking that I had found a simple way to replicate it. I guess I will be optimistic and believe that it is unlikely I will fall into the trap again.

    In that case, it is hard for us to know exactly what went wrong, so we will probably not be able to fix the specific issue.

    That being said, I have forwarded your report of the issue to our VS Code developers, so they are aware of a potential issue somewhere.

    Thank you for the throughout report, and good luck with your continued development!

Related