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
16 changes: 6 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ variables:
value: .NETCore
- name: VisualStudioDropName
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- name: DotNetSdkVersion
value: '6.0.100-preview.6.21355.2'
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: RunningAsPullRequest
value: true
Expand Down Expand Up @@ -387,7 +385,8 @@ stages:
# displayName: install SDK
# inputs:
# packageType: sdk
# version: $(DotNetSdkVersion)
# useGlobalJson: true
# includePreviewVersions: true
# workingDirectory: $(Build.SourcesDirectory)
# installationPath: $(Agent.ToolsDirectory)/dotnet
# - script: dotnet build .\FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
Expand All @@ -411,9 +410,8 @@ stages:
displayName: install SDK
inputs:
packageType: sdk
# We cannot use .NET version from global.json, since it tries to install all SDK version from all global.json files in the tree, and we use some fake versions for testing.
useGlobalJson: false
version: $(DotNetSdkVersion)
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build ./FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
Expand All @@ -437,10 +435,8 @@ stages:
displayName: install SDK
inputs:
packageType: sdk
# We cannot use .NET version from global.json, since it tries to install all SDK version from all global.json files in the tree, and we use some fake versions for testing.
useGlobalJson: false
version: $(DotNetSdkVersion)
performMultiLevelLookup: false
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build ./FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
Expand Down
47 changes: 25 additions & 22 deletions src/fsharp/service/FSharpParseFileResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
| None -> None
| Some clause ->
match clause with
| SynMatchClause.SynMatchClause (_, whenExpr, resultExpr, _, _) ->
match whenExpr with
| SynMatchClause.SynMatchClause (_, whenExprOpt, resultExpr, _, _) ->
match whenExprOpt with
| None ->
getIdentRangeForFuncExprInApp traverseSynExpr resultExpr pos
| Some whenExpr ->
Expand Down Expand Up @@ -454,15 +454,18 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
yield! walkExpr (isFunction || (match spInfo with DebugPointAtBinding.Yes _ -> false | _-> true)) synExpr ]

and walkExprs es = List.collect (walkExpr false) es

and walkBinds es = List.collect walkBind es

and walkMatchClauses cl =
[ for SynMatchClause(_, whenExpr, e, _, _) in cl do
match whenExpr with
| Some e -> yield! walkExpr false e
[ for SynMatchClause(_, whenExprOpt, tgtExpr, _, _) in cl do
match whenExprOpt with
| Some whenExpr -> yield! walkExpr false whenExpr
| _ -> ()
yield! walkExpr true e ]
yield! walkExpr true tgtExpr ]

and walkExprOpt (spAlways: bool) eOpt = [ match eOpt with Some e -> yield! walkExpr spAlways e | _ -> () ]
and walkExprOpt (spAlways: bool) eOpt =
[ match eOpt with Some e -> yield! walkExpr spAlways e | _ -> () ]

and IsBreakableExpression e =
match e with
Expand All @@ -475,13 +478,13 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,

// Determine the breakpoint locations for an expression. spAlways indicates we always
// emit a breakpoint location for the expression unless it is a syntactic control flow construct
and walkExpr (spAlways: bool) e =
let m = e.Range
and walkExpr (spAlways: bool) expr =
let m = expr.Range
if not (isMatchRange m) then [] else
[ if spAlways && IsBreakableExpression e then
[ if spAlways && IsBreakableExpression expr then
yield! checkRange m

match e with
match expr with
| SynExpr.ArbitraryAfterError _
| SynExpr.LongIdent _
| SynExpr.LibraryOnlyILAssembly _
Expand Down Expand Up @@ -588,24 +591,24 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
yield! walkExprOpt false whenExpr
yield! walkExpr true e

| SynExpr.Lambda (_, _, _, e, _, _) ->
yield! walkExpr true e
| SynExpr.Lambda (_, _, _, bodyExpr, _, _) ->
yield! walkExpr true bodyExpr

| SynExpr.Match (spBind, e, cl, _) ->
| SynExpr.Match (spBind, inpExpr, cl, _) ->
yield! walkBindSeqPt spBind
yield! walkExpr false e
for SynMatchClause(_, whenExpr, e, _, _) in cl do
yield! walkExpr false inpExpr
for SynMatchClause(_, whenExpr, tgtExpr, _, _) in cl do
yield! walkExprOpt false whenExpr
yield! walkExpr true e
yield! walkExpr true tgtExpr

| SynExpr.LetOrUse (_, _, bs, e, _) ->
yield! walkBinds bs
yield! walkExpr true e
| SynExpr.LetOrUse (_, _, binds, bodyExpr, _) ->
yield! walkBinds binds
yield! walkExpr true bodyExpr

| SynExpr.TryWith (e, _, cl, _, _, spTry, spWith) ->
| SynExpr.TryWith (tryExpr, _, cl, _, _, spTry, spWith) ->
yield! walkTrySeqPt spTry
yield! walkWithSeqPt spWith
yield! walkExpr true e
yield! walkExpr true tryExpr
yield! walkMatchClauses cl

| SynExpr.TryFinally (e1, e2, _, spTry, spFinally) ->
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7839,4 +7839,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
2 changes: 1 addition & 1 deletion src/fsharp/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7839,4 +7839,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
2 changes: 1 addition & 1 deletion src/fsharp/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7839,4 +7839,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@
<Compile Include="..\service\ParserTests.fs">
<Link>ParserTests.fs</Link>
</Compile>
<Compile Include="..\service\Program.fs">
<Compile Include="..\service\Program.fs">
<Link>Program.fs</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dotnet.ProjInfo" Version="0.37.0" />
<ProjectReference Include="..\..\src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
<ProjectReference Include="..\..\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion tests/walkthroughs/sdk-script-manual-tests/README.md.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

### NOTE
Before running tests, `.global.json` files should be renamed to `global.json`, this is needed to not confuse UseDotNet task of Azure Pipelies when installing SDK.


#### no warnings
Expand Down