Author Topic: Show list of "Code Templates" , an part of the "Code Hints"  (Read 3228 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Show list of "Code Templates" , an part of the "Code Hints"
« on: January 24, 2009, 01:26:31 PM »
Show list of "Code Hints"

Is there an function to show the list of "Code Hints" like the auto complete words too?

I guess i can't remember them all.
Maybe include this list into the  Code Completion"-list too?
Or provide an second trigger to see this code hints list alone?
Or should we wait till you provide an side panel to list all code hint there?
« Last Edit: February 01, 2009, 10:05:29 PM by Stefan »
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2206
  • Karma: +37/-3
    • HippoEDIT
Re: Show list of "Code Hints"
« Reply #1 on: February 01, 2009, 08:44:09 PM »
Hello Stefan,

do you mean Code Templates list?

Because Code Hints are collected from code templates, statistics, keywords from syntax schema and auto correction data, and everythig except of code templates are in Code Completion list.

But, if you have selected text and then would use completion shortcut (by default Ctrl+Space), you should see menu with code templates. First come templates that contain %SelectedText% and %SelectedLine% tags and then rest.

Maybe it is a good idea to include also code templates into normal completion list (optionally) but I need to evaluate it.
Also, code templates are only suggested when they typed completely. Then accepting of it, leads to template expanding.
Yellow background indicates, that only one match for typed prefix found, inversed background shows that more then one completion exist.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Show list of "Code Hints"
« Reply #2 on: February 01, 2009, 10:01:26 PM »
Yes i mean "Code Templates list"
I saw the term "Code Hints" in the help file and doesn't understood the differences.
And so, about the picture in the help too, i thought "Code Hints" are the term for "Code Templates list".

-

O.K., i have now understood:

-- If i press Ctrl+Space i see the "Code Completion list"  - that's O.K.

-- If i have some text selected and press Ctrl+Space, i get an dialog where i click on More... and get the "Code Templates list"
   That's not  obviously to handle...... i have to select text to get the list ?
   I didn't would find this out on my own.  That's why i ask for an other solution.


----

FYI: I will modify my  FAQ-entry "What are Code Hints?"  too.

.
« Last Edit: February 01, 2009, 10:04:35 PM by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2206
  • Karma: +37/-3
    • HippoEDIT
Re: Show list of "Code Templates" , an part of the "Code Hints"
« Reply #3 on: February 04, 2009, 12:34:36 PM »
The idea to show Code Template list comes initially only as helper for Surround by template command.
So, that is why you see it only after selecting some text. This More... with a rest of code temaplates comes later, just with thought "Why not?"...

But I think some special command to show Code Templates is also necessary.
I would add it.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Show list of "Code Templates" , an part of the "Code Hints"
« Reply #4 on: February 14, 2009, 02:16:51 PM »
Implemented with 1.42 beta build 617 at 13. Feb. 2009

# New. Code templates now can be shown in Completion List box.
    Controlled by "Options->Code Completion->Show in completion list->Code Templates"

Now you can see in the "Code Hints" by pressing Ctrl+Space the code templates from "data\syntax\xxx_user.xml" too.

But not all templates are shown (tested with ,c , ,cpp and .js)
because the template-trigger words, f.ex. 'if' and 'for' are an KEYWORD too.

So i suggest modify your template-trigger word to something like  ,for   or    _if      or #while
like i show in the pic on the left side in the red colored box:
« Last Edit: February 14, 2009, 02:26:45 PM by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2206
  • Karma: +37/-3
    • HippoEDIT
Re: Show list of "Code Templates" , an part of the "Code Hints"
« Reply #5 on: February 15, 2009, 04:28:32 PM »
Hi Stefan,

yes, you are right. I still have some problems with seeing picures in the forum, need to go to admin panel to do so... But I have seen.

I think proper way would be to enable display of duplicate entries in a completion list. It is not necessary for keywords, but realy necessary if you have a keyword and same template key (as you have shown). I would do this next beta.

Because other wise user need to remeber a template shortcut in addition to keyword, and this is not user friendly :)

BTW: I have added support of multi word/symbol template keys at 617 also. So know you can have something like this as key: -- some template.