Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
dc0ab500
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,发现更多精彩内容 >>
提交
dc0ab500
编写于
10月 04, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use isEqual for comparing uris in more places vs .toString()
上级
7e70b1dd
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
24 addition
and
18 deletion
+24
-18
src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts
...s/editor/contrib/goToDefinition/goToDefinitionCommands.ts
+2
-1
src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts
...contrib/goToDefinition/goToDefinitionResultsNavigation.ts
+2
-1
src/vs/editor/contrib/gotoError/gotoError.ts
src/vs/editor/contrib/gotoError/gotoError.ts
+5
-4
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+2
-2
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
+2
-1
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+2
-2
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
...rkbench/contrib/preferences/browser/preferencesWidgets.ts
+4
-3
src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughInput.ts
...h/contrib/welcome/walkThrough/browser/walkThroughInput.ts
+3
-2
src/vs/workbench/services/editor/browser/editorService.ts
src/vs/workbench/services/editor/browser/editorService.ts
+2
-2
未找到文件。
src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts
浏览文件 @
dc0ab500
...
...
@@ -31,6 +31,7 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import
{
EditorStateCancellationTokenSource
,
CodeEditorStateFlag
}
from
'
vs/editor/browser/core/editorState
'
;
import
{
ISymbolNavigationService
}
from
'
vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
export
class
DefinitionActionConfig
{
...
...
@@ -84,7 +85,7 @@ export class DefinitionAction extends EditorAction {
}
const
newLen
=
result
.
push
(
reference
);
if
(
this
.
_configuration
.
filterCurrent
&&
reference
.
uri
.
toString
()
===
model
.
uri
.
toString
(
)
&&
isEqual
(
reference
.
uri
,
model
.
uri
)
&&
Range
.
containsPosition
(
reference
.
range
,
pos
)
&&
idxOfCurrent
===
-
1
)
{
...
...
src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts
浏览文件 @
dc0ab500
...
...
@@ -18,6 +18,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
localize
}
from
'
vs/nls
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
export
const
ctxHasSymbols
=
new
RawContextKey
(
'
hasSymbols
'
,
false
);
...
...
@@ -92,7 +93,7 @@ class SymbolNavigationService implements ISymbolNavigationService {
let
seenUri
:
boolean
=
false
;
let
seenPosition
:
boolean
=
false
;
for
(
const
reference
of
refModel
.
references
)
{
if
(
reference
.
uri
.
toString
()
===
model
.
uri
.
toString
(
))
{
if
(
isEqual
(
reference
.
uri
,
model
.
uri
))
{
seenUri
=
true
;
seenPosition
=
seenPosition
||
Range
.
containsPosition
(
reference
.
range
,
position
);
}
else
if
(
seenUri
)
{
...
...
src/vs/editor/contrib/gotoError/gotoError.ts
浏览文件 @
dc0ab500
...
...
@@ -26,6 +26,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
class
MarkerModel
{
...
...
@@ -310,7 +311,7 @@ export class MarkerController implements editorCommon.IEditorContribution {
}
private
_onMarkerChanged
(
changedResources
:
URI
[]):
void
{
le
t
editorModel
=
this
.
_editor
.
getModel
();
cons
t
editorModel
=
this
.
_editor
.
getModel
();
if
(
!
editorModel
)
{
return
;
}
...
...
@@ -319,7 +320,7 @@ export class MarkerController implements editorCommon.IEditorContribution {
return
;
}
if
(
!
changedResources
.
some
(
r
=>
editorModel
!
.
uri
.
toString
()
===
r
.
toString
(
)))
{
if
(
!
changedResources
.
some
(
r
=>
isEqual
(
editorModel
.
uri
,
r
)))
{
return
;
}
this
.
_model
.
setMarkers
(
this
.
_getMarkers
());
...
...
@@ -371,7 +372,7 @@ class MarkerNavigationAction extends EditorAction {
return
Promise
.
resolve
(
undefined
);
}
le
t
editorModel
=
editor
.
getModel
();
cons
t
editorModel
=
editor
.
getModel
();
if
(
!
editorModel
)
{
return
Promise
.
resolve
(
undefined
);
}
...
...
@@ -389,7 +390,7 @@ class MarkerNavigationAction extends EditorAction {
}
let
newMarker
=
markers
[
idx
];
if
(
newMarker
.
resource
.
toString
()
===
editorModel
!
.
uri
.
toString
(
))
{
if
(
isEqual
(
newMarker
.
resource
,
editorModel
.
uri
))
{
// the next `resource` is this resource which
// means we cycle within this file
model
.
move
(
this
.
_isNext
,
true
);
...
...
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
dc0ab500
...
...
@@ -10,7 +10,7 @@ import { Color } from 'vs/base/common/color';
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
dispose
,
IDisposable
,
IReference
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
basenameOrAuthority
,
dirname
}
from
'
vs/base/common/resources
'
;
import
{
basenameOrAuthority
,
dirname
,
isEqual
}
from
'
vs/base/common/resources
'
;
import
'
vs/css!./media/referencesWidget
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EmbeddedCodeEditorWidget
}
from
'
vs/editor/browser/widget/embeddedCodeEditorWidget
'
;
...
...
@@ -66,7 +66,7 @@ class DecorationsManager implements IDisposable {
const
model
=
this
.
_editor
.
getModel
();
if
(
model
)
{
for
(
const
ref
of
this
.
_model
.
groups
)
{
if
(
ref
.
uri
.
toString
()
===
model
.
uri
.
toString
(
))
{
if
(
isEqual
(
ref
.
uri
,
model
.
uri
))
{
this
.
_addDecorations
(
ref
);
return
;
}
...
...
src/vs/workbench/api/browser/mainThreadCodeInsets.ts
浏览文件 @
dc0ab500
...
...
@@ -12,6 +12,7 @@ import { IWebviewService, WebviewElement } from 'vs/workbench/contrib/webview/br
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IActiveCodeEditor
,
IViewZone
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
// todo@joh move these things back into something like contrib/insets
class
EditorWebviewZone
implements
IViewZone
{
...
...
@@ -75,7 +76,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
id
=
id
.
substr
(
0
,
id
.
indexOf
(
'
,
'
));
//todo@joh HACK
for
(
const
candidate
of
this
.
_editorService
.
listCodeEditors
())
{
if
(
candidate
.
getId
()
===
id
&&
candidate
.
hasModel
()
&&
candidate
.
getModel
()
!
.
uri
.
toString
()
===
URI
.
revive
(
uri
).
toString
(
))
{
if
(
candidate
.
getId
()
===
id
&&
candidate
.
hasModel
()
&&
isEqual
(
candidate
.
getModel
().
uri
,
URI
.
revive
(
uri
)
))
{
editor
=
candidate
;
break
;
}
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
dc0ab500
...
...
@@ -7,7 +7,7 @@ import 'vs/css!./media/editorstatus';
import
*
as
nls
from
'
vs/nls
'
;
import
{
runAtThisOrScheduleAtNextAnimationFrame
}
from
'
vs/base/browser/dom
'
;
import
{
format
}
from
'
vs/base/common/strings
'
;
import
{
extname
,
basename
}
from
'
vs/base/common/resources
'
;
import
{
extname
,
basename
,
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
areFunctions
,
withNullAsUndefined
,
withUndefinedAsNull
}
from
'
vs/base/common/types
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
...
...
@@ -794,7 +794,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
activeControl
=
this
.
editorService
.
activeControl
;
if
(
activeControl
)
{
const
activeResource
=
toResource
(
activeControl
.
input
,
{
supportSideBySide
:
SideBySideEditor
.
MASTER
});
if
(
activeResource
&&
activeResource
.
toString
()
===
resource
.
toString
(
))
{
if
(
activeResource
&&
isEqual
(
activeResource
,
resource
))
{
return
this
.
onEncodingChange
(
activeControl
);
// only update if the encoding changed for the active resource
}
}
...
...
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
浏览文件 @
dc0ab500
...
...
@@ -34,6 +34,7 @@ import { PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_INACTIV
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ISettingsGroup
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
export
class
SettingsHeaderWidget
extends
Widget
implements
IViewZone
{
...
...
@@ -387,7 +388,7 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
const
oldFolder
=
this
.
_folder
;
const
workspace
=
this
.
contextService
.
getWorkspace
();
if
(
oldFolder
)
{
this
.
_folder
=
workspace
.
folders
.
filter
(
folder
=>
folder
.
uri
.
toString
()
===
oldFolder
.
uri
.
toString
(
))[
0
]
||
workspace
.
folders
[
0
];
this
.
_folder
=
workspace
.
folders
.
filter
(
folder
=>
isEqual
(
folder
.
uri
,
oldFolder
.
uri
))[
0
]
||
workspace
.
folders
[
0
];
}
this
.
_folder
=
this
.
_folder
?
this
.
_folder
:
workspace
.
folders
.
length
===
1
?
workspace
.
folders
[
0
]
:
null
;
...
...
@@ -440,7 +441,7 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
return
<
IAction
>
{
id
:
'
folderSettingsTarget
'
+
index
,
label
:
this
.
labelWithCount
(
folder
.
name
,
folderCount
),
checked
:
this
.
folder
&&
this
.
folder
.
uri
.
toString
()
===
folder
.
uri
.
toString
(
),
checked
:
this
.
folder
&&
isEqual
(
this
.
folder
.
uri
,
folder
.
uri
),
enabled
:
true
,
run
:
()
=>
this
.
_action
.
run
(
folder
)
};
...
...
@@ -574,7 +575,7 @@ export class SettingsTargetsWidget extends Widget {
const
isSameTarget
=
this
.
settingsTarget
===
settingsTarget
||
settingsTarget
instanceof
URI
&&
this
.
settingsTarget
instanceof
URI
&&
this
.
settingsTarget
.
toString
()
===
settingsTarget
.
toString
(
);
isEqual
(
this
.
settingsTarget
,
settingsTarget
);
if
(
!
isSameTarget
)
{
this
.
settingsTarget
=
settingsTarget
;
...
...
src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughInput.ts
浏览文件 @
dc0ab500
...
...
@@ -10,6 +10,7 @@ import { IReference } from 'vs/base/common/lifecycle';
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
*
as
marked
from
'
vs/base/common/marked/marked
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
export
class
WalkThroughModel
extends
EditorModel
{
...
...
@@ -78,7 +79,7 @@ export class WalkThroughInput extends EditorInput {
return
this
.
options
.
telemetryFrom
;
}
getTelemetryDescriptor
():
{
[
key
:
string
]:
unknown
}
{
getTelemetryDescriptor
():
{
[
key
:
string
]:
unknown
;
}
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
target
'
]
=
this
.
getTelemetryFrom
();
/* __GDPR__FRAGMENT__
...
...
@@ -130,7 +131,7 @@ export class WalkThroughInput extends EditorInput {
let
otherResourceEditorInput
=
<
WalkThroughInput
>
otherInput
;
// Compare by properties
return
otherResourceEditorInput
.
options
.
resource
.
toString
()
===
this
.
options
.
resource
.
toString
(
);
return
isEqual
(
otherResourceEditorInput
.
options
.
resource
,
this
.
options
.
resource
);
}
return
false
;
...
...
src/vs/workbench/services/editor/browser/editorService.ts
浏览文件 @
dc0ab500
...
...
@@ -15,7 +15,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
basename
,
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupsOrder
,
IEditorReplacement
,
GroupChangeKind
,
preferredSideBySideGroupDirection
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
...
...
@@ -464,7 +464,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}
const
resourceInput
=
editor
as
IResourceInput
|
IUntitledResourceInput
;
if
(
resourceInput
.
resource
&&
resource
.
toString
()
===
resourceInput
.
resource
.
toString
(
))
{
if
(
resourceInput
.
resource
&&
isEqual
(
resource
,
resourceInput
.
resource
))
{
return
editorInGroup
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录