Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Preprocessing directives in namespace definitions not handled correctly #59

Open
mawett opened this issue Jul 22, 2019 · 3 comments
Open

Comments

@mawett
Copy link

mawett commented Jul 22, 2019

#endif is always missing in generated stubs, when the interface has namespace definition with preprocessor directives.
Example:

namespace myProject.sublibrary
{
    using System;
    using System.Collections.Generic;
    using System.IO;
#if WinIoT
    using System.Threading.Tasks;
#else
    using myProject.ThreadingLib
#endif

In this case the generated stubs contain the #if statement, but no #else or #endif and therefore no build is possible.

@nehmebilal
Copy link
Collaborator

nehmebilal commented Sep 5, 2019

Sounds like a bug. I don't think preprocessor definitions are not handled at all (see here for how usings are being carried over to stubs). We would need to explicitly handle preprocessor definitions.

Please take a look at developers documentation for how to get started and it shouldn't be too hard to add handling for preprocessor definitions. I am happy to answer any questions.

@mawett
Copy link
Author

mawett commented Sep 9, 2019

Ok, thanks for the hint where to start. I will take a look. However, it might take some time until I get around to it. Additionally, I have not yet worked with the Roslyn Code Analysers, so I'll have to look into that as well. I'll get back to you if I have any concrete questions.

@nehmebilal
Copy link
Collaborator

Sounds good @mawett. It's a bit tricky because preprocessor definitions can be around anything, not just usings, and they are not being handled at the moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants