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

[SR-13953] Give Identifier a hasUnderscoredNaming() helper #56350

Open
beccadax opened this issue Dec 10, 2020 · 1 comment
Open

[SR-13953] Give Identifier a hasUnderscoredNaming() helper #56350

beccadax opened this issue Dec 10, 2020 · 1 comment
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement refactoring Area → source tooling: refactoring

Comments

@beccadax
Copy link
Contributor

Previous ID SR-13953
Radar None
Original Reporter @beccadax
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler, Source Tooling
Labels Improvement, Refactoring, StarterBug
Assignee mohit.athwani (JIRA)
Priority Medium

md5: 2f01bbed82012d22d725137279f99626

Issue Description:

Various parts of the compiler and SourceKit treat names with leading underscores a little bit specially. For example, SourceKit keeps these names out of code completion results.

To help with this, Decl has a hasUnderscoredNaming() method which checks if the method's name starts with an underscore. However, there are half a dozen places in the compiler where we need to check if plain old identifiers are underscored, and in those places, we usually write something like:

  if (ModuleName.str().startswith("_") ||

It would be better if Identifier, and possibly some other name-related types like DeclName, had a helper like Decl's to standardize this check.

@typesanitizer
Copy link

@beccadax should this be closed? I don't see any such uses, but maybe I'm not looking carefully enough.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
ahoppen added a commit that referenced this issue Mar 5, 2024
#56350 - Give Identifier a hasUnderscoredNaming() helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement refactoring Area → source tooling: refactoring
Projects
None yet
Development

No branches or pull requests

2 participants