Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

syntax highlight (.tmLanguage) in Sublime Text 3 for packages

I work on this plugin

Syntax highlight does not work with Sublime Text 3 when plugin is installed using package control.

Error loading syntax file "Sublime Text 3/Installed Packages/robot.tmLanguage": Unable to open Sublime Text 3/Installed Packages/robot.tmLanguage

The plugin is under Installed Packcages/Robot Framework Assistant.sublime-package, the file 'robot.tmLanguage' in inside Robot Framework Assistant.sublime-package archive.

Here is how I set paths https://github.com/andriyko/sublime-robot-framework-assistant/blob/master/rfassistant/init.py

My question is similar to this thread, but in my case the plugin is installed as archive(.sublime-package) not folder with with files.

  1. I am not sure that my path settings mentioned above are correct in python3.

  2. How can I refer to tmLanguage file that is inside .sublime-package file?

  3. Where should I put that file? It is totally confusing why does it work on Sublime Text 2 and Sublime Text 3(when installed into dir from github) but does not work when installed via Package Control.

So, how do I set path to tmLanguage file and where should I store it. Just want to clarify, that it works fine when plugin is installed from github zip file(because I put it's content into RobotFrameworkAssistant folder under Packages directory). It does not work when plugin is installed via Package Control.

like image 521
user3067543 Avatar asked Jan 11 '23 18:01

user3067543


1 Answers

Quick summary of my manual solution of adding custom .tmLanguage files based on others' suggestions:

  1. Put the myLang.tmLanguage file into a folder with your desired syntax name.
  2. Zip the folder so that it's named myLang.zip
  3. Rename the zip archive to myLang.sublime-package
  4. Put the myLang.sublime-package into the Sublime 3 packages folder. It will now appear in the sublime syntax highlighting menu.

Based on ST3 docs, I can't seem to find an alternative to this manual method right now, but it will work.

Package control will likely do everything you need behind the scene

like image 128
Megatron Avatar answered Jan 31 '23 10:01

Megatron