Home Download Buy Blog Forum Support

Sublime Text 3 Beta

Re: Sublime Text 3 Beta

Postby quarnster on Tue Jan 29, 2013 9:24 am

Any particular reason this is None?
Code: Select all
import sublime
print(sublime.active_window().active_view())
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Sublime Text 3 Beta

Postby asmodai on Tue Jan 29, 2013 9:24 am

jps wrote:
xeno.by wrote:@jps Is the new name for the app on OSX ("Sublime Text", without a version number) intentional? It's great that I can install the new beta side-by-side with ST2, but there's a small inconsistency in naming. Maybe "Sublime Text 3" would sound better? (Sure I can rename the installation folder, but still).

Yep, it's intentional: the version number is being emphasized less now. The whole "Sublime Text 2" came about from the original name, "Sublime Text X", which was the initial experimental cross platform version. From there, it made the most sense to just turn the X into a 2. Long term, it's better for the application to simply be "Sublime Text".

The upside of the version suffix is that, on Windows, when I right click a file I have clear version marked options to open the file in when I have two versions installed side by side. Granted, it is mostly an issue for us who are running a production version next to a beta.
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Sublime Text 3 Beta

Postby jps on Tue Jan 29, 2013 9:26 am

j0k wrote:Does Symbol Indexing works only for opened files? It seems that if I close a file, Goto Symbol in Project doesn't find any functions that are inside the closed file. Is there an option to enabled/not enabled?

It works across all open files, and all files listed in the side bar. It sounds like you need to add the relevant folder to the side bar, either by dragging the folder onto the window, or using the "Project/Add Folder to Project" menu.

j0k wrote:About the follow_symlinks option, where should I add it ? In the .sublime-project ? Like that:

Code: Select all
{
  "folders":
  [
    {
      "path": "/Z/myproject"
    }
  ],
  "follow_symlinks": true
}


follow_symlinks should be placed next to the "path" element, there's an example at http://www.sublimetext.com/docs/3/projects.html. Please be careful with this, and don't place a symlink such that your entire hdd gets indexed.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Sublime Text 3 Beta

Postby quarnster on Tue Jan 29, 2013 9:30 am

And also any reason this returns None?
Code: Select all
import sublime
s = sublime.load_settings("Test.sublime-settings")
print(s.get("test_value", -1))

Code: Select all
// Test.sublime-settings
{
    "test_value": 1
}
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Sublime Text 3 Beta

Postby jps on Tue Jan 29, 2013 9:32 am

quarnster wrote:Any particular reason this is None?
Code: Select all
import sublime
print(sublime.active_window().active_view())


I need to add this to the porting guide. The sublime module isn't generally available at the top level of a module, due to startup works:

1. Sublime Text starts up, restores the previous session
2. Sublime Text starts the plugin_host
3. Once the plugin_host has started and initialized Python, it tells sublime_text that it's ready
4. sublime_text tells the plugin_host which modules to load
5. plugin_host loads all the modules
6. plugin_host tells sublime_text that startup has finished. sublime_text will now start servicing the sublime_api module, which means the sublime module is only now available for use.

This is all done so that the application isn't blocked on plugins doing IO at startup.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Sublime Text 3 Beta

Postby quarnster on Tue Jan 29, 2013 9:35 am

Is there some "load_finished" event or similar so that we know it's now possible to use the sublime module?
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Sublime Text 3 Beta

Postby jboner on Tue Jan 29, 2013 9:37 am

jps wrote:The symbol indexing relies on the .tmLanguage file defining symbols. In general, if you see symbols via Goto Symbol (Ctrl+R / Command+R), then the same symbols should be getting indexed.
If the symbols are showing up in Goto Symbol, but aren't getting indexed, then a couple of preferences will need to be set in a .tmPreferences file. I'll happily explain what's required if this is what you're seeing.


Yeah. That is what is happening. The Goto Symbol works fine as usual, but Goto Definition returns: 'Unable to find X'
How can I make this work?

Thanks, Jonas.
jboner
 
Posts: 2
Joined: Tue Jan 29, 2013 9:33 am

Re: Sublime Text 3 Beta

Postby bizoo on Tue Jan 29, 2013 9:37 am

Congrats for this new release Jon, so far looks like a high quality build as ever.

For ST3 (Windows) after a quick look at the portable version:
- Overal speed look way better when comparing both portable version of ST.
- Goto Symbol speed is now up to view.find_by_selector speed, and even quicker compared to ST2.
- show_quick_panel has a new on_highlight callback ! Yeah !!! thanks Jon.
- Still no way to know what's modified on the on_modified event... :(
- Looks like plugin are loaded in a logical order now (first Default, next builtins followed by user installed and User at last)
- Still no way to add custom information in the status bar (like indentation and syntax) ?

Need to port all my plugins now :)
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Sublime Text 3 Beta

Postby lyubenblagoev on Tue Jan 29, 2013 9:50 am

JSP, I'm a bit disappointed for the short life-cycle of Sublime Text 2. I bought a licence for it when it was at the latest beta stages after I used it for a while. But I'm not willing to pay a licence every few months or every year. Giving access to 3 beta is good thing, but after going through the list of improvements some of them make more sense as a minor updates to the second version. Improved start-up time for example. Performance improvements are something users are expecting as fixes and updates. New functionality, major improvements of the architecture, internal structure or other major components of the software are valid reasons for releasing new major version of our products, not performance updates. No one knows how long will this beta stage continue, and how long we will receive "updates" for it.

I'm looking forward to read your thoughts and plans for the future Sublime Text.
lyubenblagoev
 
Posts: 4
Joined: Tue Jan 29, 2013 9:16 am

Re: Sublime Text 3 Beta

Postby jps on Tue Jan 29, 2013 9:55 am

jboner wrote:Yeah. That is what is happening. The Goto Symbol works fine as usual, but Goto Definition returns: 'Unable to find X'
How can I make this work?


Firstly, you can see what symbols will be indexed for the current file via entering this in the console:

Code: Select all
view.indexed_symbols()


You can also do view.symbols() to see what will be shown in the regular symbol view.

Indexed symbols are controlled by the showInIndexedSymbolList preference, which is defined in .tmPreferences files. Most syntax definitions are covered by the contents of Default/Symbols.tmPreferences, but the scala syntax definition appears to assign scope names differently.

In short, you need to edit "Packages/Scala/Symbols.tmPreferences" and change it to:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>entity.name.function.declaration, entity.name.class.declaration, entity.name.val.declaration, entity.name.type.declaration</string>
   <key>settings</key>
   <dict>
      <key>showInSymbolList</key>
      <integer>1</integer>
      <key>showInIndexedSymbolList</key>
      <integer>1</integer>
   </dict>
   <key>uuid</key>
   <string>31262BFB-520A-4253-A81C-60023C0CFC8B</string>
</dict>
</plist>


The changed lines above are just adding the value for showInIndexedSymbolList. I'll make this change for the next build, but you can make it locally in the mean time. You'll need to save the above contents into the Packages/Scala/Symbols.tmPreferences file. This will then override the version that's stored in Scala.sublime-package.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 22 guests