Sublime Forum

Unable to override zipped package

#1

Hi,

i am trying to override the zipped sublime-package. Followed the steps as mentioned over here, but they do not seem to be working. Kindly advise. I even extracted the package and tried to override my changes to the tmlanguage file, but they are not having any effect. The sublime version i am using is Sublime Text 3 Build 3083.

sublimetext.com/docs/3/packages.html

0 Likes

#2

If you followed the steps exactly, it should be working. You might want to double-check whether you actually understood the instructions.

You can find more information on packages here:

http://docs.sublimetext.info/en/latest/extensibility/packages.html

0 Likes

#3

Well I did follow the steps. Finally I extracted the package and override the tmlanguage file. I will be retrying the steps on a different machine tomorrow and check if I missed something. Would revisit the forum the update

0 Likes

#4

Hi @FichteFoll ,

I am trying to now install the YAML package on the MAC machine. I am using sublime text 3, build version 3065. I copied and pasted the package under this location.

/Users//Library/Application Support/Sublime Text 3/Packages

But the application is still not able to get the new scopes that we have defined for this plugin that we have written. May I have more understanding on how to proceed. Even for Windows OS, I extracted the package using PackageResourceViewer and then overwrote the existing YAML.tmlanguage for the plugin to get working. But I do not want to go with this approach as for the end users it would be too cumbersome. The final deployment machines would only be MAC and not Windows.

Could please someone assist me in how to proceed appropriately with overriding the package.

Following is the list of folders I can see under SublimeText 3 :

Cache
Index
Installed Packages
Local
Packages

0 Likes

#5

Can you share the exact files you are copying so I can try to reproduce?

0 Likes

#6

Hey @FichteFoll, I am not sure if I can share the files due to the business code of conduct policy. :frowning: but after a lot of twists and turns i did manage to get it working. i went to the /Applications/Sublime Text.app/Contents/MacOS/Packages folder where all the sublime-package files are kept. Cut the YAML.sublime-package file and pasted it on the desktop for safe-keeping :smiley: Then I copied my YAML folder under ~/Packages folder. Deleted the YAML folder from Cache folder and quit sublime text. After all these steps i was able to get the plugin working. Then i copied the file YAML.sublime-package back to its original location, just to see if it interferes with the changes and it did not.

I think i probably just had to delete the YAML folder from the Cache so that sublime creates a cache file of the new YAML.tmlanguage file for my plugin to work properly.

I am awating for a fresh machine where I could implement all of these steps without the workarounds and would keep you updated.

Thanks for all the inputs and help.

Regards,
Shilpa

0 Likes

#7

Glad to hear you got it working. The circumstances are kind of odd however.

I am curious how you will work it out on a fresh machine.

0 Likes

#8

@FichteFoll Hi, I did install on a fresh machine. The company for which I am writing the plugin has Sublime Text 2 as the authorized version allowed for installation. So it was pretty simple to install it on Sublime Text 2. I deleted the existing YAML files including the cache files and copied with the .tmlanguage we need for the plugin and it worked very well in first go without any hiccups.

But, I have another code related issue for another enhancement required for this plugin. I have to get the list in alphabetical order and though the tuple i am creating is in alphabetical order, somehow when i return it on_query_completions, the list does not come in the same fashion. below is my code for on_query_completions. Now until the print statement, the completion set is as per the alphabetical listing, but the moment the return statement is called, the list which is shown to the user is not as per the generated one. I need help and understanding on how to achieve this.

def on_query_completions(self, view, prefix, locations):
completion_set=[]
scope_name = sublime.windows()[0].active_view().scope_name(sublime.windows()[0].active_view().sel()[0].begin())
#print("IntelliSense debug: o_q_c scope_name = ", scope_name)
if view.match_selector(locations[0], “source.yaml”):
if len(prefix) >= 1:
currentposition = view.sel()[0].begin()
currentline = view.full_line(currentposition)
text = view.substr(currentline)

            # return self.get_autocomplete_list(prefix)
            # print "IntelliSense debug: Fetching autocomplete list."
            completion_set = self.get_autocomplete_list(prefix, scope_name,text)
            print(completion_set)
            return (completion_set,sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
0 Likes