Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

For unsupported languages, is there a way to use this implementation by feeding it the AST instead of the files? #295

Unanswered
mahtab-nejati asked this question in Q&A
Discussion options

I am working on a project on CMake and would like to export the edit script of the .cmake files in my codebase. Is there a way I could use this package by feeding it the two ASTs of the code?

You must be logged in to vote

Replies: 3 comments · 5 replies

Comment options

Hi!

I am not sure to understand what you want?

Cheers.

You must be logged in to vote
1 reply
@mahtab-nejati
Comment options

Specifically, my question is how can I extend this tool to support diffing of other programming languages, such as CMake?

Comment options

Specifically, my question is how can I extend this tool to support diffing of other programming languages, such as CMake?

You must be logged in to vote
3 replies
@jrfaller
Comment options

Ok that's much clearer thanks! Do you know a CMake parser?

@mahtab-nejati
Comment options

The CMake parser I am using is in python (PyPi page and GitHub repo. I was wondering if I could use the output AST and somehow plug it into the GumTree tool for diffing.

@jrfaller
Comment options

Hi!

In this case this might be fairly easy. You only need to build a xml convertor to gumtree external format. There is some explanation on how to do this here : #164

Cheers!

PS: see also this : https://github.com/uyha/tree-sitter-cmake it could be easier since we have a built-in support for tree-sitter parsers.

Comment options

Hi,

I did manage to make the tree-sitter-cmake work. I also went through issue #164 which you referred me to.

From what I understand, I need to:

  1. Provide support for CMake by adding the file CMakeTreeSitterTreeGenerator.java to this directory
  2. Use this repository and integrate tree-sitter-cmake into this.

Is that all?

You must be logged in to vote
1 reply
@jrfaller
Comment options

Hi!

Yes it's all. Normally it's better to perform 2. before 1. this way I can refresh the docker image so that the right version of tree-sitter-parser is available for GumTree.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.