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

Merge main to feature/tasks #10483

Merged
merged 2 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ stages:
continueOnError: true
condition: failed()

# Mock official build
- job: MockOfficial
pool:
vmImage: windows-2019
steps:
- checkout: self
clean: true
- pwsh: .\eng\MockBuild.ps1
displayName: Build with OfficialBuildId

# Linux
- job: Linux
pool:
Expand Down Expand Up @@ -311,7 +321,7 @@ stages:
- checkout: self
clean: true
- script: .\Build.cmd -c Release
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests -c Release
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release
displayName: End to end build tests

# Source Build Windows
Expand Down
15 changes: 15 additions & 0 deletions eng/MockBuild.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"

try {
$fakeBuildId = (Get-Date -Format "yyyyMMdd") + ".0"
$visualStudioDropName = "Products/mock/dotnet-fsharp/branch/$fakeBuildId"
& "$PSScriptRoot\Build.ps1" -build -restore -ci -bootstrap -binaryLog -pack -configuration Release /p:OfficialBuildId=$fakeBuildId /p:VisualStudioDropName=$visualStudioDropName
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-Host "##[error](NETCORE_ENGINEERING_TELEMETRY=Build) Error doing mock official build."
exit 1
}
17 changes: 12 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@
<!-- Version number computation -->
<PropertyGroup>
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
<!-- F# Version components -->
<FSMajorVersion>5</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>0</FSBuildVersion>
<FSBuildVersion>1</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- F# Language version -->
<FSLanguageVersion>$(FSMajorVersion).$(FSMinorVersion)</FSLanguageVersion>
<FSLanguageReleaseNotesVersion>$(FSMajorVersion)-$(FSMinorVersion)</FSLanguageReleaseNotesVersion>
<!-- FSharp.Core version -->
<FSCoreProductVersion>$(FSMajorVersion).$(FSMinorVersion)</FSCoreProductVersion>
<FSCorePackageVersion>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion)</FSCorePackageVersion>
<FSCoreReleaseNotesVersion>$(FSMajorVersion)-$(FSMinorVersion)-$(FSBuildVersion)</FSCoreReleaseNotesVersion>
<FSCoreVersionPrefix>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion)</FSCoreVersionPrefix>
<FSCoreVersion>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion).$(FSRevisionVersion)</FSCoreVersion>
<FSCoreVersion>$(FSMajorVersion).$(FSMinorVersion).0.0</FSCoreVersion>
<!-- FSharp.Compiler.Service version -->
<FCSMajorVersion>38</FCSMajorVersion>
<FCSMinorVersion>$(FSMinorVersion)</FCSMinorVersion>
<FCSBuildVersion>$(FSBuildVersion)</FCSBuildVersion>
Expand All @@ -49,13 +53,16 @@
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>
</PropertyGroup>
<!-- version number assignment -->
<PropertyGroup>
<PropertyGroup Condition="'$(UseFSharpPackageVersion)' == 'true'">
<VersionPrefix>$(FSCoreVersionPrefix)</VersionPrefix>
<AssemblyVersion>$(FSCoreVersion)</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(UseFSharpPackageVersion)' != 'true'">
<VersionPrefix>$(FSCoreVersionPrefix)</VersionPrefix>
<VersionPrefix Condition="'$(UseFSharpPackageVersion)' == 'true'">$(FSCorePackageVersion)</VersionPrefix>
<VersionPrefix Condition="'$(UseFSharpProductVersion)' == 'true'">$(FSProductVersionPrefix)</VersionPrefix>
<VersionPrefix Condition="'$(UseVsMicroBuildAssemblyVersion)' == 'true'">$(VSAssemblyVersionPrefix)</VersionPrefix>
<VersionPrefix Condition="'$(UseFSharpCompilerServiceVersion)' == 'true'">$(FSharpCompilerServicePackageVersion)</VersionPrefix>
<AssemblyVersion Condition="'$(OfficialBuildId)' == ''">$(VersionPrefix).0</AssemblyVersion>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<!-- PR builds should explicitly specify a version number -->
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 9 additions & 0 deletions src/fsharp/FSharp.Core/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>

<PropertyGroup>
<UseFSharpPackageVersion>true</UseFSharpPackageVersion>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

</Project>
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<PreRelease>true</PreRelease>
<PackageId>FSharp.Core</PackageId>
<PackageVersionPrefix>$(FSCorePackageVersion)</PackageVersionPrefix>
<NuspecFile>FSharp.Core.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
<PackageDescription>FSharp.Core redistributables from F# Tools version $(FSCorePackageVersion) For F# $(FSLanguageVersion). Contains code from the F# Software Foundation.</PackageDescription>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace Microsoft.VisualStudio.FSharp.Editor

open System
open System.Composition
open System.Threading.Tasks

open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.CodeFixes

[<ExportCodeFixProvider(FSharpConstants.FSharpLanguageName, Name = "ChangePrefixNegationToInfixSubtraction"); Shared>]
type internal FSharpChangePrefixNegationToInfixSubtractionodeFixProvider() =
inherit CodeFixProvider()

let fixableDiagnosticIds = set ["FS0003"]

override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds

override _.RegisterCodeFixesAsync context : Task =
asyncMaybe {
let diagnostics =
context.Diagnostics
|> Seq.filter (fun x -> fixableDiagnosticIds |> Set.contains x.Id)
|> Seq.toImmutableArray

let! sourceText = context.Document.GetTextAsync(context.CancellationToken)

let mutable pos = context.Span.End + 1

// This won't ever actually happen, but eh why not
do! Option.guard (pos < sourceText.Length)

let mutable ch = sourceText.GetSubText(TextSpan(pos, 1)).ToString().[0]

while pos < sourceText.Length && Char.IsWhiteSpace(ch) do
pos <- pos + 1
let text = sourceText.GetSubText(TextSpan(pos, 1))
ch <- text.ToString().[0]

// Bail if this isn't a negation
do! Option.guard (ch = '-')

let title = SR.ChangePrefixNegationToInfixSubtraction()

let codeFix =
CodeFixHelpers.createTextChangeCodeFix(
title,
context,
(fun () -> asyncMaybe.Return [| TextChange(TextSpan(pos, 1), "- ") |]))

context.RegisterCodeFix(codeFix, diagnostics)
}
|> Async.Ignore
|> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken)
1 change: 1 addition & 0 deletions vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<Compile Include="Commands\FsiCommandService.fs" />
<Compile Include="Commands\XmlDocCommandService.fs" />
<Compile Include="CodeFix\CodeFixHelpers.fs" />
<Compile Include="CodeFix\ChangePrefixNegationToInfixSubtraction.fs" />
<Compile Include="CodeFix\AddNewKeywordToDisposableConstructorInvocation.fs" />
<Compile Include="CodeFix\AddOpenCodeFixProvider.fs" />
<Compile Include="CodeFix\ProposeUppercaseLabel.fs" />
Expand Down
3 changes: 3 additions & 0 deletions vsintegration/src/FSharp.Editor/FSharp.Editor.resx
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,7 @@
<data name="FSharpDisposableTopLevelValuesClassificationType" xml:space="preserve">
<value>F# Dispostable Values (top-level)</value>
</data>
<data name="ChangePrefixNegationToInfixSubtraction" xml:space="preserve">
<value>Use subtraction instead of negation</value>
</data>
</root>
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Přidejte klíčové slovo new.</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Uvolnitelné hodnoty jazyka F# (místní)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Schlüsselwort "new" hinzufügen</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Disposable-Werte in F# (lokal)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Agregar "nueva" palabra clave</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Valores de F# descartables (locales)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Ajouter le mot clé 'new'</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Valeurs F# pouvant être supprimées (variables locales)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Aggiungi la parola chiave 'new'</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Valori eliminabili F# (variabili locali)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">'new' キーワードを追加する</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">F# の破棄可能な値 (ローカル)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">'new' 키워드 추가</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">F# 삭제 가능한 값(로컬)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Dodaj słowo kluczowe „new”</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Wartości możliwe do likwidacji języka F# (lokalne)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Adicionar a palavra-chave 'new'</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Valores F# Descartáveis (locais)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">Добавить ключевое слово "new"</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">Освобождаемые значения F# (локальные)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">'new' anahtar sözcüğünü ekleme</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">F# Atılabilir Değerleri (yereller)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">添加“新”关键字</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">F# 可释放值(局部值)</target>
Expand Down
5 changes: 5 additions & 0 deletions vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<target state="translated">新增 'new' 關鍵字</target>
<note />
</trans-unit>
<trans-unit id="ChangePrefixNegationToInfixSubtraction">
<source>Use subtraction instead of negation</source>
<target state="new">Use subtraction instead of negation</target>
<note />
</trans-unit>
<trans-unit id="FSharpDisposableLocalValuesClassificationType">
<source>F# Disposable Values (locals)</source>
<target state="translated">F# 可處置的值 (區域)</target>
Expand Down