Lazarus

Miscellaneous => Suggestions => IDE/CodeTools => Topic started by: regs on December 26, 2015, 01:05:37 pm

Title: Improving Code Completion
Post by: regs on December 26, 2015, 01:05:37 pm
Been working to improve Code Completion. There is still plenty of things to do. Particularly figuring out how to avoid of calling GatherContextKeywords in values and parameters.

But here is what has been done already with few screenshots.

- Auto invoke code completion
- Customizable code completion form
- CnWizard-like extended filter
- Images in code completion
- All optional

https://yadi.sk/i/XcyaHPQAmWAJD
https://yadi.sk/i/izAFklyumWAJd
https://yadi.sk/i/jv_tW2demWAJp
Title: Re: Improving Code Completion
Post by: Edson on December 28, 2015, 12:28:20 am
Good job. :)
Title: Re: Improving Code Completion
Post by: regs on March 26, 2016, 08:59:59 pm
So, i still have that question that i have no much time to dig in. I can add keywords to begin block. I've found how to avoid listing them in object children (after .). Yet still most of them should be shown in () and after =.

Or at least a way to place them at the bottom of completion form list. Can't figure it out as well. They keep popping up the top.
Title: Re: Improving Code Completion
Post by: Martin_fr on March 26, 2016, 10:20:55 pm
If possible you should ask those on the mail list.

That will get more attention from those who know the answers.
Title: Re: Improving Code Completion
Post by: Edson on March 27, 2016, 09:23:45 pm
By the way, you can check my library: https://github.com/t-edson/SynFacilCompletion

It could give you some ideas.
Title: Re: Improving Code Completion
Post by: regs on July 27, 2016, 09:12:25 pm
By the way, you can check my library: https://github.com/t-edson/SynFacilCompletion

It could give you some ideas.

Well, all stuff above is already done. Those are real screenshots. The only problem left are keywords in begin block. As completion fires automatically, all keywords should be in completion as well, so you will able to type if to get if, not ifData. I can add then any way, but then keywords would always be in top of completion list. That would be pretty annoying. So this is the question about codetools, rather than completion form. How to move them down, or populate them among topleast items.

Until then it's a bit pointless to file patches on tracker. Usability wouldn't be among greatest.
Title: Re: Improving Code Completion
Post by: regs on August 14, 2016, 09:32:59 pm
Took a bit time to look into myself. Ended up by moving GatherContextKeywords down a bit after check if procedure is allowed, if that is ok?

Added condition
Code: Pascal  [Select]
  1. if not (ilcfDontAllowProcedures in CurrentIdentifierList.ContextFlags) and
  2.    not (GatherContext.Node.Desc in AllClassObjects) then                  
  3.     GatherContextKeywords(CursorContext,IdentStartPos,Beautifier);    
  4.  


The way it works. If everything is ok, i'll keep adding patches.
https://www.youtube.com/watch?v=1dZnS2HNIIU
Title: Re: Improving Code Completion
Post by: shobits1 on August 15, 2016, 09:46:03 pm
Interesting  :D
now how do I get this in my Lazarus.
Title: Re: Improving Code Completion
Post by: jmpessoa on August 15, 2016, 11:09:35 pm
Hi All,

My question: It has some way to get/paste the complete [method] code showing? 

Example: I want paste:

Code: Pascal  [Select]
  1.    Self.SetAutoScroll(Value: Boolean);
  2.  

not just:

Code: Pascal  [Select]
  1.    Self.SetAutoScroll();
  2.  

Thanks!