Screen shot of the error in VS Code:
Even with checking phpinfo() you will see gnupg installed and an active extension. The code will execute properly. But in VS Code you are given a fatal error and red underline when calling the class. A class that is supposed to be globally available.
I would like to correctly fix the problem and not just hide or ignore the red underline. Could not find a direct solution by searching the settings for anything related to "undefined type". Only the option to ignore "undefined type" error all together (not an option for me)
I've found the proper solution scattered under various titles that tend to be too specific in request. Here I answer the question in a way that allows all languages being coded under VS Code to have easy access to a common error.
Location of the settings:
File (menu) -> Preferences -> Settings
You will have to click on the Extension in the list to the left.
Scroll down to the end of the list, there will be a button "Add Item".
This opens up a menu to scroll another list and add any available extension (which provides the class).
Do this for all extensions in your list (may have more or less in yours)