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

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