Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET
Roslyn
提交
713155f7
R
Roslyn
项目概览
dotNET
/
Roslyn
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
713155f7
编写于
6月 01, 2017
作者:
S
Sam Harwell
提交者:
GitHub
6月 01, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19919 from sharwell/invisible-project
Pass a project when creating an invisible editor
上级
694fcf75
2d8c4bdb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
5 deletion
+13
-5
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
...References/VisualStudioDefinitionsAndReferencesFactory.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/InvisibleEditor.cs
.../Core/Def/Implementation/ProjectSystem/InvisibleEditor.cs
+10
-2
src/VisualStudio/Core/Impl/CodeModel/TextManagerAdapter.cs
src/VisualStudio/Core/Impl/CodeModel/TextManagerAdapter.cs
+1
-1
src/VisualStudio/Core/Impl/RoslynVisualStudioWorkspace.cs
src/VisualStudio/Core/Impl/RoslynVisualStudioWorkspace.cs
+1
-1
未找到文件。
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
浏览文件 @
713155f7
...
...
@@ -64,7 +64,7 @@ public VisualStudioDefinitionsAndReferencesFactory(SVsServiceProvider servicePro
private
string
GetSourceLine
(
string
filePath
,
int
lineNumber
)
{
using
(
var
invisibleEditor
=
new
InvisibleEditor
(
_serviceProvider
,
filePath
,
needsSave
:
false
,
needsUndoDisabled
:
false
))
_serviceProvider
,
filePath
,
projectOpt
:
null
,
needsSave
:
false
,
needsUndoDisabled
:
false
))
{
var
vsTextLines
=
invisibleEditor
.
VsTextLines
;
if
(
vsTextLines
!=
null
&&
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/InvisibleEditor.cs
浏览文件 @
713155f7
...
...
@@ -28,15 +28,23 @@ internal partial class InvisibleEditor : IInvisibleEditor
private
OLE
.
Interop
.
IOleUndoManager
_manager
;
private
readonly
bool
_needsUndoRestored
;
public
InvisibleEditor
(
IServiceProvider
serviceProvider
,
string
filePath
,
bool
needsSave
,
bool
needsUndoDisabled
)
/// <remarks>
/// <para>The optional project is used to obtain an <see cref="IVsProject"/> 1nstance. When this instance is
/// provided, Visual Studio will use <see cref="IVsProject.IsDocumentInProject"/> to attempt to locate the
/// specified file within a project. If no project is specified, Visual Studio falls back to using
/// <see cref="IVsUIShellOpenDocument4.IsDocumentInAProject2"/>, which performs a much slower query of all
/// projects in the solution.</para>
/// </remarks>
public
InvisibleEditor
(
IServiceProvider
serviceProvider
,
string
filePath
,
IVisualStudioHostProject
projectOpt
,
bool
needsSave
,
bool
needsUndoDisabled
)
{
_serviceProvider
=
serviceProvider
;
_filePath
=
filePath
;
_needsSave
=
needsSave
;
var
invisibleEditorManager
=
(
IIntPtrReturningVsInvisibleEditorManager
)
serviceProvider
.
GetService
(
typeof
(
SVsInvisibleEditorManager
));
var
vsProject
=
projectOpt
?.
Hierarchy
as
IVsProject
;
var
invisibleEditorPtr
=
IntPtr
.
Zero
;
Marshal
.
ThrowExceptionForHR
(
invisibleEditorManager
.
RegisterInvisibleEditor
(
filePath
,
null
,
0
,
null
,
out
invisibleEditorPtr
));
Marshal
.
ThrowExceptionForHR
(
invisibleEditorManager
.
RegisterInvisibleEditor
(
filePath
,
vsProject
,
0
,
null
,
out
invisibleEditorPtr
));
try
{
...
...
src/VisualStudio/Core/Impl/CodeModel/TextManagerAdapter.cs
浏览文件 @
713155f7
...
...
@@ -17,7 +17,7 @@ public EnvDTE.TextPoint CreateTextPoint(FileCodeModel fileCodeModel, VirtualTree
return
null
;
}
using
(
var
invisibleEditor
=
new
InvisibleEditor
(
fileCodeModel
.
ServiceProvider
,
hostDocument
.
FilePath
,
needsSave
:
false
,
needsUndoDisabled
:
false
))
using
(
var
invisibleEditor
=
new
InvisibleEditor
(
fileCodeModel
.
ServiceProvider
,
hostDocument
.
FilePath
,
hostDocument
.
Project
,
needsSave
:
false
,
needsUndoDisabled
:
false
))
{
var
vsTextLines
=
invisibleEditor
.
VsTextLines
;
...
...
src/VisualStudio/Core/Impl/RoslynVisualStudioWorkspace.cs
浏览文件 @
713155f7
...
...
@@ -143,7 +143,7 @@ internal override IInvisibleEditor OpenInvisibleEditor(IVisualStudioHostDocument
}
}
return
new
InvisibleEditor
(
DeferredState
.
ServiceProvider
,
hostDocument
.
FilePath
,
needsSave
,
needsUndoDisabled
);
return
new
InvisibleEditor
(
DeferredState
.
ServiceProvider
,
hostDocument
.
FilePath
,
hostDocument
.
Project
,
needsSave
,
needsUndoDisabled
);
}
private
static
bool
TryResolveSymbol
(
ISymbol
symbol
,
Project
project
,
CancellationToken
cancellationToken
,
out
ISymbol
resolvedSymbol
,
out
Project
resolvedProject
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录