Skip to content

Expose "effective" SourceFileConfiguration to other extensions #5038

@henryju

Description

@henryju

Hi,

Context: I am a developer of the SonarLint static code analyzer. We (SonarSource) have a C/C++ analyzer, and this is one of the most voted feature request by our users to add support of analyzing C/C++ code in VSCode:
https://community.sonarsource.com/t/sonarlint-for-vscode-c-c-support/4732/9
https://community.sonarsource.com/t/sonarlint-vscode-cfamily-support/14566/4

In order to analyze C/C++ source files, our analyzer needs to know compilation settings (compiler, flags, includes, ...). I started to study your extension, and discovered c_cpp_properties.json configuration file, as well as the ability for third party extensions to contribute configuration directly using the extension API:
https://github.com/microsoft/vscode-cpptools-api/blob/master/api.ts#L137

I found very similar requests (#1524, #3978) that were closed after the active configuration was exposed, and suggesting to rely on c_cpp_properties.json. But to me this is not a good solution as configuration may also come from the provider api.

I wonder if you would be open to create a new API, not to contribute SourceFileConfiguration, but for a third party extension to read the effective SourceFileConfiguration (the one you will use on the language server side, after resolving all contributions, and maybe after resolving default compiler includes).

FYI we already did a similar collaboration with the Java team from Microsoft, to enable Java code analysis :)
SonarSource/sonarlint-vscode#28 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions