Recent

Author Topic: How to show the parameters of a function  (Read 6581 times)

llutti

  • New Member
  • *
  • Posts: 23
How to show the parameters of a function
« on: May 11, 2016, 01:16:03 pm »
Hi,

  When I used the SynEdit by Delphi I show the parameters using the SynCompletionPropososal.

  My question is how can I show the parameters of the functions in SynEdit by Lazarus?


  Regards,

  Luciano

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to show the parameters of a function
« Reply #1 on: May 11, 2016, 02:00:42 pm »
When you write function and bracket:
Code: Pascal  [Select][+][-]
  1. i:=MyFunction(|
you hit Ctrl+Shift+Space and list of parameters appears (if you mean this).
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12194
  • Debugger - SynEdit - and more
    • wiki
Re: How to show the parameters of a function
« Reply #2 on: May 11, 2016, 02:46:35 pm »
The hint is just a hint (THintWindon, or something), it is managed by codetools and source editor.
SynEdit does not provide that hint.

For the dropdowns:
http://wiki.lazarus.freepascal.org/SynEdit#Completion_plugins

llutti

  • New Member
  • *
  • Posts: 23
Re: How to show the parameters of a function
« Reply #3 on: May 11, 2016, 08:44:34 pm »
Hi,

   I'm migrating my own editor from Delphi for FreePascal / Lazarus.

   One of the features was the option to view the parameters (such as Blaazen said).

   In SynEdit Lazarus does not exist this feature (I not found). Lazarus editor has this feature is unique to him?

  Any tip how can I implement this in my editor?

Edson

  • Hero Member
  • *****
  • Posts: 1327
Re: How to show the parameters of a function
« Reply #4 on: May 11, 2016, 09:37:24 pm »
   One of the features was the option to view the parameters (such as Blaazen said).
   In SynEdit Lazarus does not exist this feature (I not found). Lazarus editor has this feature is unique to him?
Like Martin pointed, this feature is just a Hint window. The logic behind (obtain the content, format, and position) is implemented in Lazarus only for this IDE. SynEdit hasn't special  code to implement this feature.

  Any tip how can I implement this in my editor?

You could do the same way. Use a Hint window and implement the logic. Obtain the parameters of a function, depends on the syntax of the language. I guess you would need some kind of parser for the language you are working on your editor.
« Last Edit: May 11, 2016, 09:43:28 pm by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

llutti

  • New Member
  • *
  • Posts: 23
Re: How to show the parameters of a function
« Reply #5 on: May 12, 2016, 01:20:22 pm »
Thanked by orientations.

I wil create this feature as suggested and I will try to create a new component for this purpose.
« Last Edit: May 12, 2016, 03:04:12 pm by llutti »

Edson

  • Hero Member
  • *****
  • Posts: 1327
Re: How to show the parameters of a function
« Reply #6 on: May 12, 2016, 04:50:12 pm »
If you are working with SynEdit, probably these libraries could be useful:

Syntax Highlighter: https://github.com/t-edson/SynFacilSyn
Syntax Highlighter with code completion: https://github.com/t-edson/SynFacilCompletion

SynFacilSyn is a good parser too, and could be used to analyze de syntax of the language (not only to highlight it).
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

llutti

  • New Member
  • *
  • Posts: 23
Re: How to show the parameters of a function
« Reply #7 on: May 13, 2016, 12:03:44 pm »
Hi,

  Thanks by the tip's. I wil take a look in these libraries.

 

TinyPortal © 2005-2018