Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8348d2fd
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8348d2fd
编写于
9月 29, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt a bit more uriIdentityService
上级
3593945f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
7 deletion
+11
-7
src/vs/workbench/contrib/scm/browser/activity.ts
src/vs/workbench/contrib/scm/browser/activity.ts
+5
-3
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
+6
-4
未找到文件。
src/vs/workbench/contrib/scm/browser/activity.ts
浏览文件 @
8348d2fd
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
localize
}
from
'
vs/nls
'
;
import
{
basename
,
relativePath
}
from
'
vs/base/common/resources
'
;
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
IDisposable
,
dispose
,
Disposable
,
DisposableStore
,
combinedDisposable
,
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
VIEW_PANE_ID
,
ISCMService
,
ISCMRepository
}
from
'
vs/workbench/contrib/scm/common/scm
'
;
...
...
@@ -15,6 +15,7 @@ import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment }
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
EditorResourceAccessor
}
from
'
vs/workbench/common/editor
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
function
getCount
(
repository
:
ISCMRepository
):
number
{
if
(
typeof
repository
.
provider
.
count
===
'
number
'
)
{
...
...
@@ -39,7 +40,8 @@ export class SCMStatusController implements IWorkbenchContribution {
@
IContextKeyService
readonly
contextKeyService
:
IContextKeyService
,
@
IActivityService
private
readonly
activityService
:
IActivityService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IUriIdentityService
private
readonly
uriIdentityService
:
IUriIdentityService
)
{
this
.
focusedProviderContextKey
=
contextKeyService
.
createKey
<
string
|
undefined
>
(
'
scmProvider
'
,
undefined
);
this
.
scmService
.
onDidAddRepository
(
this
.
onDidAddRepository
,
this
,
this
.
disposables
);
...
...
@@ -73,7 +75,7 @@ export class SCMStatusController implements IWorkbenchContribution {
continue
;
}
const
path
=
relativePath
(
root
,
resource
);
const
path
=
this
.
uriIdentityService
.
extUri
.
relativePath
(
root
,
resource
);
if
(
path
&&
!
/^
\.\.
/
.
test
(
path
)
&&
path
.
length
<
bestMatchLength
)
{
bestRepository
=
repository
;
...
...
src/vs/workbench/contrib/scm/browser/scmViewPane.ts
浏览文件 @
8348d2fd
...
...
@@ -5,7 +5,7 @@
import
'
vs/css!./media/scm
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
basename
,
dirname
,
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
basename
,
dirname
}
from
'
vs/base/common/resources
'
;
import
{
IDisposable
,
Disposable
,
DisposableStore
,
combinedDisposable
,
dispose
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ViewPane
,
IViewPaneOptions
}
from
'
vs/workbench/browser/parts/views/viewPaneContainer
'
;
import
{
append
,
$
,
Dimension
}
from
'
vs/base/browser/dom
'
;
...
...
@@ -76,6 +76,7 @@ import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
import
{
RepositoryRenderer
}
from
'
vs/workbench/contrib/scm/browser/scmRepositoryRenderer
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
ColorScheme
}
from
'
vs/platform/theme/common/theme
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
type
TreeElement
=
ISCMRepository
|
ISCMInput
|
ISCMResourceGroup
|
IResourceNode
<
ISCMResource
,
ISCMResourceGroup
>
|
ISCMResource
;
...
...
@@ -772,7 +773,8 @@ class ViewModel {
@
IInstantiationService
protected
instantiationService
:
IInstantiationService
,
@
IEditorService
protected
editorService
:
IEditorService
,
@
IConfigurationService
protected
configurationService
:
IConfigurationService
,
@
ISCMViewService
private
scmViewService
:
ISCMViewService
@
ISCMViewService
private
scmViewService
:
ISCMViewService
,
@
IUriIdentityService
private
uriIdentityService
:
IUriIdentityService
)
{
this
.
onDidChangeRepositoryCollapseState
=
Event
.
any
(
this
.
_onDidChangeRepositoryCollapseState
.
event
,
...
...
@@ -972,8 +974,8 @@ class ViewModel {
for
(
let
j
=
item
.
groupItems
.
length
-
1
;
j
>=
0
;
j
--
)
{
const
groupItem
=
item
.
groupItems
[
j
];
const
resource
=
this
.
mode
===
ViewModelMode
.
Tree
?
groupItem
.
tree
.
getNode
(
uri
)?.
element
:
groupItem
.
resources
.
find
(
r
=>
isEqual
(
r
.
sourceUri
,
uri
));
?
groupItem
.
tree
.
getNode
(
uri
)?.
element
// TODO@Joao URI identity?
:
groupItem
.
resources
.
find
(
r
=>
this
.
uriIdentityService
.
extUri
.
isEqual
(
r
.
sourceUri
,
uri
));
if
(
resource
)
{
this
.
tree
.
reveal
(
resource
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录