Skip to content

Commit

Permalink
Merge pull request #8343 from dotnet/merges/master-to-feature/tasks
Browse files Browse the repository at this point in the history
Merge master to feature/tasks
  • Loading branch information
KevinRansom authored Jan 24, 2020
2 parents 42c0ed3 + 70883fb commit b7f0199
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 118 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<Compile Include="Debugging\BreakpointResolutionService.fs" />
<Compile Include="Debugging\LanguageDebugInfoService.fs" />
<Compile Include="Diagnostics\DocumentDiagnosticAnalyzer.fs" />
<Compile Include="Diagnostics\ProjectDiagnosticAnalyzer.fs" />
<Compile Include="Diagnostics\SimplifyNameDiagnosticAnalyzer.fs" />
<Compile Include="Diagnostics\UnusedDeclarationsAnalyzer.fs" />
<Compile Include="Diagnostics\UnusedOpensDiagnosticAnalyzer.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom</note>
</trans-unit>
<trans-unit id="RSE_GraphicSizeFormat">
<source>{0} x {1}</source>
<target state="needs-review-translation">{0} x {1}</target>
<target state="translated">{0} x {1}</target>
<note>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</note>
Expand Down
31 changes: 0 additions & 31 deletions vsintegration/tests/UnitTests/ProjectDiagnosticAnalyzerTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,3 @@ type ProjectDiagnosticAnalyzerTests() =

let args = mkProjectCommandLineArgs (dllName, [fileName])
checker.GetProjectOptionsFromCommandLineArgs (projectName, args)

#if PROJECT_ANALYSIS
[<Test>]
member public this.ProjectDiagnosticsDontReportJustProjectErrors_Bug1596() =
// https://github.com/Microsoft/visualfsharp/issues/1596
let fileContents = """
let x = 3
printf "%d" x
"""
let options = CreateProjectAndGetOptions(fileContents)
let additionalOptions = {options with OtherOptions = Array.append options.OtherOptions [| "--times" |]}

let errors = FSharpProjectDiagnosticAnalyzer.GetDiagnostics(additionalOptions) |> Async.RunSynchronously
Assert.AreEqual(1, errors.Length, "Exactly one warning should have been reported")

let warning = errors.[0]
Assert.AreEqual(DiagnosticSeverity.Warning, warning.Severity, "Diagnostic severity should be a warning")
Assert.AreEqual("The command-line option 'times' is for test purposes only", warning.GetMessage())

[<Test>]
member public this.ProjectDiagnosticsShouldNotReportDocumentErrors_Bug1596() =
// https://github.com/Microsoft/visualfsharp/issues/1596
let fileContents = """
let x = "string value that cannot be printed with %d"
printf "%d" x
"""
let options = CreateProjectAndGetOptions(fileContents)

let errors = FSharpProjectDiagnosticAnalyzer.GetDiagnostics(options) |> Async.RunSynchronously
Assert.AreEqual(0, errors.Length, "No semantic errors should have been reported")
#endif
18 changes: 16 additions & 2 deletions vsintegration/tests/UnitTests/ProjectOptionsBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ open System.IO
open System.Xml.Linq
open FSharp.Compiler.SourceCodeServices

module FileSystemHelpers =
let safeDeleteFile (path: string) =
try
File.Delete(path)
with
| _ -> ()

let safeDeleteDirectory (path: string) =
try
Directory.Delete(path)
with
| _ -> ()

type FSharpProject =
{
Directory: string
Expand All @@ -29,9 +42,10 @@ type FSharpProject =
member this.Dispose() =
// delete each source file
this.Files
|> List.iter (fun (path, _contents) -> File.Delete(path))
|> List.map fst
|> List.iter FileSystemHelpers.safeDeleteFile
// delete the directory
Directory.Delete(this.Directory)
FileSystemHelpers.safeDeleteDirectory (this.Directory)
// project file doesn't really exist, nothing to delete
()

Expand Down

0 comments on commit b7f0199

Please sign in to comment.