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

Consider adding cscope output append feature #175

Open
zhaozhongn opened this issue Apr 8, 2019 · 4 comments
Open

Consider adding cscope output append feature #175

zhaozhongn opened this issue Apr 8, 2019 · 4 comments

Comments

@zhaozhongn
Copy link

zhaozhongn commented Apr 8, 2019

Starscope is great in handling the languages it supports. When working with large mixed-language repository, however, it is desirable to generate a single cscope.out file that cscope -d mode can navigate among source files of all languages (e.g., C and Go). Other tools expecting a single cscope.out file would also be able to work on the entire code base.

Although cscope and starscope can separately index C and Go files, there currently lacks a way to merge their indexing result into a single cscope.out files. While this can be done in a new tool specifically created for this, it would be great if starscope can optionally read in a cscope.out file and simply append its indexing result to it, making starscope a perfect companion to cscope.

@eapache
Copy link
Owner

eapache commented Apr 8, 2019

That's a great idea. Unfortunately, the cscope file format is not really "appendable", it has a header at the top which becomes invalid if you add more data, and is difficult to just recalculate.

@zhaozhongn
Copy link
Author

By "append" I meant semantically, i.e., starscope, upon exporting to cscope, will optionally read in an existing cscope.out file, append its own indexing data to the existing data in memory, and write out a new cscope.out file containing the entire indexing data.

I assume it should be straight-forward for starscope to read in existing cscope.out files as it already knows how to write out to one.

@eapache
Copy link
Owner

eapache commented Apr 8, 2019

Unfortunately not a true assumption, the support for writing a cscope file is pretty hacky and doesn't naturally invert to support reading. The first step would probably be extracting support for the file format into a proper library that did support reading and writing.

@zhaozhongn
Copy link
Author

I see. Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants