Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

make codehints work within defined start/end - tags only ?

Guide ,
May 17, 2010 May 17, 2010

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

TOPICS
Extensions
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , May 17, 2010 May 17, 2010
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

...
Translate
Adobe Employee ,
May 17, 2010 May 17, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 17, 2010 May 17, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 17, 2010 May 17, 2010
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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 17, 2010 May 17, 2010

Thanks Randy,

you´re a life-saver -- all works well now 🙂

Cheers,

Günter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 17, 2010 May 17, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 17, 2010 May 17, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines