提交 1c30c015 编写于 作者: C CyrusNajmabadi

Merge remote-tracking branch 'upstream/master' into genConstructorCaretPlacement

' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Globalization
Namespace Microsoft.CodeAnalysis.VisualBasic
Public Module PredefinedPreprocessorSymbols
Friend ReadOnly CurrentVersionNumber As Double = Double.Parse(LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().GetErrorName())
Friend ReadOnly Property CurrentVersionNumber As Double
Get
Return Double.Parse(LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().GetErrorName(), CultureInfo.InvariantCulture)
End Get
End Property
''' <summary>
''' Adds predefined preprocessor symbols VBC_VER and TARGET to given list of preprocessor symbols if not included yet.
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Globalization
Imports System.Linq
Imports Roslyn.Test.Utilities
......@@ -84,7 +85,22 @@ Public Class VisualBasicParseOptionsTests
Max().
ToDisplayString()
Assert.Equal(highest, PredefinedPreprocessorSymbols.CurrentVersionNumber.ToString())
Assert.Equal(highest, PredefinedPreprocessorSymbols.CurrentVersionNumber.ToString(CultureInfo.InvariantCulture))
End Sub
<Fact, WorkItem(21094, "https://github.com/dotnet/roslyn/issues/21094")>
Public Sub CurrentVersionNumberIsCultureIndependent()
Dim currentCulture = CultureInfo.CurrentCulture
Try
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture
Dim invariantCultureVersion = PredefinedPreprocessorSymbols.CurrentVersionNumber
' cs-CZ uses decimal comma, which can cause issues
CultureInfo.CurrentCulture = New CultureInfo("cs-CZ")
Dim czechCultureVersion = PredefinedPreprocessorSymbols.CurrentVersionNumber
Assert.Equal(invariantCultureVersion, czechCultureVersion)
Finally
CultureInfo.CurrentCulture = currentCulture
End Try
End Sub
<Fact>
......
......@@ -256,8 +256,57 @@ public static string GetText()
}", ignoreTrivia: false);
}
#if false
[WorkItem(20942, "https://github.com/dotnet/roslyn/issues/20942")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedVariable)]
public async Task TestWhitespaceBetweenStatements1()
{
await TestInRegularAndScriptAsync(
@"
class Test
{
bool TrySomething()
{
bool used = true;
int [|unused|];
#endif
return used;
}
}",
@"
class Test
{
bool TrySomething()
{
bool used = true;
return used;
}
}", ignoreTrivia: false);
}
[WorkItem(20942, "https://github.com/dotnet/roslyn/issues/20942")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedVariable)]
public async Task TestWhitespaceBetweenStatements2()
{
await TestInRegularAndScriptAsync(
@"
class Test
{
bool TrySomething()
{
int [|unused|];
return used;
}
}",
@"
class Test
{
bool TrySomething()
{
return used;
}
}", ignoreTrivia: false);
}
}
}
......@@ -71,6 +71,25 @@ protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic
{
removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
}
else
{
var statementParent = localDeclaration.Parent;
if (syntaxFacts.IsExecutableBlock(statementParent))
{
var siblings = syntaxFacts.GetExecutableBlockStatements(statementParent);
var localDeclarationIndex = siblings.IndexOf(localDeclaration);
if (localDeclarationIndex != 0)
{
// if we're removing hte first statement in a block, then we
// want to have the elastic marker on it so that the next statement
// properly formats with the space left behind. But if it's
// not the first statement then just keep the trivia as is
// so that the statement before and after it stay appropriately
// spaced apart.
removeOptions &= ~SyntaxRemoveOptions.AddElasticMarker;
}
}
}
editor.RemoveNode(localDeclaration, removeOptions);
}
......
......@@ -16,8 +16,7 @@ public class ProcDumpRunner
// -ma Write a 'Full' dump file. Includes All the Image, Mapped and Private memory.
// -e Write a dump when the process encounters an unhandled exception. Include the 1 to create dump on first chance exceptions.
// -t Write a dump when the process terminates.
// -w Wait for the specified process to launch if it's not running.
private const string ProcDumpSwitches = "/accepteula -ma -e -t -w";
private const string ProcDumpSwitches = "/accepteula -ma -e -t";
/// <summary>
/// Starts procdump.exe against the process.
......@@ -44,4 +43,4 @@ public static void StartProcDump(string procDumpPath, int processId, string proc
}
}
}
}
\ No newline at end of file
}
......@@ -17,8 +17,9 @@
<tags>VSSDK</tags>
</metadata>
<files>
<file src="$debuggerPath$\v2.0\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\net20" />
<file src="$debuggerPath$\v4.5\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\net45" />
<file src="$debuggerPath$\portable\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\netstandard1.3" />
<file src="$debuggerPath$\ref\v2.0\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\net20" />
<file src="$debuggerPath$\ref\v4.5\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\net45" />
<file src="$debuggerPath$\ref\portable\Microsoft.VisualStudio.Debugger.Engine.dll" target="ref\netstandard1.3" />
<file src="$debuggerPath$\lib\net45\Microsoft.VisualStudio.Debugger.Engine.dll" target="lib\net45" />
</files>
</package>
......@@ -28,10 +28,14 @@ function Package-Normal() {
# The debugger DLLs have a more complex structure and it's easier to special case
# copying them over.
function Copy-Debugger() {
$refRootPath = [IO.Path]::GetFullPath((Join-Path $dropPath "..\..\Debugger\ReferenceDLL"))
$debuggerDllPath = Join-Path $dllPath "debugger"
Create-Directory $debuggerDllPath
Copy-Item -re -fo "$refRootPath\*" $debuggerDllPath
$debuggerRefDir = Join-Path $dllPath "debugger\ref"
$debuggerImplDir = Join-Path $dllPath "debugger\lib\net45"
Create-Directory $debuggerRefDir
Create-Directory $debuggerImplDir
Copy-Item -re -fo (Join-Path $dropPath "..\..\Debugger\ReferenceDLL\*") $debuggerRefDir
Copy-Item -re -fo (Join-Path $dropPath "..\..\Debugger\IDE\Microsoft.VisualStudio.Debugger.Engine.dll") $debuggerImplDir
Copy-Item -re -fo (Join-Path $dropPath "Microsoft.VisualStudio.Debugger.Metadata.dll") $debuggerImplDir
}
# Used to package debugger nugets
......
......@@ -17,7 +17,8 @@
<tags>VSSDK</tags>
</metadata>
<files>
<file src="$debuggerPath$\v2.0\Microsoft.VisualStudio.Debugger.Metadata.dll" target="ref\net20" />
<file src="$debuggerPath$\portable\Microsoft.VisualStudio.Debugger.Metadata.dll" target="ref\netstandard1.3" />
<file src="$debuggerPath$\ref\v2.0\Microsoft.VisualStudio.Debugger.Metadata.dll" target="ref\net20" />
<file src="$debuggerPath$\ref\portable\Microsoft.VisualStudio.Debugger.Metadata.dll" target="ref\netstandard1.3" />
<file src="$debuggerPath$\lib\net45\Microsoft.VisualStudio.Debugger.Metadata.dll" target="lib\net45" />
</files>
</package>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册