Skip to content
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
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>

<PropertyGroup>
<LangVersion Condition="'$(FSharpLangVersion)' != ''">$(FSharpLangVersion)</LangVersion>
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>
Expand Down
28 changes: 27 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,32 @@ stages:
helixRepo: dotnet/fsharp
jobs:

- job: WindowsLangVersionPreview
pool:
# The PR build definition sets this variable:
# WindowsMachineQueueName=Windows.vs2022.amd64.open
# and there is an alternate build definition that sets this to a queue that is always scouting the
# next preview of Visual Studio.
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(WindowsMachineQueueName)
timeoutInMinutes: 120
steps:
- checkout: self
clean: true

- script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:FSharpLangVersion=preview
displayName: Build

- task: PublishBuildArtifacts@1
displayName: Publish Build BinLog
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog'
ArtifactName: 'Windows Release build binlogs'
ArtifactType: Container
parallel: true

# Windows With Compressed Metadata
- job: WindowsCompressedMetadata
variables:
Expand Down Expand Up @@ -371,7 +397,7 @@ stages:
displayName: Build / Integration Test
continueOnError: true
condition: eq(variables['_testKind'], 'testIntegration')

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
Expand Down
18 changes: 9 additions & 9 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function BuildSolution([string] $solutionName, $nopack) {
/v:$verbosity `
$suppressExtensionDeployment `
@properties

$env:BUILDING_USING_DOTNET=$BUILDING_USING_DOTNET_ORIG
}

Expand Down Expand Up @@ -340,15 +340,15 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
if ($env:RunningAsPullRequest -ne "true" -and $noTestFilter -eq $false) {
$args += " --filter TestCategory!=PullRequest"
}

if ($asBackgroundJob) {
Write-Host("Starting on the background: $args")
Write-Host("------------------------------------")
$bgJob = Start-Job -ScriptBlock {
$bgJob = Start-Job -ScriptBlock {
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "nunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
if ($LASTEXITCODE -ne 0) {
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
}
if ($LASTEXITCODE -ne 0) {
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
}
}
return $bgJob
} else{
Expand Down Expand Up @@ -570,10 +570,10 @@ try {
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"

# Collect output from background jobs
Wait-job $bgJob | out-null
Receive-Job $bgJob -ErrorAction Stop
Receive-Job $bgJob -ErrorAction Stop
}

if ($testDesktop) {
Expand All @@ -585,7 +585,7 @@ try {
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"

# Collect output from background jobs
Wait-job $bgJob | out-null
Receive-Job $bgJob -ErrorAction Stop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<OutputType>Library</OutputType>
<RootNamespace>
</RootNamespace>
<LangVersion>latest</LangVersion>
<AssemblyAttributeComVisible>true</AssemblyAttributeComVisible>
<AssemblyName>FSharp.ProjectSystem.PropertyPages</AssemblyName>
<UseVsVersion>true</UseVsVersion>
Expand Down
13 changes: 11 additions & 2 deletions vsintegration/tests/Salsa/salsa.fs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,17 @@ module internal Salsa =
newProjectSite

/// Token types.
type TokenType = Text | Keyword | Comment | Identifier | String | Number | InactiveCode | PreprocessorKeyword | Operator
with override this.ToString() =
type TokenType =
| Text
| Keyword
| Comment
| Identifier
| String
| Number
| InactiveCode
| PreprocessorKeyword
| Operator
override this.ToString() =
match this with
| Text -> "Text"
| Keyword -> "Keyword"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type UsingMSBuild() as this =
let errorList = GetErrors(project)
[for error in errorList do
if (error.Severity = Microsoft.VisualStudio.FSharp.LanguageService.Severity.Warning) then
yield error]
yield error]

let CheckErrorList (content : string) f : unit =
let (_, project, file) = this.CreateSingleFileProject(content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,26 @@ type UsingMSBuild() =
[<Test>]
member public this.``ErrorRecovery.5878_1``() =
Helper.AssertMemberDataTipContainsInOrder
(this.TestRunner,
(*code *)
[
"module Module ="
" /// Union comment"
" type Union ="
" /// Case comment"
" | Case of int"
"Module."
] ,
(* marker *)
"Module.",
(* completed item *)
"Case",
(* expect to see in order... *)
[
"union case Module.Union.Case: int -> Module.Union";
"Case comment";
]
(
this.TestRunner,
(*code *)
[
"module Module ="
" /// Union comment"
" type Union ="
" /// Case comment"
" | Case of int"
"Module."
] ,
(* marker *)
"Module.",
(* completed item *)
"Case",
(* expect to see in order... *)
[
"union case Module.Union.Case: int -> Module.Union";
"Case comment";
]
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"T(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")
"T(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")

// This test case checks the type with space in between like N.``T T`` for GotoDefinition
let ``Type.SpaceInTheType``() =
Expand All @@ -228,10 +228,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"T``",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttributeWithSpaceInTheType.dll"),
"(*ColumnMarker*)")
"T``",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttributeWithSpaceInTheType.dll"),
"(*ColumnMarker*)")

// Basic scenario on a provided Constructor
let ``Constructor.BasicScenario``() =
Expand All @@ -241,10 +241,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"T(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")
"T(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")

// Basic scenario on a provided Method
let ``Method.BasicScenario``() =
Expand All @@ -253,10 +253,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"M(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")
"M(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")

// Basic scenario on a provided Property
let ``Property.BasicScenario``() =
Expand All @@ -265,10 +265,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"StaticProp(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")
"StaticProp(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")

// Basic scenario on a provided Event
let ``Event.BasicScenario``() =
Expand All @@ -278,10 +278,10 @@ type UsingMSBuild() =
// A0(*ColumnMarker*)1234567890
// B01234567890
// C01234567890 """,
"Event1(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")
"Event1(*GotoValDef*)",
"// A0(*ColumnMarker*)1234567890",
PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"),
"(*ColumnMarker*)")

// Actually execute all the scenarios...
``Type.BasicScenario``()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,42 +496,45 @@ type Miscellaneous() =

[<Test>]
member this.``MSBuildExtensibility.BrokenCompileDependsOn.WithRecovery`` () =
this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(["foo.fs";"bar.fs"], [],
// define a legal 'Foo' configuration
@"<PropertyGroup Condition="" '$(Configuration)|$(Platform)' == 'Foo|AnyCPU' "">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
</PropertyGroup>", fun project configChangeNotifier projFile ->
let projFileText = File.ReadAllText(projFile)
// We need to add text _after_ the import of Microsoft.FSharp.Targets.
let i = projFileText.IndexOf("<Import Project=")
let i = projFileText.IndexOf(">", i)
let newProjFileText = projFileText.Insert(i+1, @"
<PropertyGroup>
<CompileDependsOn>MyTarget;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
<Target Name=""MyTarget"">
<Error Condition="" '$(Configuration)'!='Foo' "" Text=""This is my error message."" ContinueOnError=""false"" />
</Target>")
File.WriteAllText(projFile, newProjFileText)
project.Reload()
// Ensure we are not in 'Foo' config, and thus expect failure
let curCfgCanonicalName = this.GetCurrentConfigCanonicalName(project)
Assert.IsFalse(curCfgCanonicalName.StartsWith("Foo"), sprintf "default config should not be 'Foo'! in fact it had canonical name '%s'" curCfgCanonicalName)
// Now the project system is in a state where ComputeSourcesAndFlags will fail.
// Our goal is to at least be able to open individual source files and treat them like 'files outside a project' with regards to intellisense, etc.
// Also, if the user does 'Build', he will get an error which will help diagnose the problem.
let ipps = project :> IProvideProjectSite
let ips = ipps.GetProjectSite()
let expected = [| |] // Ideal behavior is [|"foo.fs";"bar.fs"|], and we could choose to improve this in the future. For now we are just happy to now throw/crash.
let actual = ips.CompilationSourceFiles
Assert.AreEqual(expected, actual, "project site did not report expected set of source files")
)
this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(
["foo.fs";"bar.fs"],
[],
// define a legal 'Foo' configuration
@"<PropertyGroup Condition="" '$(Configuration)|$(Platform)' == 'Foo|AnyCPU' "">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
</PropertyGroup>",
fun project configChangeNotifier projFile ->
let projFileText = File.ReadAllText(projFile)
// We need to add text _after_ the import of Microsoft.FSharp.Targets.
let i = projFileText.IndexOf("<Import Project=")
let i = projFileText.IndexOf(">", i)
let newProjFileText = projFileText.Insert(i+1, @"
<PropertyGroup>
<CompileDependsOn>MyTarget;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
<Target Name=""MyTarget"">
<Error Condition="" '$(Configuration)'!='Foo' "" Text=""This is my error message."" ContinueOnError=""false"" />
</Target>")
File.WriteAllText(projFile, newProjFileText)
project.Reload()
// Ensure we are not in 'Foo' config, and thus expect failure
let curCfgCanonicalName = this.GetCurrentConfigCanonicalName(project)
Assert.IsFalse(curCfgCanonicalName.StartsWith("Foo"), sprintf "default config should not be 'Foo'! in fact it had canonical name '%s'" curCfgCanonicalName)
// Now the project system is in a state where ComputeSourcesAndFlags will fail.
// Our goal is to at least be able to open individual source files and treat them like 'files outside a project' with regards to intellisense, etc.
// Also, if the user does 'Build', he will get an error which will help diagnose the problem.
let ipps = project :> IProvideProjectSite
let ips = ipps.GetProjectSite()
let expected = [| |] // Ideal behavior is [|"foo.fs";"bar.fs"|], and we could choose to improve this in the future. For now we are just happy to now throw/crash.
let actual = ips.CompilationSourceFiles
Assert.AreEqual(expected, actual, "project site did not report expected set of source files")
)

[<Test>]
member public this.TestBuildActions () =
Expand Down
Loading