tree-sitter-xml icon indicating copy to clipboard operation
tree-sitter-xml copied to clipboard

fix public headers in Package.swift

Open charles-zablit opened this issue 10 months ago • 3 comments

This fixes an issue in Package.swift which causes the Swift compiler to complain about an umbrella already defined.

charles-zablit avatar Apr 16 '24 00:04 charles-zablit

I assume that would strip the TreeSitter* directory (which may or may not be needed).

Can you post the command you ran and the warning/error you're getting?

ObserverOfTime avatar Apr 16 '24 07:04 ObserverOfTime

I ran the command through Xcode by running a build.

The error looks like this:

/Users/charleszablit/Library/Developer/Xcode/DerivedData/xml-linter-bhaqsafzznnnhofiuszenyvekpfi/Build/Intermediates.noindex/InstallIntermediates/macosx/Intermediates.noindex/GeneratedModuleMaps/TreeSitterXML.modulemap:2:1: error: umbrella for module 'TreeSitterDTD' already covers this directory
umbrella "/Users/charleszablit/Developer/tree-sitter-xml/bindings/swift"
^
/Users/charleszablit/Library/Developer/Xcode/DerivedData/xml-linter-bhaqsafzznnnhofiuszenyvekpfi/Build/Intermediates.noindex/InstallIntermediates/macosx/Intermediates.noindex/GeneratedModuleMaps/TreeSitterXML.modulemap:2:1: error: umbrella for module 'TreeSitterDTD' already covers this directory
umbrella "/Users/charleszablit/Developer/tree-sitter-xml/bindings/swift"
^
<unknown>:0: error: could not build Objective-C module 'SwiftShims'

The changes in this PR fix the issue and builds and runs correctly 👍

charles-zablit avatar Apr 16 '24 17:04 charles-zablit

The changes in this PR fix the issue and builds and runs correctly

But now you will have xml.h instead of TreeSitterXML/xml.h if it gets installed anywhere.

That change needs to be submitted upstream first and reviewed by other Swift users. https://github.com/tree-sitter/tree-sitter/blob/master/cli/src/generate/grammar_files.rs#L441

ObserverOfTime avatar Apr 16 '24 18:04 ObserverOfTime