-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse Exception When Using Preprocessor Directives #3143
Comments
Hello, do all combinations of defines lead to valid code here? Are you interested in submitting a PR for this? |
I see what you mean in regards to all paths needing to be correct i.e. the #r "nuget: Expecto"
#if FABLE_COMPILER_PYTHON
open Fable.Pyxpecto
#endif
#if FABLE_COMPILER_JAVASCRIPT
open Fable.Mocha
#endif
#if !FABLE_COMPILER
open Expecto
[<Tests>] //needed for `dotnet test` to work
#endif
let allTests = testList "All Tests" []
[<EntryPoint>]
let main argv =
printfn "Running tests" // added for sanity
#if FABLE_COMPILER_PYTHON
Pyxpecto.runTests allTests
#endif
#if FABLE_COMPILER_JAVASCRIPT
Mocha.runTests allTests
#endif
#if !FABLE_COMPILER
Tests.runTestsWithCLIArgs [] argv allTests
#endif I did go through the exercise of refactoring where I would consider all paths as valid and ended up coming up with the below code. Changing some of the #r "nuget: Expecto"
#if FABLE_COMPILER_PYTHON
open Fable.Pyxpecto
#elif FABLE_COMPILER_JAVASCRIPT
open Fable.Mocha
#elif FABLE_COMPILER
#else
open Expecto
[<Tests>] //needed for `dotnet test` to work
#endif
let allTests = testList "All Tests" [ ]
[<EntryPoint>]
let main argv =
#if FABLE_COMPILER_PYTHON
Pyxpecto.runTests allTests
#elif FABLE_COMPILER_JAVASCRIPT
Mocha.runTests allTests
#elif FABLE_COMPILER
#else
Tests.runTestsWithCLIArgs [] argv allTests
#endif After running fantomas, I get the following:
Peeking through the code I think this may be the area to start looking in regards to supporting |
Well that would be why it doesn't work then 😅 |
Alright, anything actionable left for Fantomas here? |
Nope! I feel silly but happy I learned this about F#. I didn't know it had different directive support than C# |
Issue created from fantomas-online
Code
Error
Problem description
When working on a PR over in FsToolkit.ErrorHandling, I came across this parse exception. Here is the link to the actual code. We are currently working around this by utilizing the
.fantomasignore
file.Extra information
Options
Fantomas main branch at Dec 17, 2024
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.
The text was updated successfully, but these errors were encountered: