Recent

Author Topic: How to Set up Code Completion Automatically  (Read 378 times)

robsean

  • Newbie
  • Posts: 4
How to Set up Code Completion Automatically
« on: August 18, 2019, 09:41:53 am »
Hi,
   How to Set up Code Completion Automatically?
We are from China. We want to set up automatic code completion function.Instead of automatic completion by pressing Ctrl + W

julkas

  • Sr. Member
  • ****
  • Posts: 348
  • KISS principle / Lazarus 2.0.0 / FPC 3.0.4
Re: How to Set up Code Completion Automatically
« Reply #1 on: August 18, 2019, 03:39:47 pm »
For our friends from China - may be this helps
Tools -> Options -> Codetools.
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;
(* Pointer game *) Inc(ptr, 1); (* vs *) ptr := ptr + 1;

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5573
    • wiki
Re: How to Set up Code Completion Automatically
« Reply #2 on: August 18, 2019, 05:51:26 pm »
Actually it should be ctrl-space (which invokes the intelligent code completion.

ctrl-W is just word completion (any word that can be found in the editor(s)).

That aside, the only auto invoke that exists is, if you press a ".". I.e.
  MyObject.
Then it will show you the methods/properties of that object.
There is a slight delay. It only opens if you do not press another key for like a half a second. You can change that wait time.


For more see https://bugs.freepascal.org/view.php?id=33054

robsean

  • Newbie
  • Posts: 4
Re: How to Set up Code Completion Automatically
« Reply #3 on: August 19, 2019, 02:45:15 am »
For our friends from China - may be this helps
Tools -> Options -> Codetools.

Thank you, But that's not what I want.

robsean

  • Newbie
  • Posts: 4
Re: How to Set up Code Completion Automatically
« Reply #4 on: August 19, 2019, 03:06:50 am »
Actually it should be ctrl-space (which invokes the intelligent code completion.

ctrl-W is just word completion (any word that can be found in the editor(s)).

That aside, the only auto invoke that exists is, if you press a ".". I.e.
  MyObject.
Then it will show you the methods/properties of that object.
There is a slight delay. It only opens if you do not press another key for like a half a second. You can change that wait time.


For more see https://bugs.freepascal.org/view.php?id=33054

Thank you,But that's not what I want.

Maybe what I said is not clear.
What I want is that when I press the letter c, the editor automatically displays the prompt Words which beginning with C on the next line of the letter c.
like this:
https://code.visualstudio.com/assets/docs/editor/intellisense/intellisense_packagejson.gif

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5573
    • wiki
Re: How to Set up Code Completion Automatically
« Reply #5 on: August 19, 2019, 03:51:28 am »

What I want is that when I press the letter c, the editor automatically displays the prompt Words which beginning with C on the next line of the letter c.
like this:
https://code.visualstudio.com/assets/docs/editor/intellisense/intellisense_packagejson.gif
I understood that, yes.

But: That is not available.

Somebody did start that, but it was never finished: https://bugs.freepascal.org/view.php?id=33054

robsean

  • Newbie
  • Posts: 4
Re: How to Set up Code Completion Automatically
« Reply #6 on: August 19, 2019, 04:19:38 am »

What I want is that when I press the letter c, the editor automatically displays the prompt Words which beginning with C on the next line of the letter c.
like this:
https://code.visualstudio.com/assets/docs/editor/intellisense/intellisense_packagejson.gif
I understood that, yes.

But: That is not available.

Somebody did start that, but it was never finished: https://bugs.freepascal.org/view.php?id=33054
Thank you

Edson

  • Hero Member
  • *****
  • Posts: 1041
Re: How to Set up Code Completion Automatically
« Reply #7 on: August 20, 2019, 01:30:35 am »
Just for information, SynFacilCompletion https://github.com/t-edson/SynFacilCompletion (son of SynFacilSyn) implements that feature with SynEdit. I don't know if it could be included in Lazarus in some way.
« Last Edit: August 20, 2019, 01:33:18 am by Edson »
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7