Open diablodale opened 10 months ago
Getting the LLM to understand line numbers is hard
Got it. 🤔Hmmm, my ~sandwich engineering~ input tends to be very commanding, specific, no articles, etc. -- a habit I developed from search engines and other tools that prefer specifics/params and toss noise terms.
More intention detail: I wanted to direct copilot to this specific issue at this specific code location while at the same time copilot to consider the broader code block. Like giving a visual centerpoint within a region that would indicate the most important thing to "work on". Not unlike visual tools which delete clicked objects in images and blur into surrounding areas. Using a line number was my instinct/habit as that line number appeared in the compiler errors in the cmake build output window.
This line 831 code was from a 3rd party library, who forked from Microsoft. It is using reinterpret_cast
to switch a pointer type...which I'm 99% sure it or a c-cast is needed. Wanted to see if copilot might surprise me and suggest an innovative/broader rework of the code block, intead of a pragma suppress
one line above.
I don't disagree, you should be able to say something like that, but for now you may have better luck if you just say "this code" or something like that.
copilot self-conflicting error that it can't provide a fix because it doesn't have the line...yet it gathered that exact same reference
Setup
Version: 1.85.1 (system setup) Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 Date: 2023-12-13T09:49:37.021Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22631
Github Copilot: v1.143.601 Github Copilot chat: v0.11.1
Repro
@workspace how fix line 831
I was asking less to get help... ...and more to be inquisitive on how copilot might suggest a change.
Result
Copilot failed to provide any useful answer. And copilot was self-conflicting by complaining it doesn't have needed context yet wrote specifically it gathered that context.
It complains it doesn't have...the thing it gathered as a reference.
Expected
No complains. And some dialog about the pro/cons of reinterpret_cast
Logs