Skip to content

rename function name doesn't work in C project #12238

@jishihao-001

Description

@jishihao-001

Environment

  • OS and Version: Windows_NT x64 10.0.18362
  • VS Code Version: Code 1.88.1
  • C/C++ Extension Version: 1.20.1
  • If using SSH remote, specify OS of remote machine: none

Bug Summary and Steps to Reproduce

Bug Summary:

In a c project, when I try to rename function name or variables, i got :
A definition for the selected symbol could not be located.

even the function is only defined and used in merely one file.

I do the "rescan", disable and enable the cpptools and restart VSCode, none works.

Steps to reproduce:

  1. rename a function
  2. gives me "A definition for the selected symbol could not be located."

Expected behavior:
renaming should success

Configuration and Logs

c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\Program Files\\LLVM\\bin\\clang.exe",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-clang-x64"
        }
    ],
    "version": 4
}

Other Extensions

Extension | Author (truncated) | Version
doxdocgen | csc | 1.4.0
cpptools | ms- | 1.20.1
vscode-typings | typ | 0.0.5
clang-format | xav | 1.9.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions