Skip to content

Handling ambiguity of behavior on .h extension #81

@malkoG

Description

@malkoG
  • Language: Swift, Objective-C

🐛 Describe the bug

Now that Balpan v0.3 will support C/C++, So, reading .h supposes that it is written in C/C++ syntax.

But, many of iOS/macOS native apps are written in Objective-C/Swift. AND IT ALSO USES .h file within its repository.

In this context, we should not suppose that parsing .h file always requires treesitter-cpp.

How do we approach this problem?

To handle this problem, We have to choose which parser is appropriate for each runtime.

One of possible approach is statistics. Counting all of files that are written by language balpan support, and the behaviour on .h file could be decided by majority.

For example, most of files are written in C/C++ syntax, we can assume that .h file have to be parsed using treesitter-cpp.

If most of files are written in Swift syntax, we can also assume that .h file have to be parsed using treesitter-swift.

Also, we need to investigate which programming language uses .h extension

Other details or context

See https://github.com/ReactiveX/RxSwift/blob/main/RxCocoa/Runtime/include/_RXDelegateProxy.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions