-
Notifications
You must be signed in to change notification settings - Fork 786
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
visualstudio open namespace codefix has wrong indentation in some cases #10521
Comments
Another case: [<AutoOpen>] // will insert after the attribute
module Foo2 =
// would prefer here if "Always place open statements at the top level" is unchecked
let a () =
let t = Task.Factory.StartNew(fun () -> 1) // use the code fix on Task
() Currently Given the settings, I'd prefer |
@vzarytovskii/@cartermp do you know if there are tests for this code fix, is it easy to add one for each cases? |
This seems like a bug in the tryfindinsertioncontext routine here:
It's complicated code unfortunately. I'm not sure if it's under test. We have decent testing for the analysis part, but not the insertion part. |
Okay this still reproduces the "Always place open statements at the top level" off. |
Fixed partially as of now - the code fix doesn't break the code anymore but the location of the inserted code is still not precise. |
In indented context, the open namespace code fix puts the declaration at wrong indentation level.
It doesn't always affect the code, but when there are type extensions, it breaks it.
Related information
VS2019 16.8
The text was updated successfully, but these errors were encountered: