0

UPDATED

I'm working on Salesforce development using the MavensMate plugin for Sublime Text 3. I'm wanting to create a custom completions file that will contain some common HTML tag class names that I use often in my Visualforce pages.

Visualforce uses normal HTML tags, but also has custom tags that look something like this...

<apex:tagName ... />

Visualforce pages have a file name extension "filename.page". MavensMate uses the HTML syntax highlighting, and when I press "ctrl+alt+shift+p" to get the scope selector(s) it shows the same as a normal HTML file would (ie text.html.basic).

I can get my completions file to work in a normal HTML page outside of tags, but not within a class definition in a tag. I can't seem to get it to work at all in a Visualforce page.

My initial file was based of the documentation found here.

{
   "scope": "text.html.basic",

   "completions":
   [
      { "trigger": "test\tTheTest", "contents": "this is a test" }
   ]
}

Unfortunately I can't get it to work. I've tried every permutation of the above scope. My file is named "test.sublime-completions" and is located in the Packages/User/ directory. I've tried renaming to HTML.sublime-completions, html.sublime-completions.

I've changed the "auto_complete_selector" and the "auto_complete_triggers" to try and solve this, but still nothing.

"auto_complete_selector": "source, text, string.quoted.double.html",
"auto_complete_triggers":
[
    {
        "characters": "<",
        "selector": "text.html",
        "selector": "string.quuoted.double.html"
    }
],

I made a post on the ST forums found here but nobody has replied. :(

Can anyone shed some light on to what I'm doing wrong, and how I can get this resolved.

As a work around I can make Snippets for each class, but it seems more appropriate to do this via Completions.

1

It's probably because your scope specification is invalid. the following works perfectly fine for me:

{
   "scope": "text.html",

   "completions":
   [
      { "trigger": "test\tTheTest", "contents": "this is a test" }
   ]
}
  • I've switched my scope to match yours, and it is still not working. Not sure what I'm doing wrong. – Doug B Nov 20 '15 at 14:14
  • Ok, so I got it to work in HTML outside of a tag class definition, but I still can't get it to work inside a class on a tag. Also I think I have another issue. I'm going to update my post. – Doug B Nov 20 '15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.