Copy link to clipboard
Copied
Hi there,
would like to know if it´s possible to make custom codehints work inside defined opening/closing tags, say, PHP codehints which should only appear when typing a pattern inside existing <?php ... ?> tags.
Cheers,
Günter
should have mentioned that I´m not using codehints "functions", but menu patterns which have the DOCTYPES="PHP_MySQL" defined, example:
<menu pattern="whatever" DOCTYPES="PHP_MySQL" casesensitive="true">....
</menu>
This is fixed with the displayrestriction attribute. Set it to the Code Coloring <scheme> that you want to limit the code hinting to.
What does Code Coloring have to do with Code Hints? The "Code Coloring" feature is a bit of a misnomer. The Code Coloring patterns define different synta
...Copy link to clipboard
Copied
would like to know if it´s possible to make custom codehints work inside defined opening/closing tags, say, PHP codehints which should only appear when typing a pattern inside existing <?php ... ?> tags.
Yes. Specify doctypes="PHP_MySQL" on each <function> tag.
You can see an example in Configuration/CodeHints/php_codehints.xml .
HTH,
Randy
Copy link to clipboard
Copied
Randy Edmunds wrote:
Yes. Specify doctypes="PHP_MySQL" on each <function> tag.
Hi Randy,
should have mentioned that I´m not using codehints "functions", but menu patterns which have the DOCTYPES="PHP_MySQL" defined, example:
<menu pattern="whatever" DOCTYPES="PHP_MySQL" casesensitive="true">
....
</menu>
In this context the "doctypes" doesn´t seem to do what I thought they would, because the corresponding labels will also become displayed when typing a pattern outside the <?php ?> tags.
Cheers,
Günter
Copy link to clipboard
Copied
should have mentioned that I´m not using codehints "functions", but menu patterns which have the DOCTYPES="PHP_MySQL" defined, example:
<menu pattern="whatever" DOCTYPES="PHP_MySQL" casesensitive="true">....
</menu>
This is fixed with the displayrestriction attribute. Set it to the Code Coloring <scheme> that you want to limit the code hinting to.
What does Code Coloring have to do with Code Hints? The "Code Coloring" feature is a bit of a misnomer. The Code Coloring patterns define different syntax states that are used for code coloring, but they are used by other code view features.
Look in Configuration/CodeColoring/PHP.xml, and you'll see that the main PHP <scheme> has id="PHP_Script". So, add this:
displayrestriction="PHP_Script"
to the <menu> tag.
Regards,
Randy
Copy link to clipboard
Copied
Thanks Randy,
you´re a life-saver -- all works well now 🙂
Cheers,
Günter
Copy link to clipboard
Copied
If I understand it correctly, we seem to have 5 code coloring schemes (aka "displayrestriction" values) defined in extra XML files:
ASP JavaScript = ASP_JScript
ASP VBScript = VBScript
ASP.NET CSharp = Csharp
ASP.NET VB = VB.Net
PHP = PHP_Script
...and apart from this, all other possible "displayrestriction" values seem to be defined in the file "Configuration/CodeColoring/CodeColoring.xml", and those who´d like to add custom codehints for other serverside scripting languages would have to check lines such as...
<scheme MMString:name="CFScript/scheme/name" id="CFScript" priority="20">
...and use the "id" value (say, CFScript) as "displayrestriction" value ?
Cheers,
Günter
Copy link to clipboard
Copied
Günter,
For Server Model Code Hints, yes that's correct.
There are also a few places where displayrestriction is used for css" and "JavaScript" <scheme>'s.
HTH,
Randy