How to deal with line numbers #1008
Replies: 2 comments
-
|
I've encountered the same line numbering issue. Does this mean that any LLM integration with Serena tools will require us to decrement line numbers by 1 whenever we're working with lines of code? |
Beta Was this translation helpful? Give feedback.
-
|
The important thing is that the line numbering scheme to be used throughout Serena is consisntent, i.e. if one tool returns a line number to the LLM, that line number being passed to any other tool that uses line numbers should have the correct effect. For any other tools, it should also be clear whether they use 1-based or 0-based line numbers. As a human, I find that there is rarely a need to communicate line numbers, but if you use line numbers, then yes, apply the conversion if necessary. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I understand this is a problem many people have faced before, but I did not find a discussion about it.
As stated in the Serena documentation, line numbers start at 0. Nevertheless, other tools, like compilers, return line numbers starting at 1. In the same sense, humans reading an answer from an LLM will be expecting one-based line numbers.
Thus, my main question is how people are managing this issue. How can we guarantee that other tools can talk seamlessly with Serena?
Sorry if I am missing something.
Thanks for the help,
Beta Was this translation helpful? Give feedback.
All reactions