JetBrains / ForTea

Apache License 2.0
56 stars 10 forks source link

Error reporting in T4 templates in Linq2Db #12

Closed ijsgaus closed 3 years ago

ijsgaus commented 4 years ago

This templates worked fine in Visual Studio, but produced errors in Rider IDE. Rider_T4_Linq2Db

ijsgaus commented 4 years ago

When Run in Rider produce error: [Error] Unresolved include: LinqToDB.Tools.ttinclude

kirillgla commented 4 years ago

Could you provide more details, please? How exactly was LinqToDB.Tools.ttinclude included when it produced the error?

kirillgla commented 4 years ago

As for MultipleFiles.ttinclude, that's a known issue, EnvDTE is indeed not supported yet. Please, feel free to upvote this issue: https://youtrack.jetbrains.com/issue/RIDER-35770

kirillgla commented 4 years ago

This functionality was indeed broken. Thank you for your report! The fix is now merged into the branch net193 and will be available in the next EAP of Rider

integral-llc commented 4 years ago

was this fixed? I have the latest Rider

JetBrains Rider 2020.1.3
Build #RD-201.7846.1, built on May 15, 2020

but the issue still persists.

kirillgla commented 4 years ago

I believe it was. Could you also tell me the version of the T4 plugin installed in your instance of Rider, please? It can be found in settings: image

integral-llc commented 4 years ago

I have this [cid:image001.png@01D63DA7.94803030]

Do I need to subscribe to EAP channel for Rider?

From: Kirill Glazyrin notifications@github.com Reply-To: JetBrains/ForTea reply@reply.github.com Date: Monday, June 8, 2020 at 12:46 PM To: JetBrains/ForTea ForTea@noreply.github.com Cc: Eugeniu Rata eugen.rata@gmail.com, Comment comment@noreply.github.com Subject: Re: [JetBrains/ForTea] Error reporting in T4 templates in Linq2Db (#12)

I believe it was. Could you also tell me the version of the T4 plugin installed in your instance of Rider, please? It can be found in settings: [image]https://user-images.githubusercontent.com/31822295/84073584-c832ef00-a9d9-11ea-873a-37fa33378d0b.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/JetBrains/ForTea/issues/12#issuecomment-640848723, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAOBPMJKHV4B2HWPUVSXIE3RVU5Y7ANCNFSM4JQVZCXA.

integral-llc commented 4 years ago

image here it is again.

kirillgla commented 4 years ago

Thank you for reporting that! We will investigate this issue

alejandrod commented 4 years ago

Same where! Plugin 2020.2.284

pavelvondrasek commented 3 years ago

still not working :( I'm using eap 2020.3

kirillgla commented 3 years ago

@integral-llc, @alejandrod and @pavelvondrasek, thanks for your reports! I've checked that the red code only appears in files that are not included into any of your T4 files. For instance, in this example Linq2DB.ttinclude is indirectly included into Template.tt and hence has no errors, while NotifyDataErrorInfo.ttinclude is not included into Template.ttinclude and hence contains the red code.

Is that the case in your projects, or do you experience red code in files that are included into T4 files that compile and run correctly?

image

pavelvondrasek commented 3 years ago

I'm not using T4 templates (and I don't know how it should work) but it was annoying for me that I only install my favourite database layer and see all red...

So that I cannot help you with answer I fixed it with removing linq2db.postgresql and added npgsql directly (how guys from linq2db recommended me) 😀

kirillgla commented 3 years ago

You saw all red after installing templates because linq2db includes are not self-sufficient. Some templates contain references to assemblies, other templates contain usages of symbols from these assemblies, so without a template that includes those ttincludes it is impossible to resolve symbols from them. I'll think about what we can do about that

picolino commented 3 years ago

Upvote for it. It is pain to see red errors across the project tree because of not self-sufficiency linq2db.

I found a workaround to remove the red hell from your projects. You can disable code analysis of *.ttinclude files in Rider: image

You can use it until that issue will be resolved. If it will be resolved, of course

kirillgla commented 3 years ago

Thank you everyone for your patience! Unfortunately, due to the way those templates are written, there isn't much we can do about it on Rider side. This problem has to be solved on linq2db side. I created an issue there, so please feel free to upvote that