Home Download Buy Blog Forum Support

Display Functions (Java)

Re: Display Functions

Postby tiger2wander on Mon Jan 09, 2012 3:10 am

Awesome plugin. SL2 now more closed with an IDE :), love it and thanks!

It could better if have pre-loaded default packages, classes from *.jar libraries.
--
Best regard!
Uoc Nguyen
tiger2wander
 
Posts: 8
Joined: Mon Apr 18, 2011 10:27 am

Re: Display Functions (Java)

Postby accatyyc on Wed Mar 21, 2012 9:54 am

Hi! Is this plugin still being developed? I'm very interested in these functions, but I can't get it to work in the latest versions of ST2. I suspect its the new autocomplete functionality in ST2 that breaks it. Anyone know how I can fix it?
accatyyc
 
Posts: 1
Joined: Wed Mar 21, 2012 9:52 am

Re: Display Functions (Java)

Postby C0D312 on Wed Mar 21, 2012 8:48 pm

accatyyc wrote:Hi! Is this plugin still being developed? I'm very interested in these functions, but I can't get it to work in the latest versions of ST2. I suspect its the new autocomplete functionality in ST2 that breaks it. Anyone know how I can fix it?


Sorry, I kinda lost track of maintaining this plugin for the past few updates. I'll push a fix in a bit though. Thanks for the heads up.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Display Functions (Java)

Postby C0D312 on Wed Mar 21, 2012 11:00 pm

Should be fixed now. Let me know. If the functions aren't popping up right away, though, press control+space.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Display Functions (Java)

Postby snowe2010 on Thu Jun 28, 2012 8:15 am

I've been using your plugin, but it isn't putting the parameters into the function like it is supposed to. I've been looking through the code and I can't figure out how you're adding the parameters. Could you care to explain how your plugin is working?
snowe2010
 
Posts: 9
Joined: Thu Jun 28, 2012 8:00 am

Re: Display Functions (Java)

Postby snowe2010 on Thu Jun 28, 2012 12:08 pm

Well your plugin works fine for adding the parameters, but not when writing test classes. So I have a project set up with main and test packages and if I'm writing in the test class and I put a period, it says

Code: Select all
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 362, in run_
  File ".\displayfunctions.py", line 34, in run
  File ".\displayfunctions.py", line 91, in get_obj_type
  File ".\displayfunctions.py", line 73, in get_return_type
IOError: [Errno 2] No such file or directory: u'C:\\workspace\\testing\\src\\main\\java\\com\\thing\\thing2\\thing3\\String.java'


I subbed String in there for a real class name, but it happens no matter what.

I actually forgot to submit this comment, and now after about 3 hours I have figured out how to make this work while writing in test classes too. I don't know how to make changes to stuff on github, so here you go, I added several lines to the make_filename function and I added another function to iterate through the folders.

Code: Select all
def make_filename(self, classname):
        this_file = self.view.file_name()

        dir_len = this_file.rfind('/')  # (for OSX)

        if not dir_len > 0:
            dir_len = this_file.rfind('\\')  # (for Windows)

        this_dir = this_file[:(dir_len + 1)]  # + 1 for the '/'

        this_dir = re.sub(r"\\test.*", r"\\main", this_dir) #added this to move back to main directory
             
        for i in self.locate(classname + ".java", this_dir): #added this to find the class in the directory
            this_dir = i
        return this_dir

    def locate(self, pattern, file_path):
        '''Locate all files matching supplied filename pattern in and below
        supplied root directory.'''
        for (path, dirs, files) in os.walk(file_path):
            for filename in fnmatch.filter(files, pattern):
                yield os.path.join(path, filename)
snowe2010
 
Posts: 9
Joined: Thu Jun 28, 2012 8:00 am

Re: Display Functions (Java)

Postby xubin on Mon Apr 29, 2013 7:31 am

what's Theme and Color scheme do you use? It looks wonderful and clearly!
xubin
 
Posts: 1
Joined: Mon Apr 29, 2013 7:27 am

Re: Display Functions (Java)

Postby C0D312 on Mon Apr 29, 2013 1:56 pm

My colorscheme (a modified version of IR_Black)
I don't remember what theme I was using in that screenshot. Currently I use Soda – Dark though.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 9 guests