Sublime Forum

Custom tag at goto symbol list

#1

Hi there,
I was wondering how can I add a custom tag to identify a line to be included in the goto symbol list?
Should this be defined in a new Symbol_List file or can extend existing?
Can this be done across multiple language definitions?
As an example I’d like to put a :TODO:(“my comment”) anywhere on the line and be able to see the comment in the goto symbol menu.

Thanks for any suggestion.
kuba

0 Likes

#2

Just find out the scope created on your sublime-syntax file for the words :TODO:("my comment"). And create .tmPreferences file named as your language. Example, MyLanguageName.tmPreferences:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>name</key>
	<string>Symbol List</string>
	<key>scope</key>
	<string>(source.MyLanguageName) &amp; (scopo1.as | parameter.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
</plist>

Find out scopes for your theme you may use these:

  1. https://github.com/yaworsw/Sublime-ScopeAlways
  2. https://github.com/facelessuser/ScopeHunter
0 Likes