Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
a2f20aa2
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
a2f20aa2
编写于
4月 08, 2019
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update window service fill
上级
94b8b9a5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
19 deletion
+22
-19
packages/vscode/src/fill/storageDatabase.ts
packages/vscode/src/fill/storageDatabase.ts
+2
-0
packages/vscode/src/fill/windowsService.ts
packages/vscode/src/fill/windowsService.ts
+20
-19
未找到文件。
packages/vscode/src/fill/storageDatabase.ts
浏览文件 @
a2f20aa2
...
...
@@ -11,6 +11,8 @@ import { IStorageService, WillSaveStateReason } from "vs/platform/storage/common
import
*
as
paths
from
"
./paths
"
;
import
{
workbench
}
from
"
../workbench
"
;
// tslint:disable completed-docs
class
StorageDatabase
implements
workspaceStorage
.
IStorageDatabase
{
public
readonly
onDidChangeItemsExternal
=
Event
.
None
;
private
readonly
items
=
new
Map
<
string
,
string
>
();
...
...
packages/vscode/src/fill/windowsService.ts
浏览文件 @
a2f20aa2
import
*
as
electron
from
"
electron
"
;
import
{
Emitter
}
from
"
@coder/events
"
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
,
IMessageBoxResult
,
IDevToolsOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
INewWindowOptions
,
IOpenFileRequest
,
IAddFoldersRequest
}
from
"
vs/platform/windows/common/windows
"
;
import
{
logger
}
from
"
@coder/logger
"
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
,
IMessageBoxResult
,
IDevToolsOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
INewWindowOptions
,
IOpenFileRequest
,
IAddFoldersRequest
,
IURIToOpen
,
IOpenSettings
}
from
"
vs/platform/windows/common/windows
"
;
import
{
ParsedArgs
}
from
"
vs/platform/environment/common/environment
"
;
import
{
IWorkspaceIdentifier
,
IWorkspaceFolderCreationData
,
ISingleFolderWorkspaceIdentifier
}
from
"
vs/platform/workspaces/common/workspaces
"
;
import
{
URI
}
from
"
vs/base/common/uri
"
;
import
{
IRecentlyOpened
}
from
"
vs/platform/history/common/history
"
;
import
{
IRecentlyOpened
,
IRecent
}
from
"
vs/platform/history/common/history
"
;
import
{
ISerializableCommandAction
}
from
"
vs/platform/actions/common/actions
"
;
import
{
client
}
from
"
../client
"
;
import
{
showOpenDialog
}
from
"
../dialog
"
;
import
{
workbench
}
from
"
../workbench
"
;
// tslint:disable completed-docs
// VS Code overrides window.open to call openExternal, but we then call
// window.open which results in an infinite loop. Store the function but also
// make it unable to be set (doesn't work otherwise).
...
...
@@ -59,7 +62,7 @@ export class WindowsService implements IWindowsService {
}],
}
as
IOpenFileRequest
);
}).
catch
((
ex
)
=>
{
//
logger
.
error
(
ex
.
message
);
});
}
...
...
@@ -77,7 +80,7 @@ export class WindowsService implements IWindowsService {
}],
}
as
IOpenFileRequest
);
}).
catch
((
ex
)
=>
{
//
logger
.
error
(
ex
.
message
);
});
}
...
...
@@ -90,7 +93,7 @@ export class WindowsService implements IWindowsService {
}).
then
((
path
)
=>
{
workbench
.
workspace
=
URI
.
file
(
path
);
}).
catch
((
ex
)
=>
{
//
logger
.
error
(
ex
.
message
);
});
}
...
...
@@ -106,7 +109,7 @@ export class WindowsService implements IWindowsService {
foldersToAdd
:
[
URI
.
file
(
path
)],
}
as
IAddFoldersRequest
);
}).
catch
((
ex
)
=>
{
//
logger
.
error
(
ex
.
message
);
});
}
...
...
@@ -129,16 +132,14 @@ export class WindowsService implements IWindowsService {
});
}
public
showOpenDialog
(
windowId
:
number
,
options
:
OpenDialogOptions
):
Promise
<
string
[]
>
{
return
showOpenDialog
({
public
async
showOpenDialog
(
_
windowId
:
number
,
options
:
OpenDialogOptions
):
Promise
<
string
[]
>
{
return
[
await
showOpenDialog
({
...(
options
||
{}),
properties
:
{
openDirectory
:
true
,
openFile
:
true
,
},
}).
then
((
path
)
=>
{
return
[
path
];
});
})];
}
public
reloadWindow
(
windowId
:
number
,
_args
?:
ParsedArgs
):
Promise
<
void
>
{
...
...
@@ -157,14 +158,14 @@ export class WindowsService implements IWindowsService {
throw
new
Error
(
"
not implemented
"
);
}
public
enterWorkspace
(
_windowId
:
number
,
_path
:
URI
):
Promise
<
IEnterWorkspaceResult
>
{
if
(
_path
.
path
.
endsWith
(
"
.json
"
))
{
public
enterWorkspace
(
_windowId
:
number
,
uri
:
URI
):
Promise
<
IEnterWorkspaceResult
>
{
if
(
uri
.
path
.
endsWith
(
"
.json
"
))
{
workbench
.
workspace
=
{
id
:
"
Untitled
"
,
configPath
:
_path
.
path
,
configPath
:
uri
,
};
}
else
{
workbench
.
workspace
=
_path
;
workbench
.
workspace
=
uri
;
}
return
undefined
!
;
...
...
@@ -188,7 +189,7 @@ export class WindowsService implements IWindowsService {
return
Promise
.
resolve
(
this
.
getWindowById
(
windowId
).
setRepresentedFilename
(
fileName
));
}
public
addRecentlyOpened
(
_files
:
URI
[]):
Promise
<
void
>
{
public
addRecentlyOpened
(
_files
:
IRecent
[]):
Promise
<
void
>
{
throw
new
Error
(
"
not implemented
"
);
}
...
...
@@ -292,7 +293,7 @@ export class WindowsService implements IWindowsService {
}
// Global methods
public
openWindow
(
_windowId
:
number
,
_
paths
:
URI
[],
_options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
,
args
?:
ParsedArgs
}
):
Promise
<
void
>
{
public
openWindow
(
_windowId
:
number
,
_
uris
:
IURIToOpen
[],
_options
?:
IOpenSettings
):
Promise
<
void
>
{
throw
new
Error
(
"
not implemented
"
);
}
...
...
@@ -316,8 +317,8 @@ export class WindowsService implements IWindowsService {
throw
new
Error
(
"
not implemented
"
);
}
public
async
showItemInFolder
(
_path
:
string
):
Promise
<
void
>
{
workbench
.
workspace
=
URI
.
file
(
_path
)
;
public
async
showItemInFolder
(
uri
:
URI
):
Promise
<
void
>
{
workbench
.
workspace
=
uri
;
}
public
getActiveWindowId
():
Promise
<
number
|
undefined
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录