Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

Code-completion on erroneous code [0008663: codetools behaviour / attn: Benito]

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

This is a follow up to http://bugs.freepascal.org/view.php?id=8663

1) When the code contains a critical error, pressing Ctrl+Space the cursor moves to this point. I think it would be better just to mark the error (e.g line highlighting), because the error is due to the incompleteness of the code.

So what should happen?

If the code indeed has an error, then it must be fixed. And code-completion will not work until it has been fixed.

- If it was simply highlighted, then the user will (at some time) have to go there by hand. So that (imho) is less convenient. And the position may not be in the visible area, so the user would not notice.
Or the user may have continues to type, that usually makes line highlight disappear.
- On the other hand, the current behaviour triggers an unexpected jump, and (for me) it always takes a second or two, to figure out what just happened.

So what other options are there? Ideas:
- code tools display a drop-down, but it simply has an entry, pointing to the error. The entry can be selected (cursor-down-key; then enter) and you jump to the error location. Continue typing, or pressing escape would keep you at your current location.
- instead of a drop-down a hint could be shown
- we could keep jumping to the error immediately (as current); but make some extra visible hint, what and why happened (display a hint / highlight the word in red / if still within the visible area, highlight the original position too)

Best Regards
Martin

Reply by email

Mattias Gaertner
to Martin
Show quoted text 25 lines
This is a follow up to http://bugs.freepascal.org/view.php?id=8663 > 1) When the code contains a critical error, pressing Ctrl+Space the > cursor moves to this point. I think it would be better just to mark > the error (e.g line highlighting), because the error is due to the > incompleteness of the code. So what should happen? If the code indeed has an error, then it must be fixed. And code-completion will not work until it has been fixed. - If it was simply highlighted, then the user will (at some time) have to go there by hand. So that (imho) is less convenient. And the position may not be in the visible area, so the user would not notice. Or the user may have continues to type, that usually makes line highlight disappear. - On the other hand, the current behaviour triggers an unexpected jump, and (for me) it always takes a second or two, to figure out what just happened. So what other options are there? Ideas: - code tools display a drop-down, but it simply has an entry, pointing to the error. The entry can be selected (cursor-down-key; then enter) and you jump to the error location. Continue typing, or pressing escape would keep you at your current location.

Sounds reasonable. We should test how it works.

Show quoted text 5 lines
- instead of a drop-down a hint could be shown - we could keep jumping to the error immediately (as current); but make some extra visible hint, what and why happened (display a hint / highlight the word in red / if still within the visible area, highlight the original position too)

And maybe give a hint that you can jump back with Ctrl-h.

Mattias

Reply by email