Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7b8d42c3
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,发现更多精彩内容 >>
提交
7b8d42c3
编写于
2月 09, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
85d4bf7a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
28 addition
and
24 deletion
+28
-24
src/vs/workbench/browser/dnd.ts
src/vs/workbench/browser/dnd.ts
+3
-2
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
.../parts/files/electron-browser/fileActions.contribution.ts
+3
-3
src/vs/workbench/parts/files/electron-browser/fileCommands.ts
...vs/workbench/parts/files/electron-browser/fileCommands.ts
+1
-1
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
...ench/parts/search/electron-browser/search.contribution.ts
+1
-1
src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts
...Resolver/electron-browser/configurationResolverService.ts
+2
-1
src/vs/workbench/services/editor/common/editorService.ts
src/vs/workbench/services/editor/common/editorService.ts
+5
-6
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+2
-1
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+5
-4
src/vs/workbench/services/history/electron-browser/history.ts
...vs/workbench/services/history/electron-browser/history.ts
+3
-2
src/vs/workbench/services/search/node/searchService.ts
src/vs/workbench/services/search/node/searchService.ts
+3
-3
未找到文件。
src/vs/workbench/browser/dnd.ts
浏览文件 @
7b8d42c3
...
...
@@ -33,6 +33,7 @@ import { coalesce } from 'vs/base/common/arrays';
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
getCodeEditor
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IEditorIdentifier
}
from
'
vs/workbench/common/editor
'
;
import
{
basenameOrAuthority
}
from
'
vs/base/common/resources
'
;
export
interface
IDraggedResource
{
resource
:
URI
;
...
...
@@ -177,7 +178,7 @@ export class ResourcesDropHandler {
}
// Add external ones to recently open list unless dropped resource is a workspace
const
resourcesToAddToHistory
=
untitledOrFileResources
.
filter
(
d
=>
d
.
isExternal
&&
d
.
resource
.
scheme
!==
Schemas
.
untitled
).
map
(
d
=>
d
.
resource
);
const
resourcesToAddToHistory
=
untitledOrFileResources
.
filter
(
d
=>
d
.
isExternal
&&
d
.
resource
.
scheme
===
Schemas
.
file
).
map
(
d
=>
d
.
resource
);
if
(
resourcesToAddToHistory
.
length
)
{
this
.
windowsService
.
addRecentlyOpened
(
resourcesToAddToHistory
.
map
(
resource
=>
resource
.
fsPath
));
}
...
...
@@ -331,7 +332,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop {
const
resource
=
this
.
toResource
(
elements
[
0
]);
if
(
resource
)
{
return
basename
(
resource
.
fsPath
);
return
basename
OrAuthority
(
resource
);
}
return
void
0
;
...
...
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
浏览文件 @
7b8d42c3
...
...
@@ -102,7 +102,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});
// Editor Title Context Menu
appendEditorTitleContextMenuItem
(
REVEAL_IN_OS_COMMAND_ID
,
REVEAL_IN_OS_LABEL
,
ResourceContextKey
.
Scheme
.
isEqualTo
(
'
file
'
));
appendEditorTitleContextMenuItem
(
REVEAL_IN_OS_COMMAND_ID
,
REVEAL_IN_OS_LABEL
,
ResourceContextKey
.
Scheme
.
isEqualTo
(
Schemas
.
file
));
appendEditorTitleContextMenuItem
(
COPY_PATH_COMMAND_ID
,
CopyPathAction
.
LABEL
,
ResourceContextKey
.
IsFile
);
appendEditorTitleContextMenuItem
(
REVEAL_IN_EXPLORER_COMMAND_ID
,
nls
.
localize
(
'
revealInSideBar
'
,
"
Reveal in Side Bar
"
),
ResourceContextKey
.
IsFile
);
...
...
@@ -187,7 +187,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group
:
'
navigation
'
,
order
:
20
,
command
:
revealInOsCommand
,
when
:
ResourceContextKey
.
Scheme
.
isEqualTo
(
'
file
'
)
when
:
ResourceContextKey
.
Scheme
.
isEqualTo
(
Schemas
.
file
)
});
const
copyPathCommand
=
{
...
...
@@ -356,7 +356,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group
:
'
navigation
'
,
order
:
20
,
command
:
revealInOsCommand
,
when
:
ResourceContextKey
.
Scheme
.
isEqualTo
(
'
file
'
)
when
:
ResourceContextKey
.
Scheme
.
isEqualTo
(
Schemas
.
file
)
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
ExplorerContext
,
{
...
...
src/vs/workbench/parts/files/electron-browser/fileCommands.ts
浏览文件 @
7b8d42c3
...
...
@@ -422,7 +422,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
function
resourcesToClipboard
(
resources
:
URI
[],
clipboardService
:
IClipboardService
,
messageService
:
IMessageService
):
void
{
if
(
resources
.
length
)
{
const
lineDelimiter
=
isWindows
?
'
\r\n
'
:
'
\n
'
;
const
text
=
resources
.
map
(
r
=>
r
.
scheme
===
'
file
'
?
labels
.
getPathLabel
(
r
)
:
r
.
toString
()).
join
(
lineDelimiter
);
const
text
=
resources
.
map
(
r
=>
r
.
scheme
===
Schemas
.
file
?
labels
.
getPathLabel
(
r
)
:
r
.
toString
()).
join
(
lineDelimiter
);
clipboardService
.
writeText
(
text
);
}
else
{
messageService
.
show
(
severity
.
Info
,
nls
.
localize
(
'
openFileToCopy
'
,
"
Open a file first to copy its path
"
));
...
...
src/vs/workbench/parts/search/electron-browser/search.contribution.ts
浏览文件 @
7b8d42c3
...
...
@@ -233,7 +233,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
id
:
FIND_IN_FOLDER_ID
,
title
:
nls
.
localize
(
'
findInFolder
'
,
"
Find in Folder...
"
)
},
when
:
ContextKeyExpr
.
and
(
ExplorerFolderContext
,
ResourceContextKey
.
Scheme
.
isEqualTo
(
'
file
'
))
when
:
ContextKeyExpr
.
and
(
ExplorerFolderContext
,
ResourceContextKey
.
Scheme
.
isEqualTo
(
'
file
'
))
// todo@remote
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
ExplorerContext
,
{
...
...
src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts
浏览文件 @
7b8d42c3
...
...
@@ -20,6 +20,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import
{
relative
}
from
'
path
'
;
import
{
IProcessEnvironment
,
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
normalizeDriveLetter
}
from
'
vs/base/common/labels
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
class
VariableResolver
{
static
VARIABLE_REGEXP
=
/
\$\{(
.*
?)\}
/g
;
...
...
@@ -145,7 +146,7 @@ class VariableResolver {
input
=
input
.
modifiedInput
;
}
const
fileResource
=
toResource
(
input
,
{
filter
:
'
file
'
});
const
fileResource
=
toResource
(
input
,
{
filter
:
Schemas
.
file
});
if
(
!
fileResource
)
{
return
undefined
;
}
...
...
src/vs/workbench/services/editor/common/editorService.ts
浏览文件 @
7b8d42c3
...
...
@@ -9,7 +9,6 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
createDecorator
,
ServiceIdentifier
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorService
,
IEditor
,
IEditorInput
,
IEditorOptions
,
ITextEditorOptions
,
Position
,
Direction
,
IResourceInput
,
IResourceDiffInput
,
IResourceSideBySideInput
,
IUntitledResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
network
=
require
(
'
vs/base/common/network
'
);
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
basename
,
dirname
}
from
'
vs/base/common/paths
'
;
import
{
EditorInput
,
EditorOptions
,
TextEditorOptions
,
Extensions
as
EditorExtensions
,
SideBySideEditorInput
,
IFileEditorInput
,
IFileInputFactory
,
IEditorInputFactoryRegistry
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -192,7 +191,7 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
const
resourceInput
=
<
IResourceInput
>
input
;
if
(
resourceInput
.
resource
instanceof
URI
)
{
const
schema
=
resourceInput
.
resource
.
scheme
;
if
(
schema
===
network
.
Schemas
.
http
||
schema
===
network
.
Schemas
.
https
)
{
if
(
schema
===
Schemas
.
http
||
schema
===
Schemas
.
https
)
{
window
.
open
(
resourceInput
.
resource
.
toString
(
true
));
return
TPromise
.
wrap
<
IEditor
>
(
null
);
...
...
@@ -322,7 +321,7 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
const
resourceInput
=
<
IResourceInput
>
input
;
// Files / Data URI support
if
(
resourceInput
.
resource
instanceof
URI
&&
(
resourceInput
.
resource
.
scheme
===
network
.
Schemas
.
file
||
resourceInput
.
resource
.
scheme
===
network
.
Schemas
.
data
))
{
if
(
resourceInput
.
resource
instanceof
URI
&&
(
resourceInput
.
resource
.
scheme
===
Schemas
.
file
||
resourceInput
.
resource
.
scheme
===
Schemas
.
data
))
{
return
this
.
createOrGet
(
resourceInput
.
resource
,
this
.
instantiationService
,
resourceInput
.
label
,
resourceInput
.
description
,
resourceInput
.
encoding
);
}
...
...
@@ -332,7 +331,7 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
let
description
:
string
;
if
(
typeof
resourceInput
.
description
===
'
string
'
)
{
description
=
resourceInput
.
description
;
}
else
if
(
resourceInput
.
resource
.
scheme
===
network
.
Schemas
.
file
)
{
}
else
if
(
resourceInput
.
resource
.
scheme
===
Schemas
.
file
)
{
description
=
dirname
(
resourceInput
.
resource
.
fsPath
);
}
...
...
@@ -358,12 +357,12 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
let
input
:
ICachedEditorInput
;
// File
if
(
resource
.
scheme
===
network
.
Schemas
.
file
||
this
.
fileService
.
canHandleResource
(
resource
))
{
if
(
this
.
fileService
.
canHandleResource
(
resource
))
{
input
=
this
.
fileInputFactory
.
createFileInput
(
resource
,
encoding
,
instantiationService
);
}
// Data URI
else
if
(
resource
.
scheme
===
network
.
Schemas
.
data
)
{
else
if
(
resource
.
scheme
===
Schemas
.
data
)
{
input
=
instantiationService
.
createInstance
(
DataUriEditorInput
,
label
,
description
,
resource
);
}
...
...
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
7b8d42c3
...
...
@@ -26,6 +26,7 @@ import { shell } from 'electron';
import
{
ITextResourceConfigurationService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
product
from
'
vs/platform/node/product
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
class
FileService
implements
IFileService
{
...
...
@@ -243,7 +244,7 @@ export class FileService implements IFileService {
return
;
}
if
(
resource
.
scheme
!==
'
file
'
)
{
if
(
resource
.
scheme
!==
Schemas
.
file
)
{
return
;
// only support files
}
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
7b8d42c3
...
...
@@ -42,6 +42,7 @@ import { getBaseLabel } from 'vs/base/common/labels';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
Readable
}
from
'
stream
'
;
import
{
IWriteFileOptions
}
from
'
vs/base/node/extfs
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
interface
IEncodingOverride
{
resource
:
uri
;
...
...
@@ -260,7 +261,7 @@ export class FileService implements IFileService {
public
resolveStreamContent
(
resource
:
uri
,
options
?:
IResolveContentOptions
):
TPromise
<
IStreamContent
>
{
// Guard early against attempts to resolve an invalid file path
if
(
resource
.
scheme
!==
'
file
'
||
!
resource
.
fsPath
)
{
if
(
resource
.
scheme
!==
Schemas
.
file
||
!
resource
.
fsPath
)
{
return
TPromise
.
wrapError
<
IStreamContent
>
(
new
FileOperationError
(
nls
.
localize
(
'
fileInvalidPath
'
,
"
Invalid file resource ({0})
"
,
resource
.
toString
(
true
)),
FileOperationResult
.
FILE_INVALID_PATH
,
...
...
@@ -881,7 +882,7 @@ export class FileService implements IFileService {
resource
=
(
<
IFileStat
>
arg1
).
resource
;
}
assert
.
ok
(
resource
&&
resource
.
scheme
===
'
file
'
,
'
Invalid resource:
'
+
resource
);
assert
.
ok
(
resource
&&
resource
.
scheme
===
Schemas
.
file
,
`Invalid resource:
${
resource
}
`
);
return
paths
.
normalize
(
resource
.
fsPath
);
}
...
...
@@ -1018,7 +1019,7 @@ export class FileService implements IFileService {
}
public
watchFileChanges
(
resource
:
uri
):
void
{
assert
.
ok
(
resource
&&
resource
.
scheme
===
'
file
'
,
`Invalid resource for watching:
${
resource
}
`
);
assert
.
ok
(
resource
&&
resource
.
scheme
===
Schemas
.
file
,
`Invalid resource for watching:
${
resource
}
`
);
// Create or get watcher for provided path
let
watcher
=
this
.
activeFileChangesWatchers
.
get
(
resource
);
...
...
@@ -1137,7 +1138,7 @@ export class StatResolver {
private
errorLogger
:
(
error
:
Error
|
string
)
=>
void
;
constructor
(
resource
:
uri
,
isDirectory
:
boolean
,
mtime
:
number
,
size
:
number
,
errorLogger
?:
(
error
:
Error
|
string
)
=>
void
)
{
assert
.
ok
(
resource
&&
resource
.
scheme
===
'
file
'
,
'
Invalid resource:
'
+
resource
);
assert
.
ok
(
resource
&&
resource
.
scheme
===
Schemas
.
file
,
`Invalid resource:
${
resource
}
`
);
this
.
resource
=
resource
;
this
.
isDirectory
=
isDirectory
;
...
...
src/vs/workbench/services/history/electron-browser/history.ts
浏览文件 @
7b8d42c3
...
...
@@ -30,6 +30,7 @@ import { IExpression } from 'vs/base/common/glob';
import
{
ICursorPositionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ResourceGlobMatcher
}
from
'
vs/workbench/electron-browser/resources
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
/**
* Stores the selection & view state of an editor and allows to compare it to other selection states.
...
...
@@ -808,12 +809,12 @@ export class HistoryService implements IHistoryService {
const
input
=
history
[
i
];
if
(
input
instanceof
EditorInput
)
{
resource
=
toResource
(
input
,
{
filter
:
'
file
'
});
resource
=
toResource
(
input
,
{
filter
:
Schemas
.
file
});
}
else
{
resource
=
(
input
as
IResourceInput
).
resource
;
}
if
(
resource
&&
resource
.
scheme
===
'
file
'
)
{
if
(
resource
&&
resource
.
scheme
===
Schemas
.
file
)
{
return
resource
;
}
}
...
...
src/vs/workbench/services/search/node/searchService.ts
浏览文件 @
7b8d42c3
...
...
@@ -168,7 +168,7 @@ export class SearchService implements ISearchService {
// todo@remote
// why is that? we should search for resources from other
// schemes
else
if
(
resource
.
scheme
!==
'
file
'
)
{
else
if
(
resource
.
scheme
!==
Schemas
.
file
)
{
return
;
}
...
...
@@ -197,7 +197,7 @@ export class SearchService implements ISearchService {
private
matches
(
resource
:
uri
,
query
:
ISearchQuery
):
boolean
{
// file pattern
if
(
query
.
filePattern
)
{
if
(
resource
.
scheme
!==
'
file
'
)
{
if
(
resource
.
scheme
!==
Schemas
.
file
)
{
return
false
;
// if we match on file pattern, we have to ignore non file resources
}
...
...
@@ -208,7 +208,7 @@ export class SearchService implements ISearchService {
// includes
if
(
query
.
includePattern
)
{
if
(
resource
.
scheme
!==
'
file
'
)
{
if
(
resource
.
scheme
!==
Schemas
.
file
)
{
return
false
;
// if we match on file patterns, we have to ignore non file resources
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录