DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Slows down intellisense #176

Closed jwikman closed 5 months ago

jwikman commented 5 months ago

Lately (a week or less I believe), when having AL Codeactions installed, the IntelliSense takes about 4 to 6 seconds to show up. If I disable AL Codeactions all is fast as usual.

I've tried different versions of AL Language extension and AZ AL Dev Tools, since I believe that they are causing this in combination with AL Codeactions - but with no luck! I just cannot put the finger on when this work fine and not...

Right now I'm using these versions, as I thought that they would work fine together - but no 😕 AZ AL Dev Tools/AL Code Outline: v14.0.956192 AL Language extension for Microsoft Dynamics 365 Business Central: v14.0.956192 AL CodeActions: v1.0.34 VSCode: v1.87.2

I've disabled your extension when I got too mad at the lagging, but pretty soon I discover all features I use in this extension and now is missing. 😅

DavidFeldhoff commented 5 months ago

Hey Johannes and thanks for letting me know. Another one mentioned something similar as well, but closed the issue again (#174). I'll try to have a look at it, but no promise (I did not come way too long already maintaining this extension). Let's see if I can find something out.

jwikman commented 5 months ago

Thanks David,

Just let me know if you got any idea on what I can test. I'm out of ideas.. 😕

DavidFeldhoff commented 5 months ago

Hey @jwikman, I just clicked a bit through it with and without the extension installed, even in a big app where I could've imagined that it comes to performance issues, but without any insights, so unfortunately I'm a bit in the dark. I checked if I am hooking into the intellisense provider and I do indeed, but there's just very basic processing, so that can't be it. Next to that I'm also injecting definition providers and reference providers as Microsofts AL language had some issues there (at least back in the days, maybe that's fixed already, but it was at least long time buggy). But also these providers can't be it as you're talking about slow intellisense and these providers are only executed on going to a definition or asking for references (Go to or Find all references). So I'd bet it comes from the code action providers, I assume. And a code action provider is by default executing every single cursor change. And there I already do the most of my processing as I don't want to offer code actions and then on selecting them it says "Naah, I did not check to much in the first place and now found out it's not possible". Until now that was never a problem. But maybe there has something changed. We could give it a try, by using the setting "editor.lightbulb.enabled": "off". I'd ask you to give that a chance. Then you don't have the lightbulb in your editor, so you do not directly see that there's a codeaction. But on the other hand all code action providers aren't executed on each cursor change until you explicitly ask for them (by Ctrl + .). So the code actions are still there, but they are executed much (!) less frequently.

Would be happy if you give me a sign if that helps, then at least we know what's the root cause (even if I don't know how I should fix it then in a good way :) ) and we would have a first workaround

jwikman commented 5 months ago

Thanks a tons for looking into this!

But now I'm getting even more confused by the behavior in my VSCode...

I opened VSCode, and another workspace (let's call it WS1) than the one I had this experience in and that I've worked on a lot lately (let's call it WS2). IntelliSense worked just fine. I opened WS2. I saw this behavior again, with slow IntelliSense. I set "editor.lightbulb.enabled": "off" and restarted IntelliSense is working as normal, good times! I set "editor.lightbulb.enabled": "on", which is the default value, and restarted IntelliSense is still working good in WS2 🤔

I also tried with different versions of AL Language and AZ AL DevTools with latest AL CodeActions - but now all is fine 😅 Maybe there is some other extension involved as well, and that AL CodeActions was just a victim of other issues - and that the causing extension has been autoupdated when I restarted VSCode. If that was the case, I don't think we'll ever get to know...

I think I'll close this issue for now. If behavior starts again, I will first try the editor.lightbulb.enabled setting and then report back here.

Thanks again for spending time on this! (My apologies if it was all due to my VSCode with too many extensions...)