microsoft / microsoft/vscode-cpptools

Support for vcxproj/sln projects

Open
#10,140 6 comments 53 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Configuration Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: Windows 11
  • VS Code Version: 1.74.0-insider
  • C/C++ Extension Version: v1.13.3

I'm trying to use vscode with C++ projects originally created in Visual Studio. These projects are configured via .sln and .vcxproj files. The code navigation is very limited. I cannot "go to definition" or "go to delcaration" when those definitions and declarations are in other files. I believe this is because cpptools doesn't parse vcxproj and sln files in the same way that it parses compile_commands.json databases or other similar files.

Bug Summary and Steps to Reproduce

Bug Summary:
"go to definition" or "go to delcaration" does not work when those definitions and declarations are in other files. This occurs in projects based on .vcxproj files

Steps to reproduce:

  1. Open a vcxproj/sln based project
  2. Click "Go To Declaration"
  3. editor doesnt show dclaration
Expected behavior

Ability to fully use all features that rely on cpptools knowing how the project is compiled.

Code sample and Logs
`c_cpp_properties.json`:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22621.0",
            "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "mergeConfigurations": true
        }
    ],
    "version": 4
}


### Screenshots

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the reported .sln and .vcxproj project and the shown c_cpp_properties.json configuration, following the Go To Declaration steps. Compare how these projects provide compilation information with compile_commands.json support. Done means declarations and definitions in other files are found and the relevant cpptools features work for Visual Studio projects.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
compilers, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.