This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 172508 - Code completion is slow when having multiple gems in different versions
Summary: Code completion is slow when having multiple gems in different versions
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Rails (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-17 18:00 UTC by ehartmann
Modified: 2009-09-21 15:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehartmann 2009-09-17 18:00:55 UTC
Code completion is slow with a big gem repository. But I freezed my gems so, the code completion should not use the
whole repository but only the gems I've freezed.

So BootClassPathImpletation.java can improve the speed of completion by removing all the gems from the "classpath" if
vendor/gems is present.

Here is a small patch :

@@ -180,6 +180,10 @@
                 Exceptions.printStackTrace(pse);
             }
 
+            if ((new File(projectDirectory, "vendor" + File.separator + "gems")).exists()) {
+                gemUrls = new HashMap<String, URL>();
+		gemVersions = new HashMap<String, String>();
+	    }
             gemUrls = adjustGemsForExplicitVersion(gemUrls);
 
             // Add in all the vendor/ paths, if any
Comment 1 Erno Mononen 2009-09-17 19:22:40 UTC
That's a good idea - thanks a lot for the patch.
Comment 2 Erno Mononen 2009-09-18 10:35:30 UTC
Fixed in 67e6243a6f69 - I made it an option though, it is in Tools -> Misc -> Ruby -> Rails Projects. It is now off by 
default, but probably will make it be turned on by default before FCS, just need to think a bit how to handle all the 
possible cases (e.g. gems in vendor/gems, but no rails in vendor/rails, even if it might not be a common case). 

Let me know how this works for you.
Comment 3 Quality Engineering 2009-09-19 10:53:42 UTC
Integrated into 'main-golden', will be available in build *200909190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/67e6243a6f69
User: Erno Mononen <emononen@netbeans.org>
Log: #172508: Code completion is slow when having multiple gems in different versions
Comment 4 ehartmann 2009-09-21 15:15:57 UTC
That's ok for me thanks for the quick integration !