I'm developing an extension for Visual Studio Code (in Visual Studio Code) and I'm trying to access the error codes of the messages I'm receiving by using the following code:
vscode.languages.onDidChangeDiagnostics((e) => {
e.uris.forEach((uri) => {
const diagnostics = vscode.languages.getDiagnostics(uri);
diagnostics.forEach((diagnostic) => {
let errorCode = diagnostic.code;
});
});
});
I've been able to infer what these error codes mean by comparing the error codes (from diagnostic.code) to the messages (diagnostic.messages) but I haven't been able to find offical documentation that provides information about what each of the error codes mean - hence, does anyone know where I can find the official documentation that provides information about these error codes.
Side note: My user is using the C language and the C/C++ extension provided by VSC.
If you know a little bit about VS Code internals, the error codes and messages come from language extensions, such as C/C++ extension from Microsoft.
The language extension, however, doesn't work on such things itself, but delegate the responsibilities to the language client and language server. Depending on the C language server/compiler you actually use, the error codes/messages can differ significantly.
For example, if your project is compiled by Visual C++ compiler, you can read Microsoft official documentation to learn what are the warnings/errors you should expect.
Other C compilers might or might not have similar articles.
References