Merge branch 'release/dev17.7' into merges/main-to-release/dev17.7

This commit is contained in:
Kevin Ransom (msft) 2023-05-04 13:52:19 -07:00 коммит произвёл GitHub
Родитель 9f1afaa216 28d72829cd
Коммит 0f4ebc3a15
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 131 добавлений и 156 удалений

Просмотреть файл

@ -86,11 +86,11 @@ stages:
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.6') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.7') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
MirrorRepo: fsharp
MirrorBranch: release/dev17.6
MirrorBranch: release/dev17.7
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-FSHARP'
- template: /eng/common/templates/jobs/jobs.yml
@ -715,8 +715,8 @@ stages:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng/release/insert-into-vs.yml
parameters:
componentBranchName: refs/heads/release/dev17.6
insertTargetBranch: rel/d17.6
componentBranchName: refs/heads/release/dev17.7
insertTargetBranch: main
insertTeamEmail: fsharpteam@microsoft.com
insertTeamName: 'F#'
completeInsertion: 'auto'

Просмотреть файл

@ -15,7 +15,7 @@
<!-- F# Version components -->
<FSMajorVersion>7</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>300</FSBuildVersion>
<FSBuildVersion>400</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
@ -57,7 +57,7 @@
</PropertyGroup>
<PropertyGroup>
<VSMajorVersion>17</VSMajorVersion>
<VSMinorVersion>6</VSMinorVersion>
<VSMinorVersion>7</VSMinorVersion>
<VSGeneralVersion>$(VSMajorVersion).0</VSGeneralVersion>
<VSAssemblyVersionPrefix>$(VSMajorVersion).$(VSMinorVersion).0</VSAssemblyVersionPrefix>
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>

Просмотреть файл

@ -55,14 +55,13 @@ module internal QuickInfoViewProvider =
| TaggedText (TextTag.LineBreak, _) -> Some()
| _ -> None
let wrapContent (elements: obj list) =
ContainerElement(ContainerElementStyle.Wrapped, elements |> Seq.map box)
let wrapContent (elements: obj seq) =
ContainerElement(ContainerElementStyle.Wrapped, elements)
let stackContent (elements: obj list) =
ContainerElement(ContainerElementStyle.Stacked, elements |> Seq.map box)
let stackContent (elements: obj seq) =
ContainerElement(ContainerElementStyle.Stacked, elements)
let encloseRuns runs =
ClassifiedTextElement(runs |> List.rev) |> box
let encloseRuns runs : obj = ClassifiedTextElement(runs |> List.rev)
let provideContent
(
@ -78,8 +77,8 @@ module internal QuickInfoViewProvider =
match (text: TaggedText list) with
| [] when runs |> List.isEmpty -> stackContent (stack |> List.rev)
| [] -> stackContent (encloseRuns runs :: stack |> List.rev)
// smaller gap instead of huge double line break
| LineBreak :: rest when runs |> List.isEmpty -> loop rest [] (box (Separator false) :: stack)
// smaller paragraph spacing instead of huge double line break
| LineBreak :: rest when runs |> List.isEmpty -> loop rest [] (Paragraph :: stack)
| LineBreak :: rest -> loop rest [] (encloseRuns runs :: stack)
| :? NavigableTaggedText as item :: rest when navigation.IsTargetValid item.Range ->
let classificationTag = layoutTagToClassificationTag item.Tag
@ -93,17 +92,14 @@ module internal QuickInfoViewProvider =
let run = ClassifiedTextRun(layoutTagToClassificationTag item.Tag, item.Text)
loop rest (run :: runs) stack
loop text [] [] |> box
loop text [] []
let innerElement =
match imageId with
| Some imageId -> wrapContent [ stackContent [ ImageElement(imageId) ]; encloseText description ]
| None -> ContainerElement(ContainerElementStyle.Wrapped, encloseText description)
wrapContent [ stackContent [ innerElement; encloseText documentation ] ]
wrapContent [ stackContent [ innerElement; encloseText documentation ]; CustomLinkStyle ]
let stackWithSeparators elements =
elements
|> List.map box
|> List.intersperse (box (Separator true))
|> stackContent
elements |> List.map box |> List.intersperse Separator |> stackContent

Просмотреть файл

@ -7,83 +7,64 @@ open System.Windows
open System.Windows.Controls
open Microsoft.VisualStudio.Text.Adornments
open Microsoft.VisualStudio.Text.Editor
open Microsoft.VisualStudio.Utilities
open Microsoft.VisualStudio.FSharp.Editor
open Microsoft.VisualStudio.Text.Classification
open Microsoft.VisualStudio.FSharp
type Separator =
| Separator of visible: bool
// preserve old behavior on mac
type internal FSharpStyle =
| Separator
| Paragraph
| CustomLinkStyle
// Render as strings for cross platform look.
override this.ToString() =
match this with
| Separator true -> XmlDocumentation.separatorText
| _ -> System.Environment.NewLine
| Separator -> Editor.XmlDocumentation.separatorText
| Paragraph -> System.Environment.NewLine
| CustomLinkStyle -> ""
// Provide nicer look for the QuickInfo on Windows.
[<Export(typeof<IViewElementFactory>)>]
[<Name("ClassifiedTextElement to UIElement")>]
[<TypeConversion(typeof<ClassifiedTextElement>, typeof<UIElement>)>]
type WpfClassifiedTextElementFactory [<ImportingConstructor>]
(
classificationformatMapService: IClassificationFormatMapService,
classificationTypeRegistry: IClassificationTypeRegistryService,
settings: EditorOptions
) =
let resources = Microsoft.VisualStudio.FSharp.UIResources.NavStyles().Resources
let formatMap = classificationformatMapService.GetClassificationFormatMap("tooltip")
[<Name("FSharpStyle to UIElement")>]
[<TypeConversion(typeof<FSharpStyle>, typeof<UIElement>)>]
type internal WpfFSharpStyleFactory [<ImportingConstructor>] (settings: Editor.EditorOptions) =
let linkStyleUpdater () =
let key =
if settings.QuickInfo.DisplayLinks then
$"{settings.QuickInfo.UnderlineStyle.ToString().ToLower()}_underline"
else
"no_underline"
interface IViewElementFactory with
member _.CreateViewElement(_textView: ITextView, model: obj) =
match model with
| :? ClassifiedTextElement as text ->
let tb = TextBlock()
tb.FontSize <- formatMap.DefaultTextProperties.FontRenderingEmSize
tb.FontFamily <- formatMap.DefaultTextProperties.Typeface.FontFamily
tb.TextWrapping <- TextWrapping.Wrap
let style = UIResources.NavStyles().Resources[key] :?> Style
for run in text.Runs do
let ctype =
classificationTypeRegistry.GetClassificationType(run.ClassificationTypeName)
// Some assumptions are made here about the shape of QuickInfo visual tree rendered by VS.
// If some future VS update were to render QuickInfo with different WPF elements
// the links will still work, just without their custom styling.
let rec styleLinks (element: DependencyObject) =
match element with
| :? TextBlock as t ->
for run in t.Inlines do
if run :? Documents.Hyperlink then
run.Style <- style
| :? Panel as p ->
for e in p.Children do
styleLinks e
| _ -> ()
let props = formatMap.GetTextProperties(ctype)
let inl = Documents.Run(run.Text, Foreground = props.ForegroundBrush)
// Return an invisible FrameworkElement which will traverse it's siblings
// to find HyperLinks and update their style, when inserted into the visual tree.
{ new FrameworkElement() with
override this.OnVisualParentChanged _ = styleLinks this.Parent
}
match run.NavigationAction |> Option.ofObj with
| Some action ->
let link =
{ new Documents.Hyperlink(inl, ToolTip = run.Tooltip) with
override _.OnClick() = action.Invoke()
}
let key =
match settings.QuickInfo.UnderlineStyle with
| QuickInfoUnderlineStyle.Solid -> "solid_underline"
| QuickInfoUnderlineStyle.Dash -> "dash_underline"
| QuickInfoUnderlineStyle.Dot -> "dot_underline"
link.Style <- downcast resources[key]
link.Foreground <- props.ForegroundBrush
tb.Inlines.Add(link)
| _ -> tb.Inlines.Add(inl)
box tb :?> _
| _ ->
failwith
$"Invalid type conversion. Supported conversion is {typeof<ClassifiedTextElement>.Name} to {typeof<UIElement>.Name}."
[<Export(typeof<IViewElementFactory>)>]
[<Name("Separator to UIElement")>]
[<TypeConversion(typeof<Separator>, typeof<UIElement>)>]
type WpfSeparatorFactory() =
interface IViewElementFactory with
member _.CreateViewElement(_, model: obj) =
match model with
| :? Separator as Separator visible ->
if visible then
Controls.Separator(Opacity = 0.3, Margin = Thickness(0, 8, 0, 8))
else
Controls.Separator(Opacity = 0)
| :? FSharpStyle as fSharpStyle ->
match fSharpStyle with
| CustomLinkStyle -> linkStyleUpdater ()
| Separator -> Controls.Separator(Opacity = 0.3, Margin = Thickness(0, 8, 0, 8))
| Paragraph -> Controls.Separator(Opacity = 0)
|> box
:?> _
| _ -> failwith $"Invalid type conversion. Supported conversion is {typeof<Separator>.Name} to {typeof<UIElement>.Name}."
| _ -> failwith $"Invalid type conversion. Supported conversion is {typeof<FSharpStyle>.Name} to {typeof<UIElement>.Name}."

Просмотреть файл

@ -38,18 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">Vodítka struktury bloků;
Zobrazit pokyny pro strukturu kódu F#;
Osnova;
Zobrazit sbalitelné a sbalitelné uzly pro kód F#;
Vložené tipy;
Zobrazovat pomocné parametry vloženého typu (Preview);
Zobrazit pomocné parametry návratového typu (Preview);
Zobrazit vložené nápovědy k názvům parametrů (Preview); Pivo;
Živé vyrovnávací paměti;
Pro kontrolu použijte živé (neuložené) vyrovnávací paměti.</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -38,16 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">Guías de estructura de bloques;
Mostrar guías de estructura para código F#;
Esquema;
Mostrar contorno y nodos colapsables para código F#;
Sugerencias inline;
Mostrar sugerencias de tipo en línea (vista previa);
Mostrar sugerencias de tipo retorno (vista previa);
Mostrar sugerencias de nombres de parámetros en línea (vista previa); Beer;
Búferes activos;
Usar buffers vivos (no guardados) para comprobar</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -38,16 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">ブロック構造ガイド;
F# コードの構造ガイドラインを表示します。
アウトライン;
F# コードのアウトラインと折りたたみ可能なノードを表示します。
インライン ヒント;
インライン型のヒントを表示する (プレビュー);
戻り値型のヒントを表示する (プレビュー);
インライン パラメーター名のヒントを表示する (プレビュー);ビール;
ライブ バッファー;
ライブ (未保存) バッファーをチェックに使用する</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -38,16 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">Guias de Estrutura de Bloco;
Mostrar diretrizes de estrutura para código F#;
Estrutura de tópicos;
Mostrar nós de estrutura de tópicos e recolhíveis para código F#;
Dicas embutidas;
Exibir dicas de tipo embutido (versão prévia);
Exibir dicas de tipo de retorno (versão prévia);
Exibir dicas de nome de parâmetro embutido (versão prévia);Cerveja;
Buffers Dinâmicos;
Usar buffers dinâmicos (não salvos) para verificação</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -38,16 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">Руководства по блочной структуре;
Показать рекомендации по структуре для кода F#;
Структурирование;
Показать структурные и сворачиваемые узлы для кода F#;
Встроенные подсказки;
Отображение подсказок встроенного типа (предварительная версия);
Отображение подсказок типа возвращаемого значения (предварительная версия);
Отображение встроенных подсказок имени параметра (предварительная версия);пиво;
Динамические буферы;
Использовать динамические (несохраненные) буферы для проверки</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -38,16 +38,16 @@ Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</source>
<target state="needs-review-translation">块结构指南;
显示 F# 代码的结构指南;
大纲;
显示 F# 代码的大纲和可折叠节点;
内联提示;
显示内联类型提示(预览);
显示返回类型提示(预览);
显示内联参数名称提示(预览);啤酒;
实时缓冲区;
使用实时(未保存)缓冲区进行检查</target>
<target state="new">Block Structure Guides;
Show structure guidelines for F# code;
Outlining;
Show outlining and collapsible nodes for F# code;
Inline hints;
Display inline type hints (preview);
Display return type hints (preview);
Display inline parameter name hints (preview);
Live Buffers;
Use live (unsaved) buffers for checking</target>
<note />
</trans-unit>
<trans-unit id="CodeFixesPageKeywords">

Просмотреть файл

@ -8,8 +8,8 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<SolidColorBrush x:Key="inherited_brush" Color="{Binding Path=Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Hyperlink}}"/>
<SolidColorBrush x:Key="inherited_semi_brush" Opacity="0.3" Color="{Binding Path=Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Hyperlink}}"/>
<SolidColorBrush x:Key="inherited_brush" Color="{Binding Path=Inlines.FirstInline.Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Hyperlink}}"/>
<SolidColorBrush x:Key="inherited_semi_brush" Opacity="0.3" Color="{Binding Path=Inlines.FirstInline.Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Hyperlink}}"/>
<DashStyle x:Key="dash_dashstyle" Dashes="5 5"/>
<DashStyle x:Key="dot_dashstyle" Dashes="1 5"/>
<Pen x:Key="dot_pen" DashStyle="{StaticResource dot_dashstyle}" Brush="{StaticResource inherited_brush}"/>
@ -26,7 +26,7 @@
<TextDecoration Location="Underline" PenOffset="1" Pen="{StaticResource dot_pen}"/>
</TextDecorationCollection>
<TextDecorationCollection x:Key="full_deco">
<TextDecoration PenOffset="1" Pen="{StaticResource mouseover_pen}" />
<TextDecoration Location="Underline" PenOffset="1" Pen="{StaticResource mouseover_pen}" />
</TextDecorationCollection>
<Style x:Key="hyperlink_mouse_over" TargetType="Hyperlink">
<Style.Triggers>

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">Hinweise zum Rückgabetyp anzeigen (Vorschau)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">Afficher les conseils de type de retour en ligne (préversion)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">Visualizza suggerimenti di tipo restituito (anteprima)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">반환 형식 힌트 표시(미리 보기)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">Wyświetlaj wskazówki dotyczące typu zwrotu (wersja zapoznawcza)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">Dönüş türü ipuçlarını görüntüle (önizleme)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">

Просмотреть файл

@ -104,7 +104,7 @@
</trans-unit>
<trans-unit id="Show_Return_Type_Hints">
<source>Display return type hints (preview)</source>
<target state="new">Display return type hints (preview)</target>
<target state="translated">顯示傳回類型提示 (預覽)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">