Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
c6ffdb62
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c6ffdb62
编写于
4月 08, 2015
作者:
L
latkin
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into fsharp4
上级
266f5f27
b7485334
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
65 addition
and
3 deletion
+65
-3
vsintegration/src/unittests/TestLib.ProjectSystem.fs
vsintegration/src/unittests/TestLib.ProjectSystem.fs
+1
-1
vsintegration/src/unittests/Tests.ProjectSystem.Project.fs
vsintegration/src/unittests/Tests.ProjectSystem.Project.fs
+62
-0
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs
+2
-2
未找到文件。
vsintegration/src/unittests/TestLib.ProjectSystem.fs
浏览文件 @
c6ffdb62
...
@@ -170,7 +170,7 @@ type TheTests() =
...
@@ -170,7 +170,7 @@ type TheTests() =
|
x
->
x
|
x
->
x
match
TryFind
node
with
match
TryFind
node
with
|
Some
(
x
)
->
x
|
Some
(
x
)
->
x
|
None
->
failwith
"did not find node with caption %s"
caption
|
None
->
failwith
f
"did not find node with caption %s"
caption
static
member
MoveDown
(
node
:
HierarchyNode
)
=
static
member
MoveDown
(
node
:
HierarchyNode
)
=
match
node
with
match
node
with
...
...
vsintegration/src/unittests/Tests.ProjectSystem.Project.fs
浏览文件 @
c6ffdb62
...
@@ -695,6 +695,68 @@ type Project() =
...
@@ -695,6 +695,68 @@ type Project() =
File.Delete(absFilePath)
File.Delete(absFilePath)
))
))
[<Test>] //ref bug https://github.com/Microsoft/visualfsharp/issues/259
member public this.``RenameFile.InFolder``() =
this.MakeProjectAndDo(["
file1
.
fs
"; @"
Folder1
\
file2
.
fs
"; @"
Folder1
\
nested1
.
fs
"], [], "", (fun project ->
let absFilePath = Path.Combine(project.ProjectFolder, "
Folder1
", "
nested1
.
fs
")
try
Directory.CreateDirectory(Path.GetDirectoryName(absFilePath)) |> ignore;
File.AppendAllText(absFilePath, "
#
light
")
let orig1 = TheTests.FindNodeWithCaption(project, "
nested1
.
fs
")
let folder1 = TheTests.FindNodeWithCaption(project, "
Folder1
")
VsMocks.vsRunningDocumentTableFindAndLockDocumentVsHierarchyMock <- project
let added, deleted = ResizeArray(), ResizeArray()
let sink =
{ new IVsHierarchyEvents with
member x.OnInvalidateIcon _hicon = VSConstants.S_OK
member x.OnInvalidateItems _itemidParent = VSConstants.S_OK
member x.OnItemAdded (itemidParent, itemidSiblingPrev, itemidAdded) =
added.Add(itemidParent, itemidSiblingPrev, itemidAdded)
VSConstants.S_OK
member x.OnItemDeleted (itemid) =
deleted.Add(itemid)
VSConstants.S_OK
member x.OnItemsAppended (itemidParent) =
VSConstants.S_OK
member x.OnPropertyChanged (itemid, propid, flags) =
VSConstants.S_OK }
let cookie = ref 0u
project.AdviseHierarchyEvents(sink, cookie) |> ErrorHandler.ThrowOnFailure |> ignore
// rename the file
orig1.SetEditLabel("
renamedNested2
.
fs
") |> ErrorHandler.ThrowOnFailure |> ignore
SaveProject project
let file2 = TheTests.FindNodeWithCaption (project, "
file2
.
fs
")
let renamedNested2 = TheTests.FindNodeWithCaption (project, "
renamedNested2
.
fs
")
AssertEqual [ folder1.ID, file2.ID, renamedNested2.ID ] (added |> Seq.distinct |> List.ofSeq)
AssertEqual [ orig1.ID ] (deleted |> Seq.distinct |> List.ofSeq)
// TODO ensure IVsTrackProjectDocumentsEvents Renamed was fired
// ensure right in .fsproj
let msbuildInfo = TheTests.MsBuildCompileItems(project.BuildProject)
AssertEqual ["
file1
.
fs
"; @"
Folder1
\
file2
.
fs
"; @"
Folder1
\
renamedNested2
.
fs
"] msbuildInfo
// ensure right in solution explorer
let expect =
Tree("
References
", ANYTREE,
Tree("
file1
.
fs
", Nil,
Tree("
Folder1
",
Tree("
file2
.
fs
", Nil,
Tree("
renamedNested2
.
fs
", Nil, Nil)),
Nil)))
TheTests.AssertSameTree (expect, project.FirstChild)
finally
if File.Exists(absFilePath) then File.Delete(absFilePath)
))
[<Test>]
[<Test>]
member public this.``RenameFile.BuildActionIsResetBasedOnFilenameExtension``() =
member public this.``RenameFile.BuildActionIsResetBasedOnFilenameExtension``() =
let GetTextFromBuildAction (action:VSLangProj.prjBuildAction) =
let GetTextFromBuildAction (action:VSLangProj.prjBuildAction) =
...
...
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs
浏览文件 @
c6ffdb62
...
@@ -2663,7 +2663,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g.
...
@@ -2663,7 +2663,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g.
nodeBeforeMe.NextSibling <- lastNode
nodeBeforeMe.NextSibling <- lastNode
lastNode.NextSibling <- thisNode
lastNode.NextSibling <- thisNode
root.OnItemAdded(
roo
t, lastNode)
root.OnItemAdded(
lastNode.Paren
t, lastNode)
lastNode :?> FSharpFileNode
lastNode :?> FSharpFileNode
/// In solution explorer, move the last of my siblings to just below me, return the moved FSharpFileNode
/// In solution explorer, move the last of my siblings to just below me, return the moved FSharpFileNode
...
@@ -2682,7 +2682,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g.
...
@@ -2682,7 +2682,7 @@ See also ...\SetupAuthoring\FSharp\Registry\FSProjSys_Registration.wxs, e.g.
let tmp = target.NextSibling
let tmp = target.NextSibling
target.NextSibling <- lastNode
target.NextSibling <- lastNode
lastNode.NextSibling <- tmp
lastNode.NextSibling <- tmp
root.OnItemAdded(
roo
t, lastNode)
root.OnItemAdded(
lastNode.Paren
t, lastNode)
lastNode :?> FSharpFileNode
lastNode :?> FSharpFileNode
override x.ExecCommandOnNode(guidCmdGroup:Guid, cmd:uint32, nCmdexecopt:uint32, pvaIn:IntPtr, pvaOut:IntPtr ) =
override x.ExecCommandOnNode(guidCmdGroup:Guid, cmd:uint32, nCmdexecopt:uint32, pvaIn:IntPtr, pvaOut:IntPtr ) =
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录