0

Custom language in WebStorm : possible ?

Hi all,

our company is currently evaluating the migration to WebStorm as our main development IDE and I would like to ask the following question :

We use a custom kind of "language" in our files which is actually very close to ASP.

Our files are html files or macro files.

Macro files contain lists of chunks of html like

MyMacro1 [
<div>Some html</div>
]

MyMacro2 ...

Each html file or a chunk inside a macro file can contain calls to our custom functions like <%MyFunc()%>, we have our own list of such functions that we would like to be highlighted / autocompleted if possible.

Our functions accept arguments, with the following three argument quote possibilities :

<%MyFunc(arg="value")%> or <%MyFunc(arg='value')%> or <%MyFunc(arg=|value|)%>

They can also be nested :

<%MyFunc(arg="<%MyFunc2(arg2='value2')%>")%>

Both these constructs can be inserted in the main files (html or macros) anywhere, in the HTML part, but also inside any script that is present inside a regular <script> tag such as

     <script>
          var test = "foo<%MyFunc(arg=|value|)%>bar";
     </script>

Is it possible to make WebStorm recognize this kind of syntax and how please ?

We could pretend it is ASP and place our file extension in the ASP file type, but it doesn't seem to give the desired result, because then the HTML is not properly highlighted... If I define our type as HTML, then our tags do not get properly handled when presend inside scripts and so on...

Thanks in advance for your help !

4 comments

Please sign in to leave a comment.