Skip to content

Commit 9bc8f80

Browse files
author
msftbot[bot]
authored
Merge pull request #43663 from dotnet/merges/release/dev16.6-to-release/dev16.6-vs-deps
Merge release/dev16.6 to release/dev16.6-vs-deps
2 parents 3d85b48 + 72dd563 commit 9bc8f80

21 files changed

+479
-100
lines changed

eng/build.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ function Deploy-VsixViaTool() {
492492
"Roslyn.Compilers.Extension.vsix",
493493
"Roslyn.VisualStudio.Setup.vsix",
494494
"Roslyn.VisualStudio.Setup.Dependencies.vsix",
495-
"Roslyn.VisualStudio.InteractiveComponents.vsix",
496495
"ExpressionEvaluatorPackage.vsix",
497496
"Roslyn.VisualStudio.DiagnosticsWindow.vsix",
498497
"Microsoft.VisualStudio.IntegrationTest.Setup.vsix")

eng/config/OptProf.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
"filename": "/Microsoft.CodeAnalysis.Features.dll",
7171
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
7272
},
73-
{
74-
"filename": "/Microsoft.CodeAnalysis.CSharp.Workspaces.dll",
75-
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
76-
},
7773
{
7874
"filename": "/Microsoft.VisualStudio.LanguageServices.Implementation.dll",
7975
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
@@ -143,10 +139,6 @@
143139
"filename": "/Microsoft.CodeAnalysis.VisualBasic.Features.dll",
144140
"testCases":[ "Microsoft.Test.Performance.XamlOptProfCreateTests.WpfCreateProject_DesignerIsolated" ]
145141
},
146-
{
147-
"filename": "/Microsoft.CodeAnalysis.Workspaces.dll",
148-
"testCases":[ "Microsoft.Test.Performance.XamlOptProfCreateTests.WpfCreateProject_DesignerIsolated" ]
149-
},
150142
{
151143
"filename": "/Microsoft.CodeAnalysis.VisualBasic.dll",
152144
"testCases":[ "Microsoft.Test.Performance.XamlOptProfCreateTests.WpfCreateProject_DesignerIsolated" ]
@@ -252,10 +244,6 @@
252244
"filename": "/Microsoft.CodeAnalysis.VisualBasic.Features.dll",
253245
"testCases":[ "WinForms.OptProfTests.winforms_largeform_vb" ]
254246
},
255-
{
256-
"filename": "/Microsoft.CodeAnalysis.Workspaces.dll",
257-
"testCases":[ "WinForms.OptProfTests.winforms_largeform_vb" ]
258-
},
259247
{
260248
"filename": "/Microsoft.CodeAnalysis.VisualBasic.dll",
261249
"testCases":[ "WinForms.OptProfTests.winforms_largeform_vb" ]
@@ -365,10 +353,6 @@
365353
"filename": "/Microsoft.CodeAnalysis.VisualBasic.Features.dll",
366354
"testCases":[ "TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble" ]
367355
},
368-
{
369-
"filename": "/Microsoft.CodeAnalysis.Workspaces.dll",
370-
"testCases":[ "TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble" ]
371-
},
372356
{
373357
"filename": "/Microsoft.CodeAnalysis.VisualBasic.dll",
374358
"testCases":[ "TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble" ]
@@ -478,10 +462,6 @@
478462
"filename": "/Microsoft.CodeAnalysis.VisualBasic.Features.dll",
479463
"testCases":[ "VSPE.OptProfTests.vs_asl_vb_scenario", "VSPE.OptProfTests.vs_perf_designtime_solution_build_vb_australiangovernment" ]
480464
},
481-
{
482-
"filename": "/Microsoft.CodeAnalysis.Workspaces.dll",
483-
"testCases":[ "VSPE.OptProfTests.vs_asl_cs_scenario", "VSPE.OptProfTests.vs_asl_vb_scenario", "VSPE.OptProfTests.vs_perf_DesignTime_solution_loadclose_cs_picasso", "VSPE.OptProfTests.vs_perf_designtime_editor_intellisense_globalcompletionlist_cs", "VSPE.OptProfTests.vs_perf_designtime_ide_searchtest", "VSPE.OptProfTests.vs_perf_designtime_solution_build_vb_australiangovernment", "VSPE.OptProfTests.vs_perf_designtime_solution_loadclose_vb_australiangovernment" ]
484-
},
485465
{
486466
"filename": "/Microsoft.CodeAnalysis.VisualBasic.dll",
487467
"testCases":[ "VSPE.OptProfTests.vs_asl_vb_scenario", "VSPE.OptProfTests.vs_perf_designtime_ide_searchtest", "VSPE.OptProfTests.vs_perf_designtime_solution_build_vb_australiangovernment", "VSPE.OptProfTests.vs_perf_designtime_solution_loadclose_vb_australiangovernment" ]

src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<RootNamespace>Microsoft.VisualStudio.LanguageServices.CodeLens</RootNamespace>
99
<TargetFramework>net472</TargetFramework>
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
<ApplyNgenOptimization>partial</ApplyNgenOptimization>
1112

1213
<!-- NuGet -->
1314
<IsPackable>false</IsPackable>

src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<GeneratePkgDefFile>true</GeneratePkgDefFile>
1212
<DeployExtension>false</DeployExtension>
1313
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
14+
<ApplyNgenOptimization>partial</ApplyNgenOptimization>
1415

1516
<!-- NuGet -->
1617
<IsPackable>true</IsPackable>

src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpAutomaticBraceCompletion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ int Prop { $$}
640640
assertCaretPosition: true);
641641
}
642642

643-
[WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)]
643+
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/43627")]
644+
[CombinatorialData, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)]
644645
[Trait(Traits.Feature, Traits.Features.CompleteStatement)]
645646
[WorkItem(18104, "https://github.com/dotnet/roslyn/issues/18104")]
646647
public void CompleteStatementTriggersCompletion(bool showCompletionInArgumentLists)

src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpIntelliSense.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public void AtNamespaceLevel(bool showCompletionInArgumentLists)
4747
VisualStudio.Editor.Verify.CurrentLineText("using$$", assertCaretPosition: true);
4848
}
4949

50-
[WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
50+
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/43627")]
51+
[CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
5152
public void SpeculativeTInList(bool showCompletionInArgumentLists)
5253
{
5354
SetUpEditor(@"
@@ -104,7 +105,8 @@ public static void Navigate(int i){ }
104105
VisualStudio.Editor.Verify.CurrentLineText("NavigateTo.Search$$", assertCaretPosition: true);
105106
}
106107

107-
[WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
108+
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/43627")]
109+
[CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
108110
public void CtrlAltSpace(bool showCompletionInArgumentLists)
109111
{
110112
VisualStudio.Workspace.SetTriggerCompletionInArgumentLists(showCompletionInArgumentLists);
@@ -154,7 +156,8 @@ public void CtrlAltSpace(bool showCompletionInArgumentLists)
154156
VisualStudio.Editor.Verify.CurrentLineText("System.Console.writeline();$$", assertCaretPosition: true);
155157
}
156158

157-
[WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
159+
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/43627")]
160+
[CombinatorialData, Trait(Traits.Feature, Traits.Features.Completion)]
158161
public void CtrlAltSpaceOption(bool showCompletionInArgumentLists)
159162
{
160163
VisualStudio.Workspace.SetTriggerCompletionInArgumentLists(showCompletionInArgumentLists);

src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<TargetFrameworks>netcoreapp3.1;netstandard2.0</TargetFrameworks>
99
<DefineConstants>$(DefineConstants);WORKSPACE</DefineConstants>
1010
<GeneratePerformanceSensitiveAttribute>true</GeneratePerformanceSensitiveAttribute>
11+
<ApplyNgenOptimization>partial</ApplyNgenOptimization>
1112

1213
<!-- NuGet -->
1314
<IsPackable>true</IsPackable>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#nullable enable
6+
7+
using System;
8+
using System.Runtime.InteropServices;
9+
using Roslyn.Utilities;
10+
11+
namespace Microsoft.CodeAnalysis.Shared.Extensions
12+
{
13+
internal static class SafeHandleExtensions
14+
{
15+
/// <summary>
16+
/// Acquires a lease on a safe handle. The lease increments the reference count of the <see cref="SafeHandle"/>
17+
/// to ensure the handle is not released prior to the lease being released.
18+
/// </summary>
19+
/// <remarks>
20+
/// This method is intended to be used in the initializer of a <c>using</c> statement. Failing to release the
21+
/// lease will permanently prevent the underlying <see cref="SafeHandle"/> from being released by the garbage
22+
/// collector.
23+
/// </remarks>
24+
/// <param name="handle">The <see cref="SafeHandle"/> to lease.</param>
25+
/// <returns>A <see cref="SafeHandleLease"/>, which must be disposed to release the resource.</returns>
26+
/// <exception cref="ObjectDisposedException">If the lease could not be acquired.</exception>
27+
public static SafeHandleLease Lease(this SafeHandle handle)
28+
{
29+
RoslynDebug.AssertNotNull(handle);
30+
31+
var success = false;
32+
try
33+
{
34+
handle.DangerousAddRef(ref success);
35+
if (!success)
36+
throw new ObjectDisposedException(handle.GetType().FullName);
37+
38+
return new SafeHandleLease(handle);
39+
}
40+
catch
41+
{
42+
if (success)
43+
handle.DangerousRelease();
44+
45+
throw;
46+
}
47+
}
48+
}
49+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#nullable enable
6+
7+
using System;
8+
using System.Runtime.InteropServices;
9+
10+
namespace Microsoft.CodeAnalysis.Shared.Extensions
11+
{
12+
/// <summary>
13+
/// Represents a lease of a <see cref="SafeHandle"/>.
14+
/// </summary>
15+
/// <seealso cref="SafeHandleExtensions.Lease"/>
16+
internal readonly struct SafeHandleLease : IDisposable
17+
{
18+
private readonly SafeHandle? _handle;
19+
20+
internal SafeHandleLease(SafeHandle handle)
21+
=> _handle = handle;
22+
23+
/// <summary>
24+
/// Releases the <see cref="SafeHandle"/> lease. The behavior of this method is unspecified if called more than
25+
/// once.
26+
/// </summary>
27+
public void Dispose()
28+
=> _handle?.DangerousRelease();
29+
}
30+
}
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#nullable enable
6+
7+
using System.Diagnostics.CodeAnalysis;
8+
using Microsoft.CodeAnalysis.Shared.Extensions;
9+
using SQLitePCL;
10+
11+
namespace Microsoft.CodeAnalysis.SQLite.Interop
12+
{
13+
[SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Name chosen to match SQLitePCL.raw")]
14+
internal static class NativeMethods
15+
{
16+
public static SafeSqliteHandle sqlite3_open_v2(string filename, int flags, string vfs, out Result result)
17+
{
18+
result = (Result)raw.sqlite3_open_v2(filename, out var wrapper, flags, vfs);
19+
if (result != Result.OK)
20+
{
21+
wrapper = null;
22+
}
23+
24+
try
25+
{
26+
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
27+
// will be true when the handle is not usable, but the handle instance can be disposed either way.
28+
return new SafeSqliteHandle(wrapper);
29+
}
30+
catch
31+
{
32+
raw.sqlite3_close(wrapper);
33+
throw;
34+
}
35+
}
36+
37+
public static SafeSqliteStatementHandle sqlite3_prepare_v2(SafeSqliteHandle db, string sql, out Result result)
38+
{
39+
using var _ = db.Lease();
40+
41+
result = (Result)raw.sqlite3_prepare_v2(db.DangerousGetHandle(), sql, out var wrapper);
42+
if (result != (int)Result.OK)
43+
{
44+
wrapper = null;
45+
}
46+
47+
try
48+
{
49+
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
50+
// will be true when the handle is not usable, but the handle instance can be disposed either way.
51+
return new SafeSqliteStatementHandle(db, wrapper);
52+
}
53+
catch
54+
{
55+
raw.sqlite3_finalize(wrapper);
56+
throw;
57+
}
58+
}
59+
60+
public static SafeSqliteBlobHandle sqlite3_blob_open(SafeSqliteHandle db, string sdb, string table, string col, long rowid, int flags, out Result result)
61+
{
62+
using var _ = db.Lease();
63+
64+
result = (Result)raw.sqlite3_blob_open(db.DangerousGetHandle(), sdb, table, col, rowid, flags, out var wrapper);
65+
if (result != (int)Result.OK)
66+
{
67+
wrapper = null;
68+
}
69+
70+
try
71+
{
72+
// Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid
73+
// will be true when the handle is not usable, but the handle instance can be disposed either way.
74+
return new SafeSqliteBlobHandle(db, wrapper);
75+
}
76+
catch
77+
{
78+
raw.sqlite3_blob_close(wrapper);
79+
throw;
80+
}
81+
}
82+
83+
public static string sqlite3_errmsg(SafeSqliteHandle db)
84+
{
85+
using var _ = db.Lease();
86+
return raw.sqlite3_errmsg(db.DangerousGetHandle());
87+
}
88+
89+
public static string sqlite3_errstr(int rc)
90+
{
91+
return raw.sqlite3_errstr(rc);
92+
}
93+
94+
public static int sqlite3_extended_errcode(SafeSqliteHandle db)
95+
{
96+
using var _ = db.Lease();
97+
return raw.sqlite3_extended_errcode(db.DangerousGetHandle());
98+
}
99+
100+
public static Result sqlite3_busy_timeout(SafeSqliteHandle db, int ms)
101+
{
102+
using var _ = db.Lease();
103+
return (Result)raw.sqlite3_busy_timeout(db.DangerousGetHandle(), ms);
104+
}
105+
106+
public static long sqlite3_last_insert_rowid(SafeSqliteHandle db)
107+
{
108+
using var _ = db.Lease();
109+
return raw.sqlite3_last_insert_rowid(db.DangerousGetHandle());
110+
}
111+
112+
public static int sqlite3_blob_bytes(SafeSqliteBlobHandle blob)
113+
{
114+
using var _ = blob.Lease();
115+
return raw.sqlite3_blob_bytes(blob.DangerousGetHandle());
116+
}
117+
118+
public static Result sqlite3_blob_read(SafeSqliteBlobHandle blob, byte[] b, int n, int offset)
119+
{
120+
using var _ = blob.Lease();
121+
return (Result)raw.sqlite3_blob_read(blob.DangerousGetHandle(), b, n, offset);
122+
}
123+
124+
public static Result sqlite3_reset(SafeSqliteStatementHandle stmt)
125+
{
126+
using var _ = stmt.Lease();
127+
return (Result)raw.sqlite3_reset(stmt.DangerousGetHandle());
128+
}
129+
130+
public static Result sqlite3_step(SafeSqliteStatementHandle stmt)
131+
{
132+
using var _ = stmt.Lease();
133+
return (Result)raw.sqlite3_step(stmt.DangerousGetHandle());
134+
}
135+
136+
public static Result sqlite3_bind_text(SafeSqliteStatementHandle stmt, int index, string val)
137+
{
138+
using var _ = stmt.Lease();
139+
return (Result)raw.sqlite3_bind_text(stmt.DangerousGetHandle(), index, val);
140+
}
141+
142+
public static Result sqlite3_bind_int64(SafeSqliteStatementHandle stmt, int index, long val)
143+
{
144+
using var _ = stmt.Lease();
145+
return (Result)raw.sqlite3_bind_int64(stmt.DangerousGetHandle(), index, val);
146+
}
147+
148+
public static byte[] sqlite3_column_blob(SafeSqliteStatementHandle stmt, int index)
149+
{
150+
using var _ = stmt.Lease();
151+
return raw.sqlite3_column_blob(stmt.DangerousGetHandle(), index);
152+
}
153+
154+
public static int sqlite3_column_int(SafeSqliteStatementHandle stmt, int index)
155+
{
156+
using var _ = stmt.Lease();
157+
return raw.sqlite3_column_int(stmt.DangerousGetHandle(), index);
158+
}
159+
160+
public static long sqlite3_column_int64(SafeSqliteStatementHandle stmt, int index)
161+
{
162+
using var _ = stmt.Lease();
163+
return raw.sqlite3_column_int64(stmt.DangerousGetHandle(), index);
164+
}
165+
166+
public static string sqlite3_column_text(SafeSqliteStatementHandle stmt, int index)
167+
{
168+
using var _ = stmt.Lease();
169+
return raw.sqlite3_column_text(stmt.DangerousGetHandle(), index);
170+
}
171+
}
172+
}

0 commit comments

Comments
 (0)