Sublime Forum

[Solved] How to set up a Local and Global Symbols list?

#1

How to set up a Local and Global Symbols list?

These mime are not working. When I do this only the <string>Symbol List Global</string> shows up:

<?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 Global</string>
	<key>scope</key>
	<string>(source.AmxxPawn) &amp; (function.definition | variable.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<integer>1</integer>
		<key>showInIndexedSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
<dict>
	<key>name</key>
	<string>Symbol List Local</string>
	<key>scope</key>
	<string>(source.AmxxPawn) &amp; (variable.local.definition | parameter.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
</plist>

It is working only when I set up everything as global:

<?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 Global</string>
	<key>scope</key>
	<string>(source.AmxxPawn) &amp; (function.definition | variable.definition | variable.local.definition | parameter.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<integer>1</integer>
		<key>showInIndexedSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
</plist>
0 Likes

#2

I don’t believe Sublime Text will parse multiple <dict> tags in the root of a <plist> inside of a .tmPreferences file.

1 Like

#3

So, how to set up some scopes to showInIndexedSymbolList and others to showInSymbolList?

0 Likes

#4

Two .tmPreferences files :smile:

4 Likes

#5

Thanks, I got them on two files and it is working very well.

These are the files, AmxxPawn_Local.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 Global</string>
	<key>scope</key>
	<string>(source.AmxxPawn) &amp; (variable.local.definition | parameter.definition | function.definition | variable.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
</plist>

And AmxxPawn_Global.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 Global</string>
	<key>scope</key>
	<string>(source.AmxxPawn) &amp; (function.definition | variable.definition)</string>
	<key>settings</key>
	<dict>
		<key>showInIndexedSymbolList</key>
		<integer>1</integer>
	</dict>
</dict>
</plist>
0 Likes

Why use CTags, while there is the built-in Sublime Text symbols?