Recent

Author Topic: Improving Code Completion  (Read 7163 times)

regs

  • New Member
  • *
  • Posts: 46
Improving Code Completion
« 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

Edson

  • Hero Member
  • *****
  • Posts: 1055
Re: Improving Code Completion
« Reply #1 on: December 28, 2015, 12:28:20 am »
Good job. :)
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

regs

  • New Member
  • *
  • Posts: 46
Re: Improving Code Completion
« Reply #2 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.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5699
    • wiki
Re: Improving Code Completion
« Reply #3 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.

Edson

  • Hero Member
  • *****
  • Posts: 1055
Re: Improving Code Completion
« Reply #4 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.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

regs

  • New Member
  • *
  • Posts: 46
Re: Improving Code Completion
« Reply #5 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.

regs

  • New Member
  • *
  • Posts: 46
Re: Improving Code Completion
« Reply #6 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
« Last Edit: August 15, 2016, 12:53:58 am by regs »

shobits1

  • Sr. Member
  • ****
  • Posts: 278
  • .
Re: Improving Code Completion
« Reply #7 on: August 15, 2016, 09:46:03 pm »
Interesting  :D
now how do I get this in my Lazarus.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1470
Re: Improving Code Completion
« Reply #8 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!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard