mirror of
https://github.com/github/codeql.git
synced 2026-05-22 15:17:09 +02:00
Remove tokens from the prompt that the Java side can't handle
This commit is contained in:
@@ -35,11 +35,18 @@ module ModelPrompt {
|
||||
strictconcat(Token token |
|
||||
location.containsLoosely(token.getLocation())
|
||||
|
|
||||
token.getValue(),
|
||||
// Use space as the separator, since that is most likely.
|
||||
// May not be an exact reconstruction, e.g. if the code
|
||||
// had newlines between successive tokens.
|
||||
" "
|
||||
token
|
||||
.getValue()
|
||||
.replaceAll("\"", " ")
|
||||
.replaceAll("\\", " ")
|
||||
.replaceAll("\n", " ")
|
||||
.replaceAll("\r", " ")
|
||||
.replaceAll("|", " ")
|
||||
.replaceAll("`", " ") +
|
||||
// Use space as the separator, since that is most likely.
|
||||
// May not be an exact reconstruction, e.g. if the code
|
||||
// had newlines between successive tokens.
|
||||
" "
|
||||
order by
|
||||
token.getLocation().getStartLine(), token.getLocation().getStartColumn()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user