Sublime Forum

Can someone better versed Sublime and/or Python explain this line

#1

Hello,
I’m relatively new to sublime text and to python and I’m trying to craft a small plugin.
My plugin will need to know the current language and commenting characters among other things.
While search online documentation and the source code of various plugins. I’ve found some code that seems to the extract the commenting characters but I’m concerned because this method doesn’t seem to be documented anywhere that I can find.

view.meta_info(“shellVariables”, pt)

Can anybody tell me is this sublime thing, a python, or what? Is it documented, if so where?

Thanks
Gary

0 Likes

#2

It’s a Sublime thing, but it’s not mentioned in the official API documentation for reasons only the devs know (possibly just as an oversight). There’s mention of it in the metadata section of the Unofficial documentation, though.

In the executable folder of your Sublime installation folder, you’ll find a file named sublime.py that provides the Python side of the Sublime API that connects it with the portions that are written in C++. You can take a look in there to see what API calls are available that might not be directly documented.

2 Likes

#3
0 Likes

#4

Also, the default plugin that toggles comments uses this API and hasn’t been changed in years, so it’s likely safe to use regardless of whether it is documented

2 Likes

#5

This is somewhat off-topic but it may be on point… You mentioned that your plugin requires knowledge of commenting chars and more…

Take a look at CodeMap by oleg-shiro on github ( it is in package manager ) which reads in the file-extension / type of file, and other data… to map the syntax…

If this is more on point, take a look at my extension to CodeMap called XCodeMapper until version 1 - dev-name… which extends CodeMap to make mapping languages much easier… Here’s my ST post: Acecool Code Mapping System - previously XCodeMapper - Developmental Name - Nearing Version 1 - addition to [ CodeMap by oleg-shiro ]

0 Likes