Skip to content

Loading…

Improve Symbol detection #26

Open
wants to merge 1 commit into from

3 participants

@MSch

No description provided.

@fjl
Owner

This does several things at once.

Regarding the exclusion of meta.function.erlang: Is this really necessary? I
use Sublime-Erlang every day and no additional definitions show up in the symbol list.
Can you provide an example module where this happens? Which version
of Sublime Text do you use?

Regarding the change in the symbol list prefixes: they were like that in the original
textmate package and I changed them on purpose. I think they are easier to read
as words, and you don't run into sigil-namespace problems for stuff like yecc rules.
If there was real demand from more than one person, I would give in and change them,
though. Please also keep in mind that the prefixes are used by the Goto Definition code and need
to be changed there as well.

@MSch

Sorry for taking so long to get back to you, I was on vacation :)

I'm using Sublime Text 3:

Example file: https://gist.github.com/6339279

Here simple calls to functions show up in the symbol list:

2013-08-26 at 10 38

I fixed that:

2013-08-26 at 10 38

We haven't done anything with yecc rules in our codebase yet, and probably won't, so I did not consider that at all.
Guess it could maybe be an option?

@nox

The prefixes should rather be left alone and the calls not be included in the symbol list.

@fjl
Owner

Here's how it looks like for me:

screenshot

I have no idea why those symbols show up on your machine.
What other plugins do you have installed? Also, is there anything related to Erlang in your User package?

@MSch

Hm, there's nothing in my User package, but I have kept the Erlang.sublime-package that comes with Sublime Text.

These are all my plugins:

BracketHighlighter/         Package Control/            Slim/                       Theme - Soda/               WordHighlight/
Focus Last Tab/             Ruby/                       Sublime-Erlang/             TrailingSpaces/
Git/                        SCSS/                       SublimeBlockCursor/         User/
GitGutter/                  ScopeHunter/                SyncedSideBar/              Vintageous/
Origami/                    SideBarEnhancements/        Theme - Default/            Vintageous_Plugin_Surround/
@fjl
Owner

I don't know how to solve this issue. I think the best thing going forward would be to just blacklist those scopes as you did. Please update the pull request so it contains only the blacklisting of meta.function.erlang and not the prefix changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2015
  1. @MSch

    Improve detected symbols

    MSch committed
This page is out of date. Refresh to see the latest.
View
4 Function Symbols.tmPreferences
@@ -11,11 +11,11 @@
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
- <string>s/^/Function: /</string>
+ <string>s/^//</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
<key>symbolIndexTransformation</key>
- <string>s/^/Function: /</string>
+ <string>s/^//</string>
</dict>
</dict>
</plist>
View
17 Hide Wrongly Detected Function Definitions.tmPreferences
@@ -0,0 +1,17 @@
+<?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>Function Symbols</string>
+ <key>scope</key>
+ <string>meta.function.erlang, meta.function.module.erlang</string>
+ <key>settings</key>
+ <dict>
+ <key>showInSymbolList</key>
+ <integer>0</integer>
+ <key>showInIndexedSymbolList</key>
+ <integer>0</integer>
+ </dict>
+</dict>
+</plist>
View
4 Macro Symbols.tmPreferences
@@ -11,11 +11,11 @@
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
- <string>s/^/Macro: /</string>
+ <string>s/^/?/</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
<key>symbolIndexTransformation</key>
- <string>s/^/Macro: /</string>
+ <string>s/^/?/</string>
</dict>
</dict>
</plist>
View
4 Record Symbols.tmPreferences
@@ -11,11 +11,11 @@
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
- <string>s/^/Record: /</string>
+ <string>s/^/-record /</string>
<key>showInIndexedSymbolList</key>
<string>1</string>
<key>symbolIndexTransformation</key>
- <string>s/^/Record: /</string>
+ <string>s/^/-record /</string>
</dict>
</dict>
</plist>
View
4 Type Symbols.tmPreferences
@@ -11,11 +11,11 @@
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
- <string>s/^/Type: /</string>
+ <string>s/^/-type /;s/$/\(\)/</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
<key>symbolIndexTransformation</key>
- <string>s/^/Type: /</string>
+ <string>s/^/-type /;s/$/\(\)/</string>
</dict>
</dict>
</plist>
Something went wrong with that request. Please try again.