Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ddaba3

Browse files
revert matching braces logic in FSharpEditorFormattingService
1 parent987850b commit5ddaba3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ type internal FSharpEditorFormattingService
4949
x.Tag<> FSharpTokenTag.COMMENT&&
5050
x.Tag<> FSharpTokenTag.LINE_COMMENT)
5151

52-
let!(left,right)=
53-
FSharpBraceMatchingService.GetBraceMatchingResult(checker, sourceText, filePath, parsingOptions, position,"FormattingService")
52+
let!matchedBraces= checker.MatchBraces(filePath, sourceText.ToString(), parsingOptions,"FormattingService")|> liftAsync
53+
54+
letisPositionInRange range=
55+
match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, range)with
56+
| None->false
57+
| Some span->
58+
letlength= position- span.Start
59+
length>=0&& length<= span.Length
60+
61+
let!left,right= matchedBraces|> Array.tryFind(fun(left,right)-> isPositionInRange left|| isPositionInRange right)
5462

5563
if right.StartColumn= firstMeaningfulToken.LeftColumnthen
5664
// Replace the indentation on this line with the indentation of the left bracket

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp