Autocomplete for objects and fields stop working when loading project or building OST anew

Issue #75 resolved
Matej Pinter created an issue

Today I have opened one project from few days ago and I retrieved metadata and built new OST (full option). After operation was complete, I tried to write some select statements and code, but I get no autocomplete help from IDEA or plugin, only SObjectName_History.

Comments (45)

  1. Scott Wells repo owner

    Can you try rebuilding indices and see if that resolves it? You go into Settings>Illuminated Cloud (connectionName) and click "Rebuild" beside "Caches and Indices". It'll prompt you to restart IDEA. Go ahead and do that to be sure that indices are rebuilt properly. Let me know if that doesn't take care of it.

  2. Matej Pinter reporter

    No it doesn't work. It says to restart IDEA, I click yes and then nothing happens. I manually close it and reopen but nothing is rebuilt and autocomplete still doesn't work.

  3. Scott Wells repo owner

    Okay. Please try one more thing. First, make sure there aren't any running idea.exe or idea64.exe processes. Then open IDEA and use "File>Invalidate Caches and Restart..." Choose "Invalidate and Restart". Once IDEA restarts and indices finish building, see if that addresses it.

  4. Scott Wells repo owner

    Yeah, that's definitely odd. A few more things to check:

    1. Was the OST actually generated properly? Can you see it and the files you'd expect to find there in the project root?
    2. Was a library created for the OST? Look in Project Settings under Libraries and see if there's an entry called "Illuminated Cloud (connectionName)" with both Classes and Sources mapped to the OST root directory.
    3. Was the library configured as a dependency of your module? Again under Project Settings, look under Modules and then under your module click the Dependencies tab. So you see "Illuminated Cloud (connectionName)" as a dependency there?

    If all of those check out okay, I'll need you to send me your idea.log so I can see what else might be going on. Thanks!

  5. Scott Wells repo owner

    Matej, is this also "resolved" (quoted because I hate that you had to recreate the project) now?

  6. Scott Wells repo owner

    Matej, I'm going to resolve this since I haven't heard back. If this is still happening please reopen with additional details.

  7. Matej Pinter reporter

    Hi,

    after switch to new OST I have discovered that OST isn't always working correctly. When I create a project or open it it works normal for some time or until I open additional project in new window (in IDEA). After that almost always autocomplete stops working and only solution for that it is to go into project folder and delete OST.zip file, force-quit IDEA and then reopen project ant rebuild OST anew.

    It is getting very frustrating as this usually stops working in the middle of the work and I have to sometimes wait up to 5 minutes for OST to rebuild. (yes big orgs have lots of objects and fields). :)

    If you need any additional info, please write and I will try to help you out.

    On addtional (so I don't open new ticket) I have a question about licence. I'm currently using my own licence on my work laptop, but sometimes I work at home as well and this forces me to constantly deactivate/activate licence. Is it possible to make licence usable on 2 computers?

  8. Scott Wells repo owner

    Thanks for the feedback, Matej. I've noticed this a few times after regenerating the OST and generally closing and reopening the project (even without restarting IntelliJ) resolves the issue, so I haven't prioritized it higher, but the behavior you describe sounds much more onerous. Something is definitely being retained that shouldn't be. Let me play with this is a bit and see if I can reproduce the same behavior you're seeing so that I can get to the root cause of it.

  9. Matej Pinter reporter

    Today it stopped working again and reopening and restarting IDEA didn't help. Only solution is still to go and delete OST zip file, restart IDEA and generate it again. Even Autocomplete for SF API stops working. For example String.isBlank gives no help or completions.

  10. Matej Pinter reporter

    Is there any update on this? OST constantly stops working, I even have to build it everyday I start IDEA. Is it possible that zip file get corrupted on OS X? Scott, if you need any log, please tell me when to save it and which part.

  11. Matej Pinter reporter

    Ok just tried closing and reopening project - this doesn't work. At first it seems ok, but after 3-4 autocompletes half of it doesn't work or suggest anything. Problem is even getting SObject name from OST. Then I tried to rebuild OST, and nothing changed. After that only one solution -> go into project folder, delete zip. Close IDEA, reopen it and rebuild OST.

  12. Scott Wells repo owner

    Thanks for following up, Matej. Yeah, the log would definitely be helpful if you don't mind sending it. You can email it to me if you'd prefer. As for the OST potentially becoming corrupt, I guess it's possible. Can you send me the OST archive file when things are in this state so that I can look at it? Again, sending it via email is probably the best option, especially if it might contain sensitive info.

  13. Matej Pinter reporter

    Today I opened IDEA and OST not working from the start. First I opened one project and after that I opened another (just needed to fix few lines of code). When I returned to first project auto-complete stopped working. Also code coloring stops working and that way I see right away that something is not working correctly. I will email you log and zip file and just delete as much sensitive data as possible. Email will arrive shortly.

  14. Daniel Stefan

    Hi Scott,

    i currently evaluating your Plugin for my Team and encountered a similiar Problem. On Project Creation everything seems OK and works as expected. As soon as I restart the IDE or switch the Project, code completion / Gotos for every custom object is broken (standard objects seems to be ok). Only thing which works is for the Datatype on variable declaration:

    customObjectType (codecompletion works) varname = new customObjectType (not working anymore)();

    I also tried the rebuild index function and regeneration of the OST but like Matej it only works if i delete the old one, restart/rebuild. But after a new switch/restart everything is broken again. I tried it with my DevOrg Project but there everything seems to be Ok (just started the evaluation a few Days ago - not really worked within my DevOrg and Illuminated Cloud so far).

    You will find logs attached (with completion tries for object Relation__c).

    Full routin folder: Project Creation, Autocompletion (OK), restart, Autocompletion broken, rebuild Illuminated Cloud Index, restart, Autocompletion broken, Intellij cache/indicies clear, restart, Autocompletion broken, rebuild OST, restart, Autocompletion broken

    Debug folder: I add additional debug settings you mentioned in issue120, rebuild OST, restart and tried again some code completion / goto class

    Hope you can guide me to a working environment again (would be bad for my presentation as i like your plugin so far ;) )

    IntelliJ Version is 15.0.3, and plugin 1.6.8.9.

    Best Regards

  15. Scott Wells repo owner

    Thanks for the logs, Daniel. As odd as it may sound, I'm glad to hear of more than one person seeing this behavior as it should make it easier to corner and resolve! Hopefully between what you and Matej have provided, I'll be able to get to the bottom of this. Let me take a close look and see what I can find. I'll you both posted as I make progress and let you know if I need anything further from you.

    Regarding your last statement, are you in a broken state now without the ability to recover?

  16. Daniel Stefan

    Hi Scott,

    sounds good!

    My last point was related to the code completion functionality. I can work normally (only with more Copy & Paste if i need attributes etc. from my custom objects or inner classes ;) ). I will try other projects in the next days to see if its a general problem or project specific (as like I said my DevOrg seems to be Ok).

    Best Regards

  17. Scott Wells repo owner

    Yeah, I spent a TON of time on code completion for Apex and Visualforce, so I definitely don't want you to have to do copy/paste for things that should be completing properly. Can you try to rebuild all caches/indices using File>Invalidate Caches / Restart... to see if that gets things into a good state for you while I investigate the overall issue that you and Matej are seeing?

  18. Daniel Stefan

    Hi Scott,

    i agree that your code completion functionality looks very promising (and will be advertised in my presentation too)! I tried your suggestion but it seems the code completion don`t like my custom objects ;)

    Best Regards

  19. Scott Wells repo owner

    Okay. Let me see what I can find and I'll keep you posted. I definitely apologize for the issue!

  20. Matej Pinter reporter

    I have found out one more thing: When creating project from scratch, I get warning in IDEA that OST zip is missing, but if I delete zip, and reopen IDEA, no warning is issued or fired. IDEA just loads project like nothing is wrong.

    P.S.: today I found out that I cannot get standard object mapping from QuoteLineItem to Product2 working. Even if I make project from scratch or delete zip and rebuild OST, this doesn't work. I only get auto-complete for Product2Id, but if I wish to use Product2.Name or and other Product2 fields it doesn't work at all. So here is only old copy& paste option :(

  21. Scott Wells repo owner

    Thanks, Matej. I'm wrapping up a fix for a deployment/retrieval issue now and then I'm going to tackle this. I hope to have a fix for you guys in the next few days if possible. As I mentioned to Daniel above, one of my primary goals in IC was/is robust code completion. When that doesn't work as intended, it's time to dive in deep and figure out what's going on! I know you've wrestled with this for a (frustrating) while, so rest assured that a fix will be coming soon.

  22. Scott Wells repo owner

    Okay, I've definitely determined that I'm retaining some cached information after it should be expired, and I suspect that's the root cause of these issues. Having debugged things like this before, my guess it that it'll take me a few days to get to the bottom of it. I'll keep you guys posted as I make progress.

  23. Scott Wells repo owner

    I'm making good progress on this. Still a bit more to do, but hopefully I'll be able to get something out to you guys in the next several days to see if it helps to resolve the issue.

  24. Scott Wells repo owner

    I also found some places where references were reaching across projects, in particular in the OSTs, which is very possibly (likely?) the root cause of this. I believe I've resolved those issues and will test the changes heavily. I hope to get a new build out with all of these fixes on Monday.

  25. Scott Wells repo owner

    I'm hoping that this is resolved by 1.6.9.2. I haven't been able to reproduce this exact behavior, but I did see invalid cross-project references that could have caused the OST for one project to be wedged in memory when switching projects and/or returning references into the wrong OST. I believe I've addressed those. I'm resolving this now, but if you see the same behavior feel free to re-open and I'll dig in again. I'm committed to fixing this, but without being able to reproduce it locally, it's pretty much differential diagnosis. Please let me know your findings!

  26. Daniel Stefan

    Hi Scott,

    thanks for your updates.

    Just want to let you know, that I updated the Plugin but unfortunately the issue still remains, although the workaround (delete OST, restart ide and rebuild OST) still works too. Thats a "pity" you can not reproduce it locally as things gets difficult this way ;).

    I also worked with two other orgs in the meanwhile but there everything seems fine so luckily it's not that kind of a big blocker it could possibly be.

    Best Regards

  27. Scott Wells repo owner
    • changed status to open

    Thanks for letting me know, Daniel. Do you have some kind of minimal reproducible test case that you might be able to provide? I do consider this pretty much a critical bug to fix even if it only seems to afflict a small number of users at this point, but obviously it's quite difficult to solve without having access to an environment where the problem is occurring. My guess is that if I had access to the problem, I could probably address it in a very short time.

  28. Daniel Stefan

    Hi Scott,

    I send you a mail. I hope that the error will occur on your machine too ;)

    Best Regards

  29. Scott Wells repo owner

    Saw that! Thanks so much! Hopefully this will lead me to the smoking gun and we can put a bow on this one. I'll post findings here as I have them.

  30. Scott Wells repo owner

    Good news! I'm pretty sure I'm reproducing it. Not only is completion not working properly, but it's also not creating navigation references. I should be able to debug this pretty quickly, I think. Thanks for providing the standalone test case!

  31. Scott Wells repo owner

    Better news! I've found and fixed the issue. Literally two lines of code... Basically this happens when you have a namespace with the same base name as a custom object, e.g., Relation (a system namespace) and Relation__c (a custom object name). IC has pretty extensive support for references with and without namespaces based on the location of the referenced and referencing identifiers, so it's always partitioning the namespace and namespace-relative names. In this case it was seeing Relation as the namespace and c as the namespace-relative name. Simple fix once I knew where to look!

    I'm going to do a little more testing to verify that I've addressed it broadly, but I'll try to get a build out tomorrow for you guys to try. It may be a test build attached here at first just to get some burn-in time and validation before rolling out a new build to everyone.

    Thanks again for the example!

  32. Scott Wells repo owner

    Test build with what I hope to be the final fix for this issue. You can install it by downloading the archive and then in IntelliJ IDEA using Settings>Plugins>Install Plugin From Disk. Let the IDE restart and hopefully things will work as expected/intended Please let me know!

  33. Daniel Stefan

    Hey Scott,

    yeah I can confirm that the issue is now fixed for me. Hopefully it will also works for Matej :) Thank you and keep up the good work!

    Best Regards

  34. Scott Wells repo owner

    That's great to hear, Daniel! Matej, I'm also hoping this addresses the issues you've been seeing for a while. When you get a chance, please let me know your own findings. I'll also be including this in the next official build so totally fine if you want to wait for that.

  35. Matej Pinter reporter

    Hey Scott,

    I have just tried your test version today and it seems it is working, but to be 100% we will see it in few days of use :) Thank you for your hard work, and lets hope this will be fixed now and you can focus on other stuff of improving this plugin even more.

  36. Scott Wells repo owner

    Thanks for the update, Matej. I'm going to resolve this issue once I release it broadly (assuming I haven't heard otherwise before then), but obviously if it recurs don't hesitate to let me know.

  37. Matej Pinter reporter

    Up to today I had no more issues with autocomplete, so I think you have fixed the problem. I have tested with multiple projects open and also mix with Java projects and everything still works as it should.

  38. Scott Wells repo owner

    Bummer...I honestly suspected this might not resolve it completely for you, Matej. The issue you've experienced sounded different from what Daniel was experiencing in terms of onset and duration. Do you mind sending me the log files from the past day or two along with an approximate time that the problem recurred? I'd like to see if there's some pattern in them that will help shed some light on what might be happening.

  39. Scott Wells repo owner

    Resolving since it looks like I resolved this issue. If you're still experiencing the problem, feel free to reopen and/or create a new issue with the exact behavior.

  40. Log in to comment