Sublime Forum

Dev Build 3116

#15

Great. It doesn’t work then :smiley:

The whole project is indexed, go to definition and go to symbol and go to symbol in project works as expected.

The video is made on a clean 3116 portable, no plugins or any customization are made (other than font size).

It only works for certain languages?

0 Likes

#16

@iamntz hmm, works in a Python file (and finds the PHP method with the same name in a different file!) but apparently not in a PHP file…

1 Like

#17

looks like it is due to the code in symbol.py in the Default package - starting at line 166 - treating HTML differently, and thus not noticing it is a PHP file, so it is broken for all syntaxes that are embedded in HTML:

    # Limit where we show the hover popup
    if view.score_selector(point, 'text.html'):
        class_ = view.score_selector(point, 'meta.attribute-with-value.class')
        id_ = view.score_selector(point, 'meta.attribute-with-value.id')
        if not class_ and not id_:
            return
    else:
        if not view.score_selector(point, 'source'):
            return
        if view.score_selector(point, 'comment'):
            return
        # Only show definitions in a string if there is interpolated source
        if view.score_selector(point, 'string') and not view.score_selector(point, 'string source'):
            return
0 Likes

#18

Uuuuuuu, looks so pretty! :smiley:

Anyhow, i found another issue, which i think is not necessary related:

jQuery(document).ready(function($){
  function foo(argument) {}
})

foo is not displayed in the Symbol list, although it is a valid symbol, no?

0 Likes

#19

odd, it is displayed for me:

0 Likes

#20

Hmmmm, you’re right. On the portable version it works. On the installed (and heavy customized) it doesn’t.

I’ll start toggling packages and see which one is the nasty one.

0 Likes

JavaScript Symbol List Not Showing Function
#21

As long as CDATA tags are not required by the color scheme parser, you can just not use them since the converter will already handle escaping the necessary characters before writing the converted XML. CDATA tags are only useful when you are directly editing XML by hand, not when you are converting to it anyway.

Just use a | YAML block scalar.

1 Like

#22

@jps Also is it possible to configure the popup to appear only on some scopes ?
I’d like to limit it to function and types.

@ fitchefoll & kingkeith : Thanks, I just copy-pasted the css from the default themes, without checking that the CDATA wasn’t necessary.

0 Likes

#23

The symbol index does not store context information regarding the symbol it found (specifically its scope path), so you can’t reliably do it from within a plugin.

Depending on what exactly you do not want to see, you can prevent that from being indexed altogether through a “tmPreferences” metadata file. See http://docs.sublimetext.info/en/latest/reference/symbols.html.

1 Like

#24

with the hover functionality, because the new hover API receives a point, it is possible to get the scope under the mouse cursor, so a plugin can reliably choose to ignore certain scopes or only whitelist certain scopes. However, looking at the code in symbol.py, as it stands, there is no way to configure it - you’d have to write your own plugin and disable the built in functionality using the show_definitions setting.

0 Likes

#25

So how does someone who has a theme style the popups?

0 Likes

#26

you can only style popups in a color scheme I think, apart from that the plugins that show the popups are responsible for what colors to use

0 Likes

#27

The popups are styled via the popupCss setting of the color scheme. It is controlled via the color scheme so that they fit nicely with the text buffer, since that is the only place they are displayed.

At some point in the near future I’ll be working on some docs for our subset of HTML and CSS. We do not currently embed a full-featured HTML engine.

2 Likes

#28

What happens if a popup supplies CSS too? Are the styles merged? Or are the theme CSS styles ignored?

0 Likes

#29

This allows fetching the scope of the symbol the mouse is over, but not the scope of the source of the symbol. You could accomplish checking the destination scope via opening the file/point in a hidden output buffer and checking the scope and then excluding it from the list.

I’m sure we’ll be tweaking Show Definitions over time as we get feedback and have time to implement more features. Keep the feedback coming!

2 Likes

#30

I think @FichteFoll had this question in another thread, and I have it too: What happens if more than one plugin is using the new hover listener, and they both try to show a popup?

0 Likes

#31

There are multiple stylesheets: the default, one based on the current view text settings, the rules from the popup, <style> tags in the content sent to show_popup() and then style="" attributes on the HTML. The selector with the greatest specificity will win.

1 Like

#32

I’m on OS X with build 3117 and neither “settings open in new window” or “show_definition on hover” seem to work.

With settings, I either select Sublime Text -> Preferences -> Settings - User or use the keyboard shortcut cmd-, and both seem to just open the user settings file in a new tab.

For “show_definition on hover” nothing happens. I’ve used the Python example posted above with the build in Python syntax definition, but nothing happens on hover. I’ve also tried with several other syntaxes. All of them work with “goto definition” using keyboard shortcuts or mouse.

Could these be package conflicts or am I misunderstanding how these features work?

0 Likes

#33

There is a single popup visible for a view at a time. The last one to run will be the one visible.

There is a method in the API to check if a popup is already shown (in addition to being able to see if the auto complete menu is shown).

1 Like

#34

It sounds like you have an override for Main.sublime-menu. There is no entry for Settings – User any longer, it is just Settings.

You could check the console to see if any errors are listed.

0 Likes