How do I get language templates to work?

How do I get language templates to work?

2
NewbieNewbie
2

    Aug 19, 2015#1

    When I edit language files the Templates list only shows global templates but no language templates. For example, when I edit Java (.java) and HTML (.html) files UltraEdit recognizes that these are language files, and the Display/Modify Templates dialog has lots of defined templates, but the Templates list does not show Java or HTML, but only Global templates. The video tutorial says that they are available automatically when I edit a language file, but they are not. Any suggestions for how to get them to display in the Templates list?
    I am using UltraEdit v18.00 on Windows XP & Windows 10.

    6,681583
    Grand MasterGrand Master
    6,681583

      Aug 19, 2015#2

      UE v18.00.0.1021 was the first version supporting smart templates. I restored this version from an archive to test smart templates feature on a *.html file containing HTML, JavaScript and CSS sections.

      I used the standard configuration which means:
      1. At Advanced - Configuration - Editor Display - Syntax Highlighting there is the directory (and not a file) %APPDATA%\IDMComp\UltraEdit\wordfiles configured whereby %APPDATA% is here a reference to environment variable APPDATA containing path to user account related application data directory.
        Deleting the string in edit field at top of this configuration dialog and closing the dialog with button OK sets this default wordfiles directory.
        This directory contains the standard wordfiles css.uew, html.uew and javascript.uew and some other *.uew files each containing 1 syntax highlighting definition as installed with UE v18.00.
      2. At Advanced - Configuration - Directories there is the directory %APPDATA%\IDMComp\UltraEdit\templates configured.
        This directory contains in subdirectory language the standard language template files css-tpl.xml, html-tpl.xml and javascript-tpl.xml and some other *-tpl.xml files as installed with UE v18.00.
      I did not have any project loaded as I opened the *.html file in UltraEdit.

      The caret was first blinking within an HTML section. The status bar displayed HTML in fourth box as expected indicating this part is syntax highlighting with language HTML as defined in html.uew. The template list displayed Global with no global templates as none defined by default, Power User with no environment (layout) templates as none defined by default, and HTML with the predefined language templates from html-tpl.xml. And of course I could insert one of those templates by double clicking on it and also by typing template name using auto-suggest feature.

      Next I moved caret into the JavaScript section. The status bar at bottom indicated now JavaScript as language defined with that name in javascript.uew was used for this section in file. And in template list HTML disappeared and instead JavaScript was displayed with the templates from javascript-tpl.xml which of course could be inserted with any method for inserting a language template.

      Last I moved caret into the CSS section. The status bar at bottom indicated now CSS 1.0-2.1 as language defined with that name in css.uew was used for this section in file. And in template list JavaScript disappeared and instead CSS 1.0-2.1 was displayed with the templates from css-tpl.xml.

      There is something wrong in your configuration if all that does not work. Check the configuration of the two directories. Check the *.uew files in the wordfiles directory.

      Are your *.java and *.html files syntax highlighted at all with language as defined in appropriate wordfile?

      Check the language template files. Is everything correct displayed in Advanced - Display/Modify Templates which can be opened also via the context menu item Add/Modify Template.

      In case of you can't see something wrong, pack with ZIP or RAR the entire templates and wordfiles directories and add also a *.java and a *.html file to the archive. Upload this ZIP or RAR archive as attachment to your next post I will look into it if I can see something with UE v18.00.0.1021 which disables loading and displaying the language templates.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Aug 19, 2015#3

        Mofi, thanks for your considerable help. Through your heroic effort you solved my problem. The key was turning on syntax highlighting. I normally work with syntax highlighting turned off, and when I open a .java (or other language) file the Templates list shows only Global templates, though Java is displayed in the status bar. If I then turn on syntax highlighting, Java templates appear in the Templates list and work as they should. Now all is well.

        Neither the UltraEdit help text nor the video tutorial said explicitly that you must enable syntax highlighting in order for templates to work, so I missed it, though now I see they hint that this is the case.

        From your post I also learned a bit about what files are used by UltraEdit for templates and other features, which enhances my understanding.

        Many thanks from North Carolina, USA.