Hello,

The refactoring context menu item and the find identifier references context
menu are broken.

Type
  TSourceParser = Class(TObject)
   function ParseSource: TPasModule;
  end;

With the cursor on "ParseSource", the 'Find identifier references' and 'Rename
identifier' menu items in the context menu are grayed out. (plus some
others)

The same problem exists if the cursor is on "ParseSource" in the
implementation:

function TSourceParser.ParseSource: TPasModule;

I did some digging, and it seems to me that the error is in the
TCustomSynEdit.CaretAtIdentOrString routine, which does not detect an
identifier correctly.

It seems a bit strange to me that the syntax highlighter is used to
determine whether the cursor is on a identifier or something else.

I saw a remark in main.pp that this is supposed to be faster than using the
codetools:

    CurWordAtCursor := ASrcEdit.GetWordAtCurrentCaret;
    //it is faster to get information from SynEdit than from CodeTools
    
ASrcEdit.EditorComponent.CaretAtIdentOrString(ASrcEdit.EditorComponent.CaretXY, 
IdentFound, StringFound);

Faster? Probably. Correct? clearly not (yet).

Any solutions ?

Michael.
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to