Skip to content

Excluded files shouldn't be included in the symbol resolution. #4095

@smwikipedia

Description

@smwikipedia

Type: LanguageService

Describe the bug
I have a folder containing below files. The func1.c and func2.c contains 2 functions definitions. They are for the same function name but with different implementation.

Below are the folder/file details.

image

(func.h)

void func();

(func1.c)

void func()
{
    int a;
    a++;
}

(func2.c)

void func()   // Same function name but with different implementation
{
    int b;
    b++;
}

(main.c)

#include "func.h"
int main()
{
    func();
}

I use files.exclude to exclude one of the c files, func2.c from workspace. And the func2.c disappeared from the workspace explorer indeed.

(settings.json)

{
    "files.exclude": {
        "func2.c": true
    }
}

I expect the file parsing / symbol resolution should do the same exclusion when looking for definition for func().

But actually, after I reset the intellisense database, definitions from both func1.c and func2.c are still listed.

image

  • OS and Version:

  • VS Code Version:
    Version: 1.37.0 (user setup)
    Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
    Date: 2019-08-08T02:33:50.993Z
    Electron: 4.2.7
    Chrome: 69.0.3497.128
    Node.js: 10.11.0
    V8: 6.9.427.31-electron.0
    OS: Windows_NT x64 10.0.16299

  • C/C++ Extension Version:
    0.25.0-insiders2

  • Other extensions you installed (and if the issue persists after disabling them):

  • A clear and concise description of what the bug is.

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Go to DefinitionAn issue related to Go to Definition/Declaration.Language ServicefixedCheck the Milestone for the release in which the fix is or will be available.quick fixverifiedBug has been reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions