Clang Diagnostics for WindowsI wrote this extension becuase I was running into issues with the existing tooling for Visual Studio Code and Clang. This extension exists to support my own workflow and I'm commited to maintain this extension. I'll gladly fix bugs but pull requests should be discussed first. Fork if you want to hack off in another direction. FeaturesDisplay diagnostics from clang in Visual Studio Code. RequirementsYou need to have the command Additionally; unless you run Visual Studio Code from within an environment that sets system include search paths you will have to specify these through configuration. For example, Microsoft Visual C++ 2015 compiler (cl.exe) configuration is as follows:
System include search paths never yield diagnostics. How do I figure out what paths to include?These are system internals and not something which I find to be well documented. However, it's relativly simple to reverse engineer.
Review the path information and set up include search paths accordingly. Extension Settings
WarningsFor a comprehensive list of warnings that clang generates, see this reference. Implementation detailsThe following options are hardcoded and shouldn't be changed.
Known IssuesHeader files are treated as C++ files, regardless of thier extension. Header files passed directly to clang for analysis disable There's no way to distinguish what the cause of a Clang fatal error is, as such, these are shown in the output window. If the error didn't yield any diagnostic for the analyzed file the output window is shown with the relevant output from Clang directly. Hopefully this will make it easier to understand when Clang needs to be configured to work properly. Analysis for multiple documents in parallel is done when configuration is updated. This can result in output getting lost in the output window. This only happens when the configuration is changed while more than 1 document with the Release Notes0.0.10Feature: Added support for expansion of environment variables in settings 0.0.7 - 0.0.8Bugfix: Track where diagnostics goes to prevent stale diagnostics from lingering. 0.0.6Feature: Diagnostics from files other than the main file passed to Clang are now shown. 0.0.5Bugfix: Fixed nasty bug where inner loop variable shadowed outer loop variable and caused infinite loop. 0.0.4Bugfix: Clang diagnostics parse error. 0.0.3Bugfix: workspace relative include search paths. 0.0.2Bugfix: support multiple source range info hints for the same diagnostic. 0.0.1Initial release |