Sublime Forum

How to enable HTML / JS / CSS completions/snippets?

#1

Hi guys

I’m starting to work with Demandware (ISML files) and I’m wondering how to make HTML / CSS / JS auto-completion / syntax work inside an .isml file as it works on a PHP file you know, you start typing and the suggestions pop out or you can use CTRL + Space to open the menu and also use the existent default snippets.

The ISML support is already installed with the Demandware own plugin so I have code highlights / color, but there is ZERO auto completion for html / css / js, and ISML is basically a XHTML file with some proprietary stuff like <isinclude> <isif> etc.

So how do I achieve this? Do I need to edit like inside the HTML.sublime-syntax and add the ISML extension for example? Would that work?

PS: I’m very new to Sublime so sorry if this is something very easy

Thanks!

0 Likes

#2

I don’t know, maybe my question was confuse but what I want is basically know how to make completions (ctrl + space) for HTML / CSS / JS appear on a different file extension, basically like PHP files that have PHP completion + HTML / JS / CSS.

Anyone?

0 Likes

#3

assuming you’re using https://packagecontrol.io/packages/ISML, you will probably want to change the base scope text.isml.basic to text.html.isml in the syntax definition ( https://github.com/aearly/isml-tmlanguage/blob/946d907a3b62be9b3e0bad38724b180c75c52dd9/ISML.tmLanguage#L1090 ), because text.html is the scope that the HTML completions operate on.

0 Likes

#4

Hi @kingkeith, thanks for replying.

I tried as you suggested and created the new package using the CreatePackage command and replaced it (saved the original in another folder) but now when selecting ISML syntax on Sublime I get this error:

Any idea what it’s going on?

Thanks!

0 Likes