Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
72792681
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,发现更多精彩内容 >>
未验证
提交
72792681
编写于
6月 19, 2018
作者:
J
Johannes Rieken
提交者:
GitHub
6月 19, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #52330 from Microsoft/isidorn/fsReadonly
fileSystemProvider: isReadonly
上级
10192366
22a98f38
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
15 addition
and
3 deletion
+15
-3
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+7
-1
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+1
-1
src/vs/workbench/api/node/extHostFileSystem.ts
src/vs/workbench/api/node/extHostFileSystem.ts
+4
-1
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+2
-0
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
...ench/services/files/electron-browser/remoteFileService.ts
+1
-0
未找到文件。
src/vs/platform/files/common/files.ts
浏览文件 @
72792681
...
@@ -182,7 +182,8 @@ export enum FileSystemProviderCapabilities {
...
@@ -182,7 +182,8 @@ export enum FileSystemProviderCapabilities {
FileOpenReadWriteClose
=
1
<<
2
,
FileOpenReadWriteClose
=
1
<<
2
,
FileFolderCopy
=
1
<<
3
,
FileFolderCopy
=
1
<<
3
,
PathCaseSensitive
=
1
<<
10
PathCaseSensitive
=
1
<<
10
,
Readonly
=
1
<<
11
}
}
export
interface
IFileSystemProvider
{
export
interface
IFileSystemProvider
{
...
@@ -411,6 +412,11 @@ export interface IFileStat extends IBaseStat {
...
@@ -411,6 +412,11 @@ export interface IFileStat extends IBaseStat {
*/
*/
isDirectory
:
boolean
;
isDirectory
:
boolean
;
/**
* The resource is readonly.
*/
isReadonly
?:
boolean
;
/**
/**
* The resource is a symbolic link.
* The resource is a symbolic link.
*/
*/
...
...
src/vs/vscode.d.ts
浏览文件 @
72792681
...
@@ -6863,7 +6863,7 @@ declare module 'vscode' {
...
@@ -6863,7 +6863,7 @@ declare module 'vscode' {
* @param options Immutable metadata about the provider.
* @param options Immutable metadata about the provider.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
*/
export
function
registerFileSystemProvider
(
scheme
:
string
,
provider
:
FileSystemProvider
,
options
?:
{
isCaseSensitive
?:
boolean
}):
Disposable
;
export
function
registerFileSystemProvider
(
scheme
:
string
,
provider
:
FileSystemProvider
,
options
?:
{
isCaseSensitive
?:
boolean
,
isReadonly
?:
boolean
}):
Disposable
;
}
}
/**
/**
...
...
src/vs/workbench/api/node/extHostFileSystem.ts
浏览文件 @
72792681
...
@@ -83,7 +83,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
...
@@ -83,7 +83,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
extHostLanguageFeatures
.
registerDocumentLinkProvider
(
'
*
'
,
this
.
_linkProvider
);
extHostLanguageFeatures
.
registerDocumentLinkProvider
(
'
*
'
,
this
.
_linkProvider
);
}
}
registerFileSystemProvider
(
scheme
:
string
,
provider
:
vscode
.
FileSystemProvider
,
options
:
{
isCaseSensitive
?:
boolean
}
=
{})
{
registerFileSystemProvider
(
scheme
:
string
,
provider
:
vscode
.
FileSystemProvider
,
options
:
{
isCaseSensitive
?:
boolean
,
isReadonly
?:
boolean
}
=
{})
{
if
(
this
.
_usedSchemes
.
has
(
scheme
))
{
if
(
this
.
_usedSchemes
.
has
(
scheme
))
{
throw
new
Error
(
`a provider for the scheme '
${
scheme
}
' is already registered`
);
throw
new
Error
(
`a provider for the scheme '
${
scheme
}
' is already registered`
);
...
@@ -98,6 +98,9 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
...
@@ -98,6 +98,9 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
if
(
options
.
isCaseSensitive
)
{
if
(
options
.
isCaseSensitive
)
{
capabilites
+=
files
.
FileSystemProviderCapabilities
.
PathCaseSensitive
;
capabilites
+=
files
.
FileSystemProviderCapabilities
.
PathCaseSensitive
;
}
}
if
(
options
.
isReadonly
)
{
capabilites
+=
files
.
FileSystemProviderCapabilities
.
Readonly
;
}
if
(
typeof
provider
.
copy
===
'
function
'
)
{
if
(
typeof
provider
.
copy
===
'
function
'
)
{
capabilites
+=
files
.
FileSystemProviderCapabilities
.
FileFolderCopy
;
capabilites
+=
files
.
FileSystemProviderCapabilities
.
FileFolderCopy
;
}
}
...
...
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
72792681
...
@@ -1129,6 +1129,7 @@ export class StatResolver {
...
@@ -1129,6 +1129,7 @@ export class StatResolver {
resource
:
this
.
resource
,
resource
:
this
.
resource
,
isDirectory
:
this
.
isDirectory
,
isDirectory
:
this
.
isDirectory
,
isSymbolicLink
:
this
.
isSymbolicLink
,
isSymbolicLink
:
this
.
isSymbolicLink
,
isReadonly
:
false
,
name
:
this
.
name
,
name
:
this
.
name
,
etag
:
this
.
etag
,
etag
:
this
.
etag
,
size
:
this
.
size
,
size
:
this
.
size
,
...
@@ -1213,6 +1214,7 @@ export class StatResolver {
...
@@ -1213,6 +1214,7 @@ export class StatResolver {
resource
:
fileResource
,
resource
:
fileResource
,
isDirectory
:
fileStat
.
isDirectory
(),
isDirectory
:
fileStat
.
isDirectory
(),
isSymbolicLink
,
isSymbolicLink
,
isReadonly
:
false
,
name
:
file
,
name
:
file
,
mtime
:
fileStat
.
mtime
.
getTime
(),
mtime
:
fileStat
.
mtime
.
getTime
(),
etag
:
etag
(
fileStat
),
etag
:
etag
(
fileStat
),
...
...
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
浏览文件 @
72792681
...
@@ -45,6 +45,7 @@ function toIFileStat(provider: IFileSystemProvider, tuple: [URI, IStat], recurse
...
@@ -45,6 +45,7 @@ function toIFileStat(provider: IFileSystemProvider, tuple: [URI, IStat], recurse
name
:
posix
.
basename
(
resource
.
path
),
name
:
posix
.
basename
(
resource
.
path
),
isDirectory
:
(
stat
.
type
&
FileType
.
Directory
)
!==
0
,
isDirectory
:
(
stat
.
type
&
FileType
.
Directory
)
!==
0
,
isSymbolicLink
:
(
stat
.
type
&
FileType
.
SymbolicLink
)
!==
0
,
isSymbolicLink
:
(
stat
.
type
&
FileType
.
SymbolicLink
)
!==
0
,
isReadonly
:
!!
(
provider
.
capabilities
&
FileSystemProviderCapabilities
.
Readonly
),
mtime
:
stat
.
mtime
,
mtime
:
stat
.
mtime
,
size
:
stat
.
size
,
size
:
stat
.
size
,
etag
:
stat
.
mtime
.
toString
(
29
)
+
stat
.
size
.
toString
(
31
),
etag
:
stat
.
mtime
.
toString
(
29
)
+
stat
.
size
.
toString
(
31
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录