martonsagi / al-object-designer

AL Object Designer for Dynamics 365 Business Central development
MIT License
39 stars 21 forks source link

Stays in "Discovering Objects" forever #15

Closed Bleika closed 5 years ago

Bleika commented 5 years ago

First of all - thank you - I think this is a great extension to VS Code!

When I first installed it (+/- 2 weeks ago) the objects showed up as expected.

This morning I was trying to run it but it doesn't get past "Discovering Objects". I hadn't changed anything in my environment and other extensions (like AL Code Outline) are working fine. I Downloaded Symbols and Published my extension again and then tried again, but it still stays in "Discovering Objects"

Now I've just updated VSCode to 1.30.2 and checked again. "AL Code Outline" works but I'm still stuck with the "AL Object Designer". I've even uninstalled it and installed/reloaded and the same thing happens... The only thing that seems to work is the "New Object" button: it opens a new "Untitled" editor.

Have you come across this issue?

martonsagi commented 5 years ago

I have received reports about this kind of issue, but I was unable to reproduce it on my local machine nor on a clean virtual machine. My guess is that in certain cases the Symbol files may have additional content that remains unhandled. I would appreciate if you could create a demo AL project that shows the same symptoms and can be shared publicly.

Please tell me about your environment:

Some tips:

Thanks!

Bleika commented 5 years ago

Thanks Marton,

I'm developing for Business Central OnPrem, currently against build 25940 (ES) in a Docker container). Both host and container are on Windows Server 2016. VSCode version: 1.30.2 (but it also failed before I upgraded from the previous version).

I did several tests and discovered that the problem only occurred in my current project. I tried to clean .alcache and download symbols again, but it still didn't work. All my projects use identical launch.json and app.json is practically the same for all.

The only thing special about the current project (as compared to the others) is that it only contains Table Extensions, Page Extensions and Subscriber Codeunits - that is: there are no extra tables nor pages. Current content is all correct (that is: compiles and published). I thought that might be the reason so I created a small project only with object extensions, but Object Designer worked fine...

Finally I've discovered the reason: Although it doesn't bother BC/VS Code, Object Designer doesn't allow for empty .al files within the project.

As this project only extends existing objects and is quite complex, I had already created blank .al files for all the table extensions I had identified as necessary. Then I've been working against these files, adding code to my project.

It turns out I still had a couple of these empty .al files, but as soon as I defined their skeletons (just what the "tte" and "tpe" snippets provide for), Object Designer finally completed discovering the objects and now works fine! :-)

Renaming the blank files also solves it: if someone is using the same methodology as I have in this particular project, leaving the files temporarily with a .txt extension until they're developed, lets Object Designer skip them and thus avoids this problem.

martonsagi commented 5 years ago

Thank you Eyrún, your feedback is a tremendous help! I had been hunting this bug for weeks and now I was able to fix it in a matter of minutes.

I think Object Designer should handle empty AL files properly, so you will not have to live with above workaround for long,

Would you test a new build I created having the fix: version 0.0.6-alpha.4?

Thanks in advance!

Bleika commented 5 years ago

Glad to be of help :-) I've just tested the alpha, creating more blank .al files in my project, and it didn't bother your Object Designer at all - keep up the good work!

martonsagi commented 5 years ago

Thank you! :) This is an important fix, I will prepare a new release soon to publish it for everyone.

martinhocosta88 commented 5 years ago

Thanks both.. it just helped me. keep with your good work

pdwgithub commented 5 years ago

Unfortunately today (Apr 23, 2019) I'm getting the same issue "Discovering Objects" forever after apx. 4 months using of Object Designer. I uninstalled the extension and install again but nothing changed. I have installed AL Object Designer 0.0.5.

aptMattKoe commented 4 years ago

Did you use InternalEvents? https://github.com/martonsagi/al-object-designer/issues/55