The chat window cannot correctly know the line number position, so an incorrect response is given.
Sometimes, we need to edit code in the specified location or explain the code at the specified location. If line numbers are used to represent the location, the chat window cannot correctly identify it.
so can you fix this bug?
or add a new feature like:
@line
the usage case like:
can you explain this code at @line 25-30
add a div tag at @line 15
2 Likes
Or, is there any alternative way to point out âspecify a certain locationâ?
Highlight the section you want, click on âadd to chatâ, then ask your question. The full file will be sent as context, and it will know which part you are referring to.
1 Like
ok, thatâs right, but it is still a bug.
1 Like
Yeah this is very annoying. @debian3âs workaround works as a band-aid fix, but this is a pretty basic functionality that needs to be rectified. The whole point of an AI assistant is to act like a human assistant and use natural language. Itâs natural to ask âCan you explain line 35?â, so Cursor needs to be able to handle this common scenario
Even if we were to add the ability for the AI to see the line numbers, I donât believe it would work correctly as LLMs have a hard time dealing with numbers and occurrences like this!
Thereâs a cool article here that discusses this issue, as best highlighted when you ask an LLM how many ârâ characters there are in the word strawberry (and the AI doesnât cheat and write code to do it, like ChatGPT does now):
https://www.inc.com/kit-eaton/how-many-rs-in-strawberry-this-ai-cant-tell-you.html
âAll right. I donât necessarily have to use the method of specifying line numbers. If there are other ways to specify the position, you can also give me some suggestions.â