View Issue Details

IDProjectCategoryView StatusLast Update
0026964LazarusIDEpublic2020-07-30 10:09
ReporterNever Assigned ToPascal Riekenberg  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionreopened 
OSwin7 64 bit 
Summary0026964: writeln ('ALFA BITA GAMA >[Cursor Pos Here] ') + Ctrl+Space
DescriptionError: identifier expected, but 'ALFA BITA GAMA >' found

or writeln('>[Cursor Pos Here] + Ctrl+Space')

Error: identifier expected, but '>' found

or writeln('![Cursor Pos Here] + Ctrl+Space')

Error: identifier expected, but '!' found

or writeln('α[Cursor Pos Here] + Ctrl+Space')

Error: identifier expected, but 'α' found

or writeln('[Cursor Pos Here] + Ctrl+Space') [this is empty string]

Error: identifier expected, but '' found


Steps To Reproducepress enter for new line
type write press ctrl+space
choose writeln
type ''
press left arrow once
type >
press ctrl+space
to see the effect
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Bart Broersma

2014-11-04 18:20

developer   ~0078898

What Lazarus version?
Cannot reproduce in trunk (Lazarus 1.3 r46593 FPC 2.6.4 i386-win32-win32/win64).

Vojtech Cihak

2014-11-04 19:00

reporter   ~0078900

I can reproduce. IMO Lazarus should allow to write any identifier from Ctrl+Space list inside apostrophes, there's no reason to not allow it.

Bart Broersma

2016-01-27 14:28

developer   ~0089432

Still present.

Ondrej Pokorny

2016-01-27 14:42

developer   ~0089436

Why should it be allowed? What does "any identifier" mean? What about identifiers from different context (like TObject.xyz)?

IMO it is correct that CodeTools fail when executing in a string constant. There could be a better error message, though.

Ondrej Pokorny

2016-01-28 01:13

developer   ~0089447

@Bart > Still present.

Are you sure? I checked it now just out of curiosity and codetools show the identifier completion. I expected they would throw an error.

See the attached image.

Ondrej Pokorny

2016-01-28 01:13

developer  

codetools-string.png (5,178 bytes)   
codetools-string.png (5,178 bytes)   

Ondrej Pokorny

2016-01-31 14:34

developer   ~0089589

No feedback. Anybody feel free to reopen with a sample project to reproduce the issue.

Bart Broersma

2016-01-31 16:13

developer   ~0089612

Lazarus 1.7 r51439 FPC 3.0.0 i386-win32-win32/win64

writeln('');

Place cursor before the quotes, press Ctrl+Space: OK
Place cursor inside the string, press Ctrl+Space: main.pp(34,11) Error: identifier expected, but 'foobar ' found
Place cursor behind string, press Ctrl+Space: main.pp(34,11) Error: identifier expected, but 'foobar ' found.

> IMO Lazarus should allow to write any identifier from Ctrl+Space list inside apostrophes, there's no reason to not allow it.

If you agree, then it is not fixed.
If you think this is by design and should not be altered then by all means resolve as "no change required".

Ondrej Pokorny

2016-01-31 16:25

developer   ~0089614

Thanks, I missed the empty-string variant. Yes, confirmed.

CodeTools should either don't show code completion at all in a string or support it fully. Now it sometimes works and sometimes doesn't, that's not good.

Issue History

Date Modified Username Field Change
2014-10-29 19:22 Never New Issue
2014-11-04 18:20 Bart Broersma LazTarget => -
2014-11-04 18:20 Bart Broersma Note Added: 0078898
2014-11-04 18:20 Bart Broersma Status new => feedback
2014-11-04 19:00 Vojtech Cihak Note Added: 0078900
2016-01-27 14:28 Bart Broersma Note Added: 0089432
2016-01-27 14:28 Bart Broersma Status feedback => acknowledged
2016-01-27 14:42 Ondrej Pokorny Note Added: 0089436
2016-01-28 01:13 Ondrej Pokorny Note Added: 0089447
2016-01-28 01:13 Ondrej Pokorny File Added: codetools-string.png
2016-01-31 14:34 Ondrej Pokorny Note Added: 0089589
2016-01-31 14:34 Ondrej Pokorny Status acknowledged => resolved
2016-01-31 14:34 Ondrej Pokorny Resolution open => fixed
2016-01-31 14:34 Ondrej Pokorny Assigned To => Ondrej Pokorny
2016-01-31 16:13 Bart Broersma Note Added: 0089612
2016-01-31 16:13 Bart Broersma Status resolved => assigned
2016-01-31 16:13 Bart Broersma Resolution fixed => reopened
2016-01-31 16:25 Ondrej Pokorny Note Added: 0089614
2016-01-31 16:44 Ondrej Pokorny Assigned To Ondrej Pokorny =>
2016-01-31 16:46 Ondrej Pokorny Status assigned => acknowledged
2020-07-30 10:09 Pascal Riekenberg Assigned To => Pascal Riekenberg
2020-07-30 10:09 Pascal Riekenberg Status acknowledged => assigned