View Issue Details

IDProjectCategoryView StatusLast Update
0038892LazarusIDEpublic2021-05-16 15:49
ReporterPea Zomboss Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
PlatformPCOSWindows 10 
Product Version2.0.12 
Summary0038892: Code completion box pop up when type in float number
DescriptionWhen type in a float number, I type a dot and the completion box pop up with the error message "Error: illegal qualifier . found"
I tried 2.1.0, the situation is the same
Steps To ReproduceJust like the picture, it's very common
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

duplicate of 0034448 assignedMattias Gaertner Erroneous CodeTools error when typing a floating point value 

Activities

Pea Zomboss

2021-05-15 04:01

reporter  

completionerror.png (24,422 bytes)   
completionerror.png (24,422 bytes)   

Mattias Gaertner

2021-05-15 08:33

manager   ~0130888

Note that due to TIntegerHelper you can write:

d:=1.toDouble;

Pea Zomboss

2021-05-15 08:42

reporter   ~0130889

Yes, but sometimes we want to write like:
glVertex3f(-1.0, 1.0, 1.0);
glVertex3f(-1.0, 1.0,-1.0);
glVertex3f(-1.0,-1.0,-1.0);
glVertex3f(-1.0,-1.0, 1.0);

Mattias Gaertner

2021-05-15 08:53

manager   ~0130890

Did I understand this correct: It should not complete (invoke the selected item) when pressing a comma. It should simply close.

Pea Zomboss

2021-05-15 09:17

reporter   ~0130891

A little different, but maybe it's OK, so that I will not press 'esc' all the time.

And I think when press the "backspace" key it should be closed too.

Mattias Gaertner

2021-05-15 09:34

manager   ~0130892

The backspace is needed to edit a mistake in the selection.

Btw, I personally have disabled the automatic completion box after '.', so I didn't notice this bug yet.

Pea Zomboss

2021-05-15 10:05

reporter   ~0130893

Last edited: 2021-05-15 10:14

View 2 revisions

"The backspace is needed to edit a mistake in the selection."
I mean in this case: after the '.' there is no characters.

And for the issue I tried to add some code at CheckStartIdentCompletion function and there may be many problems because I'm not familiar with Lazarus source code.
    for p:=LogCaret.X-2 downto 1 do
      if Line[p] in ['0'..'9'] then
        if Line[p-1] in ['a'..'z','A'..'Z','_'] then
          break
        else if (Line[p-1] in [' ','=','(','[','+','-','*','/']) or (p=1) then
          exit;
Do not laugh my code. hahaha­čśä

Maybe this problem is more complicated

CudaText man

2021-05-15 10:24

reporter   ~0130894

IDE should show autocompletion after '.' only if it's not in float-number context.

Martin Friebe

2021-05-15 12:34

manager   ~0130896

Until a final solution is found...

You should be able to avert the problem to 99% if you go to Tools > Options > Codetools > identifier completion

Disable "include identifiers containing the prefix". Then only idents starting with the text you typed will be found.
The completion box will still show, but after the dot you will type at least one digit. And then no identifier starts with a digit. So no completion is possible as soon as you type the first digit after the dot.


You can also look for the drop down called "include words" and set it to "dont include". But that still leaves a very few completion for some digits....

Pea Zomboss

2021-05-15 13:08

reporter   ~0130898

Thanks, I set "include words" drop down to "don't include" and the completion box does not show.

Sven Barth

2021-05-16 15:49

manager   ~0130919

@CudaText man: There is no concept of "float-number context". Due to type helpers "2.Identifier" can be valid as well.

Issue History

Date Modified Username Field Change
2021-05-15 04:01 Pea Zomboss New Issue
2021-05-15 04:01 Pea Zomboss File Added: completionerror.png
2021-05-15 08:33 Mattias Gaertner Note Added: 0130888
2021-05-15 08:42 Pea Zomboss Note Added: 0130889
2021-05-15 08:53 Mattias Gaertner Note Added: 0130890
2021-05-15 09:17 Pea Zomboss Note Added: 0130891
2021-05-15 09:34 Mattias Gaertner Note Added: 0130892
2021-05-15 10:05 Pea Zomboss Note Added: 0130893
2021-05-15 10:14 Pea Zomboss Note Edited: 0130893 View Revisions
2021-05-15 10:24 CudaText man Note Added: 0130894
2021-05-15 12:34 Martin Friebe Note Added: 0130896
2021-05-15 13:08 Pea Zomboss Note Added: 0130898
2021-05-15 20:29 Bart Broersma Assigned To => Bart Broersma
2021-05-15 20:29 Bart Broersma Status new => resolved
2021-05-15 20:29 Bart Broersma Resolution open => duplicate
2021-05-15 20:29 Bart Broersma LazTarget => -
2021-05-15 20:29 Bart Broersma Relationship added duplicate of 0034448
2021-05-16 15:49 Sven Barth Note Added: 0130919