提交 f9a60489 编写于 作者: J Jason Malinowski

Decouple CommentTaskTokenSerializer from VisualStudioWorkspaceImpl

上级 2b7c357d
// 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 System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.TodoComments;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
......@@ -22,11 +21,12 @@ internal class CommentTaskTokenSerializer : IOptionPersister
[ImportingConstructor]
public CommentTaskTokenSerializer(
VisualStudioWorkspaceImpl workspace)
VisualStudioWorkspace workspace,
[Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
{
_optionService = workspace.Services.GetService<IOptionService>();
_taskList = workspace.GetVsService<SVsTaskList, ITaskList>();
_taskList = (ITaskList)serviceProvider.GetService(typeof(SVsTaskList));
_lastCommentTokenCache = GetTaskTokenList(_taskList);
// The SVsTaskList may not be available (e.g. during "devenv /build")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册