问题
I made a bunch of snippets I want to use when I'm editing .jsp files in Sublime Text 2.
When I edit a JSP file (syntax: JSP) the autocomplete function doens't work. When I change the syntax to "Java" the autocomplete works.
Plan B: it does work with the JSP syntax when I hit 'c: tab'. But there is no autocomplete while typing like with the Java syntax.
I tried
- changing and removing the scope
- changing the tabTrigger to core-, not using ":", giving every snippet another trigger, giving every snippet the same trigger (so plan B works)
- placing the snippet files in \Packages\User\ and \Packages\User\Jsp\ folder
Snippet example:
<snippet>
<content><![CDATA[
<c:forEach items="\$\{${1}\}" var="${2}" varStatus="${3}" begin="\$\{${4}\}" end="\$\{${5}\}">
${6}
</c:forEach>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>c:</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html.jsp</scope>
</snippet>
Example screenshot:
来源:https://stackoverflow.com/questions/17700676/no-autocomplete-popup-in-jsp-files-for-snippets