Skip to content
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

FSharpSynchronousIndentationService is, well, UI synchronous #10156

Closed
dsyme opened this issue Sep 19, 2020 · 2 comments
Closed

FSharpSynchronousIndentationService is, well, UI synchronous #10156

dsyme opened this issue Sep 19, 2020 · 2 comments
Labels
Area-LangService-API Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.

Comments

@dsyme
Copy link
Contributor

dsyme commented Sep 19, 2020

I'm debugging UI freeze ups when hitting "Return" in scripts and pasting into some scripts.

This is a devenv.exe UI callstack featuring "FSharpSynchronousIndentationService.GetIndentation" which is resulting in a synchronous reactor call

I'll look into fixing it

>	FSharp.Core.dll!Microsoft.FSharp.Control.AsyncPrimitives.ResultCell<Microsoft.FSharp.Control.AsyncResult<Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FSharpIndentationResult?>>.TryWaitForResultSynchronously(Microsoft.FSharp.Core.FSharpOption<int> timeout) Line 792	F#
 	FSharp.Core.dll!Microsoft.FSharp.Control.FSharpAsync.RunSynchronously<Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FSharpIndentationResult?>(Microsoft.FSharp.Control.FSharpAsync<Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FSharpIndentationResult?> computation, Microsoft.FSharp.Core.FSharpOption<int> timeout, Microsoft.FSharp.Core.FSharpOption<System.Threading.CancellationToken> cancellationToken) Line 1139	F#
 	Microsoft.CodeAnalysis.ExternalAccess.FSharp.dll!Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.Editor.FSharpSynchronousIndentationService.GetIndentation(Microsoft.CodeAnalysis.Document document, int lineNumber, Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentStyle indentStyle, System.Threading.CancellationToken cancellationToken)	Unknown
 	Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Indentation.IIndentationServiceExtensions.GetIndentation(Microsoft.CodeAnalysis.Indentation.IIndentationService service, Microsoft.CodeAnalysis.Document document, int lineNumber, System.Threading.CancellationToken cancellationToken)	Unknown
 	Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.SmartIndent.SmartIndent.GetDesiredIndentation(Microsoft.VisualStudio.Text.ITextSnapshotLine lineToBeIndented, System.Threading.CancellationToken cancellationToken)	Unknown
 	Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.SmartIndent.SmartIndent.GetDesiredIndentation(Microsoft.VisualStudio.Text.ITextSnapshotLine line)	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Text.Editor.Implementation.SmartIndentationService.GetDesiredIndentation(Microsoft.VisualStudio.Text.Editor.ITextView textView, Microsoft.VisualStudio.Text.ITextSnapshotLine line)	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Text.Operations.Implementation.EditorOperations.PositionCaretWithSmartIndent(Microsoft.VisualStudio.Text.ISelectionTransformer transformer, bool useOnlyVirtualSpace, bool extendSelection)	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Text.Operations.Implementation.EditorOperations.InsertNewLine.AnonymousMethod__1(Microsoft.VisualStudio.Text.ISelectionTransformer transformer)	Unknown
@dsyme
Copy link
Contributor Author

dsyme commented Sep 19, 2020

This is fixed in #10159 (the operation is still synchronous, but doesn't invoke the reactor thread)

@dsyme dsyme added Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. Area-LangService-API labels Sep 19, 2020
@cartermp cartermp linked a pull request Sep 19, 2020 that will close this issue
@cartermp cartermp removed a link to a pull request Sep 19, 2020
@cartermp
Copy link
Contributor

Will close this out as a part of #10159 even though the synchronous nature of this isn't changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-API Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.
Projects
None yet
Development

No branches or pull requests

2 participants