Linux support
What would it take to make this library work on Linux? Unfortunately I'm not very familiar with C or C++ development so I can't really tell how much work needs to be done.
Is the project alive? Linux/MacOS support is still extremely awaited.
I have just ported the csharp binding to linux, and it works well in my project. However, I don’t have working Windows or macOS environments, so I haven't been able to test if anything has broken on those platforms.
Here’s an example of the output when running the code on Linux:
$ dotnet run -files tree-sitter/tree-sitter-cpp/test/highlight/names.cpp
The node type is primitive_type, symbol is int
The node type is identifier, symbol is main
The node type is (, symbol is (
The node type is ), symbol is )
The node type is parameter_list, symbol is ()
done!
Please let me know if it works well on other platforms, and I’ll be happy to submit a pull request.
is:open is:issue linked:pr updated:<2024-11-20
I have just ported the csharp binding to linux, and it works well in my project. However, I don’t have working Windows or macOS environments, so I haven't been able to test if anything has broken on those platforms.
Here’s an example of the output when running the code on Linux:
$ dotnet run -files tree-sitter/tree-sitter-cpp/test/highlight/names.cpp The node type is primitive_type, symbol is int The node type is identifier, symbol is main The node type is (, symbol is ( The node type is ), symbol is ) The node type is parameter_list, symbol is () done!Please let me know if it works well on other platforms, and I’ll be happy to submit a pull request.
Hi, I compiled your pull on MacOS, it works. But testing on my project, code failed.(The parent of TSNode is_null() always return true). I suspect there maybe some compile pack-size issue or data structure mismatch. Still looking into it.
It turns out -O3 have bugs, -O0 works. Maybe some bug deep in tree-sitter not the binding.
$ dotnet run -files tree-sitter/tree-sitter-cpp/test/highlight/names.cpp The node type is primitive_type, symbol is int The node type is identifier, symbol is main The node type is (, symbol is ( The node type is ), symbol is ) The node type is parameter_list, symbol is () done!
$ dotnet run -files tree-sitter/tree-sitter-cpp/test/highlight/names.cpp The node type is primitive_type, symbol is int The node type is identifier, symbol is main The node type is (, symbol is ( The node type is ), symbol is ) The node type is parameter_list, symbol is () done!
I have just ported the csharp binding to linux, and it works well in my project. However, I don’t have working Windows or macOS environments, so I haven't been able to test if anything has broken on those platforms.
@Undefined01 , rregarding the tests of your fork on Windows, it won’t work because the original Makefile was written for nmake, which uses a different syntax.
The first line of the Makefile you created generates a syntax error in nmake.
I also tried installing GnuWin32.Make using Winget, but it doesn't work either because Makefile.Windows, which was simply renamed, still contains nmake syntax.
In my opinion, the best approach at this point would be to maintain separate Makefiles and use the -f option to specify which one to run. Perhaps someone can propose a more elegant solution later.