-
Notifications
You must be signed in to change notification settings - Fork 758
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
Support retrieving function definitions for a project path #4508
Comments
The definitions for given file are stored in the index document and can be retrieved via The API calls would obviously need to go through authorization checks. |
Also, the above suggests the API endpoint would be limited to single file, i.e.be similar to the pre-existing genre API, i.e. |
Also, pagination should be considered as the "tags" data for some files can be significant. On the other hand, I don't want to complicate this API endpoint too much. |
Speaking of simplicity, it would seem to me that the API should merely present the list of tags, i.e. the contents of opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Definitions.java Lines 209 to 242 in 6fb5eee
If one needs the line to tag mapping, that could be reconstructed from the list. Would that match your use case @ronvgs ? |
Here's a sample output for https://github.com/openssl/openssl/blob/master/crypto/aes/aes_cbc.c (the query URL would end with [
{
"type": "function",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,",
"symbol": "AES_cbc_encrypt",
"lineStart": 5,
"lineEnd": 20,
"line": 20,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "in",
"lineStart": 21,
"lineEnd": 44,
"line": 20,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "out",
"lineStart": 46,
"lineEnd": 64,
"line": 20,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "len",
"lineStart": 21,
"lineEnd": 31,
"line": 21,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "key",
"lineStart": 33,
"lineEnd": 51,
"line": 21,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "ivec",
"lineStart": 21,
"lineEnd": 40,
"line": 22,
"namespace": null
},
{
"type": "argument",
"signature": "(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"text": "AES_cbc_encrypt(const unsigned char * in,unsigned char * out,size_t len,const AES_KEY * key,unsigned char * ivec,const int enc)",
"symbol": "enc",
"lineStart": 42,
"lineEnd": 55,
"line": 22,
"namespace": null
}
] |
Im working on a project and one of the tasks requires getting all function definitions from all code(cpp) files in a project path.
Describe the solution you'd like
I would like opengrok api to take the project path as input and return the info(return type, name, params list, enclosing type name, namespace, etc) related to each function definition found in each source file in that path.
Describe alternatives you've considered
None.
Additional context
NA
The text was updated successfully, but these errors were encountered: