Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on language-service integration rewrite #4419

Merged
merged 71 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e91a1fb
Rename ILanguageServiceHost -> IActiveWorkspaceProjectContextHost
davkean Sep 20, 2018
35c6402
Add IWorkspaceProjectContextHost
davkean Sep 20, 2018
75ab36f
Merge pull request #4046 from davkean/ActiveContext
davkean Sep 20, 2018
1af85aa
Merge pull request #4047 from davkean/MoveContext
davkean Sep 20, 2018
bc7c4c6
Stop using IWorkspaceProjectContext version of the project file name
davkean Sep 21, 2018
fcbf662
Stop using IWorkspaceProjectContext version of the project file name
davkean Sep 21, 2018
95e3dc9
Add IWorkspaceProjectContextAccessor
davkean Oct 10, 2018
5d5cd2b
Remove ForgroundWorkspaceProjectContext in lieu of check in accessor
davkean Oct 10, 2018
b9efb0d
Move active context registration to WorkspaceContextHostInstance
davkean Oct 10, 2018
e0322bc
Add Task<T> overload for ExecuteUnderLockAsync
davkean Oct 11, 2018
477fc48
Add Task<T> overload for OpenContextForWriteAsync
davkean Oct 11, 2018
11ba391
Merge pull request #4098 from davkean/1_ProjectAccessor
davkean Oct 11, 2018
ce49d0f
Merge IActiveWorkspaceProjectContextHost and IWorkspaceProjectContext…
davkean Oct 11, 2018
9f52e74
Merge pull request #4049 from davkean/RemoveFileName
davkean Oct 15, 2018
f4d0872
Merge pull request #4103 from davkean/MergeActiveContext
davkean Oct 16, 2018
ac635be
Remove thread-safeness from ApplyChangesToWorkspaceContext
davkean Oct 29, 2018
79d7b4a
Make IApplyChangesToWorkspaceContext async
davkean Oct 29, 2018
bac82af
Merge pull request #4187 from davkean/ApplyWorkspaceContext
davkean Oct 29, 2018
9f343e2
Merge pull request #4188 from davkean/AddAsync
davkean Oct 29, 2018
d4ac2ee
merge features/languageservice -> master
davkean Nov 7, 2018
b1607c0
Fix build breaks after merge
davkean Nov 7, 2018
5f50054
Populate/Dispose context on a background thread
davkean Nov 7, 2018
3c827dd
Remove usage of AbstractProject
davkean Nov 7, 2018
6db5465
Merge pull request #4229 from davkean/BackgroundThread
davkean Nov 7, 2018
2c36e1c
Wrap context usage in a batch
davkean Nov 7, 2018
2bd245c
Merge pull request #4230 from davkean/RemoveAbstractProjectUsage
davkean Nov 7, 2018
f74381b
Merge pull request #4228 from davkean/Batch
davkean Nov 7, 2018
834b4e8
Wrap context usage in a batch
davkean Nov 7, 2018
f3126f3
Release context on UI-thread
davkean Nov 7, 2018
a81eb44
Avoid UI-thread check through accessor
davkean Nov 7, 2018
21e69b7
Merge pull request #4234 from davkean/ThreadAffinity
davkean Nov 8, 2018
8222414
Add command-line handler for F#
davkean Nov 12, 2018
bbd6512
IActiveWorkspaceProjectContextTracker -> IActiveEditorContextTracker.
davkean Nov 9, 2018
d263c51
Merge pull request #4251 from davkean/EditorContext
davkean Nov 12, 2018
1b3f03a
Merge pull request #4259 from davkean/FSharp
davkean Nov 13, 2018
243291b
Use JoinableTaskCollection instead of JoinableTaskQueue
davkean Nov 14, 2018
a6efba4
Merge pull request #4272 from davkean/UseJoinableTaskCollection
davkean Nov 14, 2018
98983ea
AbstractMultiLifeComponent -> AbstractMultiLifeComponent<T>
davkean Nov 14, 2018
89c1192
IWorkspaceProjectContextHost.Loaded -> PublishAsync
davkean Nov 14, 2018
e3471a1
Run continuations async
davkean Dec 3, 2018
b75697c
Fix spelling mistake
davkean Dec 3, 2018
3107184
Rename PublishInstanceAsync -> WaitForLoadedAsync
davkean Dec 3, 2018
8967793
Merge pull request #4273 from davkean/Loaded
davkean Dec 6, 2018
cd15eb2
Document different "active" contexts
davkean Dec 6, 2018
16f011d
Update src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem…
drewnoakes Dec 6, 2018
86edb0c
OperationCanceledException should have correct CancellationToken
davkean Dec 10, 2018
5adc08f
Merge pull request #4354 from davkean/BlockOnOpen
davkean Dec 10, 2018
cf8f247
Use "real" hierarchy for Razor
davkean Dec 10, 2018
df9ed42
Fix spelling mistake
davkean Dec 10, 2018
202803e
Merge pull request #4360 from davkean/FixSpelling
davkean Dec 10, 2018
b102468
Remove old-language service integration
davkean Dec 10, 2018
958da61
Merge pull request #4359 from davkean/Hierarchy
davkean Dec 10, 2018
de288fd
Merge pull request #4358 from davkean/Cancellation
davkean Dec 10, 2018
2d2bc16
Merge pull request #4241 from davkean/RemoveOldLanguageService
davkean Dec 10, 2018
251df7e
Replace LanguageService2 -> LanguageService capability
davkean Dec 10, 2018
3873bc3
Merge pull request #4361 from davkean/Capability
davkean Dec 11, 2018
f6f2491
Add an implemention IActiveWorkspaceProjectContext
davkean Dec 13, 2018
444bffe
Ensure language service is initialized before project load
davkean Dec 13, 2018
34824a4
Doc exception
davkean Dec 16, 2018
82c6ef0
Merge pull request #4380 from davkean/ActiveHost2
davkean Dec 16, 2018
b960a81
Allow design-time build logging to be turned on Dev16/suffixes
davkean Dec 24, 2018
b707f92
Make sure to apply changes under batch
davkean Dec 24, 2018
6da6555
Remove unneeded async state machine
davkean Dec 24, 2018
217149b
Merge pull request #4412 from davkean/DesignTimeBuildLoggingForDev16
davkean Dec 24, 2018
90be1b8
Merge pull request #4413 from davkean/UnderBatch
davkean Dec 27, 2018
7351797
Block publishing language-service until active config has been determ…
davkean Dec 28, 2018
83b5c96
Merge features/languageservice -> master
davkean Dec 28, 2018
e4b0c17
Fix build errors/warning after merge
davkean Dec 28, 2018
811cb75
merge upstream/master
davkean Dec 29, 2018
a7e646f
Doing multiple builds in a row would cause Visual Studio to OOM
davkean Dec 29, 2018
196a145
Always return a value for ActiveIntellisenseProjectContext
davkean Jan 4, 2019
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
26 changes: 16 additions & 10 deletions docs/repo/content/DesignTimeBuildOutputPane.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ setlocal EnableDelayedExpansion
set DesignTimeBuildOutputPane=1
set BatchFile=%0

if not exist "%VS150COMNTOOLS%" (
if not exist "%VSINSTALLDIR%" (
echo This script needs to be run from an elevated Visual Studio 2017 developer command prompt.
exit /b 1
)
Expand All @@ -22,19 +22,25 @@ if "%DesignTimeBuildOutputPane%" == "0" (echo Disabling design-time build loggin
set InstalledVSInstances=%ProgramData%\Microsoft\VisualStudio\Packages\_Instances
for /F %%d in ('dir /B /D "%InstalledVSInstances%"') do (

set VSInstance=%VisualStudioVersion%_%%d
set VSRegistryHive=%LOCALAPPDATA%\Microsoft\VisualStudio\!VSInstance!\privateregistry.bin
for %%x in (%%d %%dExp %%dRoslynDev) do (

set VSInstance=%VisualStudioVersion%_%%x%
set VSRegistryHive=%LOCALAPPDATA%\Microsoft\VisualStudio\!VSInstance!\privateregistry.bin

if exist "!VSRegistryHive!" (

echo !VSInstance!
echo !VSInstance!

REM Import this VS instance's private registry into HKLM so that we can manipulate it
reg load HKLM\VS !VSRegistryHive! > nul || goto :Fail
REM Import this VS instance's private registry into HKLM so that we can manipulate it
reg load HKLM\VS !VSRegistryHive! > nul || goto :Fail

REM Set the registry key
reg add HKLM\VS\Software\Microsoft\VisualStudio\!VSInstance!\CPS\ /v "Design-time Build Logging" /t REG_DWORD /d %DesignTimeBuildOutputPane% /f > nul || goto :Fail
REM Set the registry key
reg add HKLM\VS\Software\Microsoft\VisualStudio\!VSInstance!\CPS\ /v "Design-time Build Logging" /t REG_DWORD /d %DesignTimeBuildOutputPane% /f > nul || goto :Fail

REM Make sure we unload it, otherwise, VS will never start again
reg unload HKLM\VS > nul || goto :Fail
REM Make sure we unload it, otherwise, VS will never start again
reg unload HKLM\VS > nul || goto :Fail
)
)
)
echo.
echo Done.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\HostAgnostic.props"/>
<Import Project="..\HostAgnostic.props" />
<PropertyGroup>
<RootNamespace>Microsoft.VisualStudio</RootNamespace>
<!-- The value of RuleInjectionClassName of XamlPropertyRule items defined by this project -->
Expand All @@ -10,7 +10,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.FSharp.VS" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.FSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.FSharp.VS.UnitTests" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)"/>
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Threading;

Expand All @@ -14,14 +15,14 @@ public static MultiLifetimeComponent Create()
return new MultiLifetimeComponent(joinableTaskContextNode);
}

public class MultiLifetimeComponent : AbstractMultiLifetimeComponent
public class MultiLifetimeComponent : AbstractMultiLifetimeComponent<MultiLifetimeComponent.MultiLifetimeInstance>
{
public MultiLifetimeComponent(JoinableTaskContextNode joinableTaskContextNode)
: base(joinableTaskContextNode)
{
}

protected override IMultiLifetimeInstance CreateInstance()
protected override MultiLifetimeInstance CreateInstance()
{
return new MultiLifetimeInstance();
}
Expand All @@ -31,6 +32,11 @@ protected override IMultiLifetimeInstance CreateInstance()
get { return base.IsInitialized; }
}

public new Task<MultiLifetimeInstance> WaitForLoadedAsync(CancellationToken cancellationToken = default)
{
return base.WaitForLoadedAsync(cancellationToken);
}

public class MultiLifetimeInstance : IMultiLifetimeInstance
{
public bool IsInitialized
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;

using Microsoft.VisualStudio.LanguageServices.ProjectSystem;

using Moq;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices
{
internal static class IActiveEditorContextTrackerFactory
{
public static IActiveEditorContextTracker Create()
{
return Mock.Of<IActiveEditorContextTracker>();
}

public static IActiveEditorContextTracker ImplementIsActiveEditorContext(Func<IWorkspaceProjectContext, bool> action)
{
var mock = new Mock<IActiveEditorContextTracker>();
mock.Setup(t => t.IsActiveEditorContext(It.IsAny<IWorkspaceProjectContext>()))
.Returns(action);

return mock.Object;
}

public static IActiveEditorContextTracker ImplementReleaseContext(Action<IWorkspaceProjectContext> action)
{
var mock = new Mock<IActiveEditorContextTracker>();
mock.Setup(t => t.UnregisterContext(It.IsAny<IWorkspaceProjectContext>()))
.Callback(action);

return mock.Object;
}

public static IActiveEditorContextTracker ImplementRegisterContext(Action<IWorkspaceProjectContext, string> action)
{
var mock = new Mock<IActiveEditorContextTracker>();
mock.Setup(t => t.RegisterContext(It.IsAny<IWorkspaceProjectContext>(), It.IsAny<string>()))
.Callback(action);

return mock.Object;
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System;
using System.Threading;
using System.Threading.Tasks;
using Moq;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices
Expand All @@ -13,20 +14,22 @@ public static IApplyChangesToWorkspaceContext Create()
return Mock.Of<IApplyChangesToWorkspaceContext>();
}

public static IApplyChangesToWorkspaceContext ImplementApplyProjectBuild(Action<IProjectVersionedValue<IProjectSubscriptionUpdate>, bool, CancellationToken> action)
public static IApplyChangesToWorkspaceContext ImplementApplyProjectBuildAsync(Action<IProjectVersionedValue<IProjectSubscriptionUpdate>, bool, CancellationToken> action)
{
var mock = new Mock<IApplyChangesToWorkspaceContext>();
mock.Setup(c => c.ApplyProjectBuild(It.IsAny<IProjectVersionedValue<IProjectSubscriptionUpdate>>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Callback(action);
mock.Setup(c => c.ApplyProjectBuildAsync(It.IsAny<IProjectVersionedValue<IProjectSubscriptionUpdate>>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Callback(action)
.Returns(Task.CompletedTask);

return mock.Object;
}

public static IApplyChangesToWorkspaceContext ImplementApplyProjectEvaluation(Action<IProjectVersionedValue<IProjectSubscriptionUpdate>, bool, CancellationToken> action)
public static IApplyChangesToWorkspaceContext ImplementApplyProjectEvaluationAsync(Action<IProjectVersionedValue<IProjectSubscriptionUpdate>, bool, CancellationToken> action)
{
var mock = new Mock<IApplyChangesToWorkspaceContext>();
mock.Setup(c => c.ApplyProjectEvaluation(It.IsAny<IProjectVersionedValue<IProjectSubscriptionUpdate>>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Callback(action);
mock.Setup(c => c.ApplyProjectEvaluationAsync(It.IsAny<IProjectVersionedValue<IProjectSubscriptionUpdate>>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Callback(action)
.Returns(Task.CompletedTask);

return mock.Object;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.VisualStudio.LanguageServices.ProjectSystem;
using Moq;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices
{
internal static class IWorkspaceProjectContextAccessorFactory
{
public static IWorkspaceProjectContextAccessor ImplementContext(IWorkspaceProjectContext context, string contextId = null)
{
var mock = new Mock<IWorkspaceProjectContextAccessor>();

mock.Setup(c => c.Context)
.Returns(context);

mock.Setup(c => c.ContextId)
.Returns(contextId);

return mock.Object;
}

public static IWorkspaceProjectContextAccessor ImplementHostSpecificErrorReporter(Func<object> action)
{
var mock = new Mock<IWorkspaceProjectContextAccessor>();

mock.SetupGet(c => c.HostSpecificErrorReporter)
.Returns(action);

return mock.Object;
}

public static IWorkspaceProjectContextAccessor Create()
{
var context = IWorkspaceProjectContextMockFactory.Create();

return ImplementContext(context);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.VisualStudio.LanguageServices.ProjectSystem;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices
{
internal static class IWorkspaceProjectContextProviderFactory
Expand All @@ -11,11 +9,11 @@ public static IWorkspaceProjectContextProvider Create()
return new WorkspaceProjectContextProviderMock().Object;
}

public static IWorkspaceProjectContextProvider ImplementCreateProjectContextAsync(IWorkspaceProjectContext context)
public static IWorkspaceProjectContextProvider ImplementCreateProjectContextAsync(IWorkspaceProjectContextAccessor accessor)
{
var mock = new WorkspaceProjectContextProviderMock();

mock.ImplementCreateProjectContextAsync(project => context);
mock.ImplementCreateProjectContextAsync(project => accessor);

return mock.Object;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.VisualStudio.LanguageServices.ProjectSystem;

using Moq;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices
{
internal class WorkspaceProjectContextProviderMock : AbstractMock<IWorkspaceProjectContextProvider>
{
public WorkspaceProjectContextProviderMock ImplementCreateProjectContextAsync(Func<ConfiguredProject, IWorkspaceProjectContext> action)
public WorkspaceProjectContextProviderMock ImplementCreateProjectContextAsync(Func<ConfiguredProject, IWorkspaceProjectContextAccessor> action)
{
Setup(m => m.CreateProjectContextAsync(It.IsAny<ConfiguredProject>()))
.ReturnsAsync(action);

return this;
}

public WorkspaceProjectContextProviderMock ImplementReleaseProjectContextAsync(Action<IWorkspaceProjectContext> action)
public WorkspaceProjectContextProviderMock ImplementReleaseProjectContextAsync(Action<IWorkspaceProjectContextAccessor> action)
{
Setup(m => m.ReleaseProjectContextAsync(It.IsAny<IWorkspaceProjectContext>()))
Setup(m => m.ReleaseProjectContextAsync(It.IsAny<IWorkspaceProjectContextAccessor>()))
.ReturnsAsync(action);

return this;
Expand Down
Loading