sio / LibPQ

Detach your M code from workbooks to reuse it! Import modules from local or web storage (unlimited number of sources)
Apache License 2.0
76 stars 21 forks source link

LibPQ disabling Power Query intellisense? #20

Open sio opened 4 years ago

sio commented 4 years ago

Originally posted by @B-D-T in https://github.com/sio/LibPQ/issues/12#issuecomment-577722197

I apologize if I'm missing something, but it appears that adding LibPQ breaks the Power Query intellisense. In Excel workbooks where I don't have LibPQ/LibPQPath, I get the intellisense function list, arguments, etc. But for those where I've integrated LibPQ, the intellisense only reads objects that were defined within the existing module.

Almost all my work is done directly in M in the Advanced Editor. Having intellisense makes that process easier, but now that I've discovered the wonderful LibPQ, I don't want to give that up either! Any suggestions?

sio commented 4 years ago

I was not aware of Intellisense being added to Power Query since I didn't purchase newer MS Excel versions.

It seems reasonable that it would not generate any autocompletion for objects provided by LibPQ because of how the loader is implemented (Expression.Evaluate with inputs decided at runtime is a hard, almost impossible target for static analysis). But if autocompletion fails for all objects in a workbook where LibPQ is loaded, that's certainly a bug with Intellisense implementation that only Excel development team can fix.

Can you provide some specific examples (possibly with xlsx files and screenshots) of where autocompletion fails/succeeds? Would autocompletion work if you'd wrap LibPQ imports into dummy local definitions consisting only of LibPQ("ModuleName") calls?

B-D-T commented 4 years ago

Here are dummy files & screenshots. In these files, I'm not referencing any LibPQ functions. You can see that simply adding LibPQ.pq and LibPQPath.pq caused the Intellisense to not appear.

File without LibPQ

Excel sample file: FileWithoutLibPQ.xlsx

Intellisense as it is supposed to look

FileWithoutLibPQ-HasIntellisense

File with LibPQ

Excel sample file: FileWithLibPQ.xlsx

Same image as above, but no intellisense

FileWithLibPQ-NoIntellisense

Intellisense appears for functions in current module

In these screenshots, you can see how functions used within that module do appear, but I still do not get the full catalog or the metadata that comes with the usual intellisense.

Example 1

FileWithLibPQ-IntellisenseJustForCurrent1

Example 2

FileWithLibPQ-IntellisenseJustForCurrent2