提交 d66f023d 编写于 作者: V Vasily Kirichenko 提交者: Kevin Ransom (msft)

Add support for "collapse to definition" (#2810)

* add support for "collapse to definition"

* separate match cases with a blank line
上级 a1126d49
......@@ -66,6 +66,56 @@ module internal BlockStructure =
| Scope.Comment
| Scope.XmlDocComment -> BlockTypes.Comment
let isAutoCollapsible = function
| Scope.New
| Scope.Attribute
| Scope.Member
| Scope.LetOrUse
| Scope.EnumCase
| Scope.UnionCase
| Scope.SpecialFunc
| Scope.HashDirective
| Scope.Comment
| Scope.Open
| Scope.XmlDocComment -> true
| Scope.Namespace
| Scope.Module
| Scope.Record
| Scope.Interface
| Scope.TypeExtension
| Scope.RecordDefn
| Scope.CompExpr
| Scope.ObjExpr
| Scope.UnionDefn
| Scope.Type
| Scope.RecordField
| Scope.Match
| Scope.MatchClause
| Scope.MatchLambda
| Scope.ThenInIfThenElse
| Scope.ElseInIfThenElse
| Scope.TryWith
| Scope.TryInTryWith
| Scope.WithInTryWith
| Scope.TryFinally
| Scope.TryInTryFinally
| Scope.FinallyInTryFinally
| Scope.IfThenElse
| Scope.Tuple
| Scope.ArrayOrList
| Scope.CompExprInternal
| Scope.Quote
| Scope.Lambda
| Scope.LetOrUseBang
| Scope.Val
| Scope.YieldOrReturn
| Scope.YieldOrReturnBang
| Scope.TryWith
| Scope.Do
| Scope.While
| Scope.For -> false
let createBlockSpans (sourceText:SourceText) (parsedInput:Ast.ParsedInput) =
let linetext = sourceText.Lines |> Seq.map (fun x -> x.ToString()) |> Seq.toArray
......@@ -84,7 +134,7 @@ module internal BlockStructure =
| Some span -> sourceText.GetSubText(span).ToString()+"..."
| None -> "..."
Some <| (BlockSpan(scopeToBlockType scopeRange.Scope, true, textSpan,hintSpan,bannerText):BlockSpan)
Some (BlockSpan(scopeToBlockType scopeRange.Scope, true, textSpan, hintSpan, bannerText, autoCollapse = isAutoCollapsible scopeRange.Scope))
| _, _ -> None
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册