Get Function Body when in output of select #858
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If I understand correctly, you need the source code text to pass it to a LLM. CodeQL normally returns the location (file path + start position + end position) and not the actual text of the source code. While it is possible to write a predicate Would the following option (for SARIF output only) be helpful in your case ?
Alternatively you can write a script that copies the relevant lines of code from the source files based on the location information returned by CodeQL. Note, that a CodeQL database contains a zip archive |
Beta Was this translation helpful? Give feedback.
If I understand correctly, you need the source code text to pass it to a LLM. CodeQL normally returns the location (file path + start position + end position) and not the actual text of the source code. While it is possible to write a predicate
string toText(AstNode n)
, this is quite a bit of work.Would the following option (for SARIF output only) be helpful in your case ?
Alternatively you…