Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c2514ed1
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,发现更多精彩内容 >>
提交
c2514ed1
编写于
11月 03, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipc: remove vscode:setDocumentEdited
#10587
上级
8777f080
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
25 addition
and
14 deletion
+25
-14
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+0
-9
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-0
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+6
-0
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+4
-0
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+10
-0
src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts
...rkbench/parts/files/electron-browser/dirtyFilesTracker.ts
+3
-5
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
c2514ed1
...
...
@@ -231,15 +231,6 @@ export class WindowsManager implements IWindowsMainService, IWindowEventService
}
});
ipc
.
on
(
'
vscode:setDocumentEdited
'
,
(
event
,
windowId
:
number
,
edited
:
boolean
)
=>
{
this
.
logService
.
log
(
'
IPC#vscode:setDocumentEdited
'
);
const
vscodeWindow
=
this
.
getWindowById
(
windowId
);
if
(
vscodeWindow
&&
vscodeWindow
.
win
.
isDocumentEdited
()
!==
edited
)
{
vscodeWindow
.
win
.
setDocumentEdited
(
edited
);
}
});
ipc
.
on
(
'
vscode:toggleMenuBar
'
,
(
event
,
windowId
:
number
)
=>
{
this
.
logService
.
log
(
'
IPC#vscode:toggleMenuBar
'
);
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
c2514ed1
...
...
@@ -26,6 +26,7 @@ export interface IWindowsService {
setRepresentedFilename
(
windowId
:
number
,
fileName
:
string
):
TPromise
<
void
>
;
getRecentlyOpen
(
windowId
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
(
windowId
:
number
):
TPromise
<
void
>
;
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
;
// Global methods
// TODO@joao: rename, shouldn't this be openWindow?
...
...
@@ -53,4 +54,5 @@ export interface IWindowService {
setRepresentedFilename
(
fileName
:
string
):
TPromise
<
void
>
;
getRecentlyOpen
():
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
focusWindow
():
TPromise
<
void
>
;
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
;
}
\ No newline at end of file
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
c2514ed1
...
...
@@ -20,6 +20,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
setRepresentedFilename
'
,
arg
:
[
number
,
string
]):
TPromise
<
void
>
;
call
(
command
:
'
getRecentlyOpen
'
,
arg
:
number
):
TPromise
<
{
files
:
string
[];
folders
:
string
[];
}
>
;
call
(
command
:
'
focusWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
setDocumentEdited
'
,
args
:
[
number
,
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
windowOpen
'
,
arg
:
[
string
[],
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
openNewWindow
'
):
TPromise
<
void
>
;
call
(
command
:
'
showWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
...
...
@@ -44,6 +45,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
setRepresentedFilename
'
:
return
this
.
service
.
setRepresentedFilename
(
arg
[
0
],
arg
[
1
]);
case
'
getRecentlyOpen
'
:
return
this
.
service
.
getRecentlyOpen
(
arg
);
case
'
focusWindow
'
:
return
this
.
service
.
focusWindow
(
arg
);
case
'
setDocumentEdited
'
:
return
this
.
service
.
setDocumentEdited
(
arg
[
0
],
arg
[
1
]);
case
'
windowOpen
'
:
return
this
.
service
.
windowOpen
(
arg
[
0
],
arg
[
1
]);
case
'
openNewWindow
'
:
return
this
.
service
.
openNewWindow
();
case
'
showWindow
'
:
return
this
.
service
.
showWindow
(
arg
);
...
...
@@ -102,6 +104,10 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
focusWindow
'
,
windowId
);
}
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
setDocumentEdited
'
,
[
windowId
,
flag
]);
}
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
windowOpen
'
,
[
paths
,
forceNewWindow
]);
}
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
c2514ed1
...
...
@@ -64,4 +64,8 @@ export class WindowService implements IWindowService {
focusWindow
():
TPromise
<
void
>
{
return
this
.
windowsService
.
focusWindow
(
this
.
windowId
);
}
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
{
return
this
.
windowsService
.
setDocumentEdited
(
this
.
windowId
,
flag
);
}
}
\ No newline at end of file
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
c2514ed1
...
...
@@ -117,6 +117,16 @@ export class WindowsService implements IWindowsService {
return
TPromise
.
as
(
null
);
}
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
{
const
vscodeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
vscodeWindow
&&
vscodeWindow
.
win
.
isDocumentEdited
()
!==
flag
)
{
vscodeWindow
.
win
.
setDocumentEdited
(
flag
);
}
return
TPromise
.
as
(
null
);
}
windowOpen
(
paths
:
string
[],
forceNewWindow
?:
boolean
):
TPromise
<
void
>
{
if
(
!
paths
||
!
paths
.
length
)
{
return
TPromise
.
as
(
null
);
...
...
src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts
浏览文件 @
c2514ed1
...
...
@@ -11,8 +11,8 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import
{
VIEWLET_ID
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
TextFileModelChangeEvent
,
ITextFileService
,
AutoSaveMode
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
platform
,
Platform
}
from
'
vs/base/common/platform
'
;
import
{
IWindowIPCService
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IEditorStacksModel
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
...
...
@@ -23,8 +23,6 @@ import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/co
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
export
class
DirtyFilesTracker
implements
IWorkbenchContribution
{
private
isDocumentedEdited
:
boolean
;
private
toUnbind
:
IDisposable
[];
...
...
@@ -41,7 +39,7 @@ export class DirtyFilesTracker implements IWorkbenchContribution {
@
IEditorGroupService
editorGroupService
:
IEditorGroupService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
@
IActivityService
private
activityService
:
IActivityService
,
@
IWindow
IPCService
private
windowService
:
IWindowIPC
Service
,
@
IWindow
Service
private
windowService
:
IWindow
Service
,
@
IUntitledEditorService
private
untitledEditorService
:
IUntitledEditorService
)
{
this
.
toUnbind
=
[];
...
...
@@ -161,7 +159,7 @@ export class DirtyFilesTracker implements IWorkbenchContribution {
const
hasDirtyFiles
=
this
.
textFileService
.
isDirty
();
this
.
isDocumentedEdited
=
hasDirtyFiles
;
ipc
.
send
(
'
vscode:setDocumentEdited
'
,
this
.
windowService
.
getWindowId
(),
hasDirtyFiles
);
// handled from browser process
this
.
windowService
.
setDocumentEdited
(
hasDirtyFiles
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录