Wrong line number on error messages when auto-imports are used #335
Replies: 2 comments
-
|
What if we use some kind of line seperator to denote the end of the auto-imports in the prefixed document like this [AUTO-IMPORTS]
;; <EO-AI>
[ORIGINAL-DOCUMENT]And start computing the line numbers after this |
Beta Was this translation helpful? Give feedback.
-
|
@Heulitig this is not a discussion material. What you are describing is a bug. Bugs should be filed as issues. Discussion is purely for discussion of future developments, new features etc. I have written about this in Issues vs Discussions thread. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Created
#230
Currently, when we use
auto-imports, aprefixed documentis generated before passing it to ftd.Ftdreceives this prefixed document instead of the actual document and since the actual document contents are shifted down that's why we are getting wrong line number on the error messages.Prefixed Body: {Auto-imports}\n\n{Actual document} Shift in line number = (no of auto-imports used + 2)Need some way to fix this line number issue by sending this data regarding auto-imports separately and avoid altering the original line numbers of the document.
How To Solve This?
Simplest solution would be to pass both document source and
offsetwhen we are continuing after continue_after_import .Then whenever ftd is printing, it will print
line-number - offsetas line number.Problem with this approach: What if file corresponding to auto import does not exist or has an issue during import?
Beta Was this translation helpful? Give feedback.
All reactions