Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C_Cpp.files.exclude not support glob patterns which files.exclude supported. #8960

Closed
XIVN1987 opened this issue Mar 2, 2022 · 6 comments
Closed
Assignees
Labels
bug enhancement Improvement to an existing feature Feature: Configuration An issue related to configuring the extension or IntelliSense fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@XIVN1987
Copy link

XIVN1987 commented Mar 2, 2022

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.64.2
  • C/C++ Extension Version: v1.8.4

Under directory hw/bsp, there is 63 sub-directory, i need only one of them (swm341).
First, i write SWM341_USBD.code-workspace like this:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "files.exclude": {
            "hw/bsp/broadcom_32bit":true,
            "hw/bsp/broadcom_64bit":true,
            "hw/bsp/brtmm90x":true,
            "hw/bsp/d5035_01":true,
            "hw/bsp/da14695_dk_usb":true,
            "hw/bsp/da1469x_dk_pro":true,
            "hw/bsp/ea4088qs":true,
            "hw/bsp/ea4357":true,
            "hw/bsp/esp32s2":true,
            "hw/bsp/esp32s3":true,
            "hw/bsp/f1c100s":true,
            "hw/bsp/fomu":true,
            "hw/bsp/frdm_k32l2b":true,
            "hw/bsp/frdm_kl25z":true,
            "hw/bsp/gd32vf103":true,
            "hw/bsp/imxrt":true,
            "hw/bsp/kuiic":true,
            "hw/bsp/lpc15":true,
            "hw/bsp/lpc18":true,
            "hw/bsp/lpc54":true,
            "hw/bsp/lpc55":true,
            "hw/bsp/lpcxpresso11u37":true,
            "hw/bsp/lpcxpresso11u68":true,
            "hw/bsp/lpcxpresso1347":true,
            "hw/bsp/lpcxpresso1769":true,
            "hw/bsp/lpcxpresso51u68":true,
            "hw/bsp/mbed1768":true,
            "hw/bsp/mm32":true,
            "hw/bsp/msp430":true,
            "hw/bsp/msp432e4":true,
            "hw/bsp/ngx4330":true,
            "hw/bsp/nrf":true,
            "hw/bsp/nutiny_nuc121s":true,
            "hw/bsp/nutiny_nuc125s":true,
            "hw/bsp/nutiny_nuc126v":true,
            "hw/bsp/nutiny_sdk_nuc120":true,
            "hw/bsp/nutiny_sdk_nuc505":true,
            "hw/bsp/pic32mz":true,
            "hw/bsp/rp2040":true,
            "hw/bsp/rx":true,
            "hw/bsp/samd11":true,
            "hw/bsp/samd21":true,
            "hw/bsp/samd51":true,
            "hw/bsp/same54xplainedpro":true,
            "hw/bsp/same70_qmtech":true,
            "hw/bsp/same70_xplained":true,
            "hw/bsp/samg55xplained":true,
            "hw/bsp/saml2x":true,
            "hw/bsp/sltb009a":true,
            "hw/bsp/spresense":true,
            "hw/bsp/stm32f0":true,
            "hw/bsp/stm32f1":true,
            "hw/bsp/stm32f207nucleo":true,
            "hw/bsp/stm32f303disco":true,
            "hw/bsp/stm32f4":true,
            "hw/bsp/stm32f7":true,
            "hw/bsp/stm32g4":true,
            "hw/bsp/stm32h7":true,
            "hw/bsp/stm32l0538disco":true,
            "hw/bsp/stm32l4":true,
            "hw/bsp/tm4c123":true,
            "hw/bsp/xmc4000":true,
        }
    }
}

the files under these sub-directory will not show in vscode explore, and "go to definition" will navigate to files under swm341 as expected. all these work well.

But it's very troublesome to write out all sub-directory of hw/bsp. So I wrote it a different way.

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "files.exclude": {
            "hw/bsp/{[^s]*,?[^w]*}": true
        }
    }
}

This time, vscode explore works well like above setting. But "go to definition" will list all funtions, not only functions under sub-directory swm341.

@sean-mcmanus sean-mcmanus added bug Language Service Feature: Configuration An issue related to configuring the extension or IntelliSense labels Mar 2, 2022
@sean-mcmanus
Copy link
Collaborator

Yeah, the [] and ^ syntax isn't currently handled by our exclusion parser.

A related VS Code issue is microsoft/vscode#869.

@Colengms Colengms added this to the Backlog milestone Mar 22, 2022
@sullivanmj
Copy link

I'd also like to see full support for glob syntax, particularly [] syntax. This is a problem when trying to exclude files from locations that are updated from a third party, where we know we will only care to see files with one particular pattern, but other files might be added as part of an update.

@sean-mcmanus sean-mcmanus added the enhancement Improvement to an existing feature label Sep 23, 2022
@icegood
Copy link

icegood commented Sep 26, 2022

Yeah, the [] and ^ syntax isn't currently handled by our exclusion parser.

A related VS Code issue is microsoft/vscode#869.

didn't get why link is related? files.exclude has already supported [^..] as a group of symbols. While related issue connects to 'sequence' of symbols (and noone knows when it became supported). And what exclude syntax cpp parser supports for now at least for group? Why #9908 doesn't work?

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Sep 26, 2022

@icegood That link might not be related, but our exclusion implementation in cpptools doesn't parse the [] and ^ symbols like the implementation does in VS Code for files.exclude. The current implementation handles, *, ?, {}, , special characters. #9908 is a duplicate of this issue.

@sean-mcmanus sean-mcmanus modified the milestones: Backlog, 1.16.0 May 2, 2023
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label May 2, 2023
@michelleangela
Copy link
Contributor

@michelleangela
Copy link
Contributor

Fix is now available in release version 1.16.2.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug enhancement Improvement to an existing feature Feature: Configuration An issue related to configuring the extension or IntelliSense fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

6 participants