Forum > Editor

Why keywords are on top of list for identifier completion in (Scoped) options?

(1/2) > >>

WooBean:
When sorting option for identifier completion is set to "Alphabetic (Scoped)" or "Definition (Scoped)" a list of keywords is shown on top, even before recently used identifiers while "Show recently used identifiers at top" option is marked (checked).

Observation is valid for Lazarus 3.0  and trunk (3.99).

Is it intentionally?

BTW, why recently used items are not configurably limited and marked by coloring in Lazarus 3.0?

Added a picture for 3.99 behaviour, 3.0 looks similar except lack of coloring recent items.

 

paweld:
The sorting order and last identifier list count can be set in the options

WooBean:

--- Quote from: paweld on January 03, 2024, 12:24:26 pm ---The sorting order and last identifier list count can be set in the options

--- End quote ---

I was aware of that before asking forum members. 
Your picture refers to trunk (3.99).

I think that keywords  should be presented as a group at the end of the list (before templates).
The only exception can be when a keyword greatly "fits" in a code context.

Pozdrawiam  :)

Martin_fr:

--- Quote from: WooBean on January 03, 2024, 11:21:28 am ---BTW, why recently used items are not configurably limited and marked by coloring in Lazarus 3.0?

--- End quote ---

Probably that was only added after the 3.0 branch had been created (check in git when that was).

The new settings for "recent" are a new features. And usually only bug-fixes are merged (exception for something like gtk3 which is still something like alpha).



--- Quote from: WooBean on January 03, 2024, 01:02:43 pm ---I think that keywords  should be presented as a group at the end of the list (before templates).
The only exception can be when a keyword greatly "fits" in a code context.

--- End quote ---

Afaik that sort of "context detection" simply doesn't exist yet.
Besides, what does "greatly" mean?

A keyword either can appear or not. There either is a way to write compile-able code with that keyword as next token, or there is not.

The problem is rather that often too many keywords are offered. E.g. if you have "if (i > 1) " then "not" is offered => but it can not possible be there.

WooBean:

--- Quote from: Martin_fr on January 03, 2024, 05:15:50 pm ---
...

Afaik that sort of "context detection" simply doesn't exist yet.
Besides, what does "greatly" mean?

A keyword either can appear or not. There either is a way to write compile-able code with that keyword as next token, or there is not.

The problem is rather that often too many keywords are offered. E.g. if you have "if (i > 1) " then "not" is offered => but it can not possible be there.

--- End quote ---


Let me present an example how context detection works now:

If we code  "if 2>1 |" then keyword list does not include "then" but when we code
"if (2>1) |" then "then" is present in the list (+ many unwanted).


 



Navigation

[0] Message Index

[#] Next page

Go to full version