Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fc4b55ee
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,发现更多精彩内容 >>
未验证
提交
fc4b55ee
编写于
6月 19, 2020
作者:
B
Benjamin Pasero
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clipboard: sync access is deprecated (fix #98556) (#100467)
上级
b015e717
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
52 deletion
+17
-52
src/vs/editor/contrib/find/findController.ts
src/vs/editor/contrib/find/findController.ts
+12
-12
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+3
-3
src/vs/editor/contrib/find/test/findController.test.ts
src/vs/editor/contrib/find/test/findController.test.ts
+2
-2
src/vs/platform/clipboard/browser/clipboardService.ts
src/vs/platform/clipboard/browser/clipboardService.ts
+0
-10
src/vs/platform/clipboard/common/clipboardService.ts
src/vs/platform/clipboard/common/clipboardService.ts
+0
-8
src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts
...h/services/clipboard/electron-browser/clipboardService.ts
+0
-17
未找到文件。
src/vs/editor/contrib/find/findController.ts
浏览文件 @
fc4b55ee
...
...
@@ -255,7 +255,7 @@ export class CommonFindController extends Disposable implements IEditorContribut
// overwritten in subclass
}
protected
_start
(
opts
:
IFindStartOptions
):
void
{
protected
async
_start
(
opts
:
IFindStartOptions
):
Promise
<
void
>
{
this
.
disposeModel
();
if
(
!
this
.
_editor
.
hasModel
())
{
...
...
@@ -279,7 +279,7 @@ export class CommonFindController extends Disposable implements IEditorContribut
}
if
(
!
stateChanges
.
searchString
&&
opts
.
seedSearchStringFromGlobalClipboard
)
{
let
selectionSearchString
=
this
.
getGlobalBufferTerm
();
let
selectionSearchString
=
await
this
.
getGlobalBufferTerm
();
if
(
selectionSearchString
)
{
stateChanges
.
searchString
=
selectionSearchString
;
}
...
...
@@ -308,8 +308,8 @@ export class CommonFindController extends Disposable implements IEditorContribut
}
}
public
start
(
opts
:
IFindStartOptions
):
void
{
this
.
_start
(
opts
);
public
start
(
opts
:
IFindStartOptions
):
Promise
<
void
>
{
return
this
.
_start
(
opts
);
}
public
moveToNextMatch
():
boolean
{
...
...
@@ -353,24 +353,24 @@ export class CommonFindController extends Disposable implements IEditorContribut
return
false
;
}
public
getGlobalBufferTerm
():
string
{
public
async
getGlobalBufferTerm
():
Promise
<
string
>
{
if
(
this
.
_editor
.
getOption
(
EditorOption
.
find
).
globalFindClipboard
&&
this
.
_clipboardService
&&
this
.
_editor
.
hasModel
()
&&
!
this
.
_editor
.
getModel
().
isTooLargeForSyncing
()
)
{
return
this
.
_clipboardService
.
readFindText
Sync
();
return
this
.
_clipboardService
.
readFindText
();
}
return
''
;
}
public
setGlobalBufferTerm
(
text
:
string
)
{
public
async
setGlobalBufferTerm
(
text
:
string
)
{
if
(
this
.
_editor
.
getOption
(
EditorOption
.
find
).
globalFindClipboard
&&
this
.
_clipboardService
&&
this
.
_editor
.
hasModel
()
&&
!
this
.
_editor
.
getModel
().
isTooLargeForSyncing
()
)
{
this
.
_clipboardService
.
writeFindTextSync
(
text
);
await
this
.
_clipboardService
.
writeFindText
(
text
);
}
}
}
...
...
@@ -396,7 +396,7 @@ export class FindController extends CommonFindController implements IFindControl
this
.
_findOptionsWidget
=
null
;
}
protected
_start
(
opts
:
IFindStartOptions
):
void
{
protected
async
_start
(
opts
:
IFindStartOptions
):
Promise
<
void
>
{
if
(
!
this
.
_widget
)
{
this
.
_createFindWidget
();
}
...
...
@@ -422,7 +422,7 @@ export class FindController extends CommonFindController implements IFindControl
opts
.
updateSearchScope
=
updateSearchScope
;
super
.
_start
(
opts
);
await
super
.
_start
(
opts
);
if
(
opts
.
shouldFocus
===
FindStartFocusAction
.
FocusReplaceInput
)
{
this
.
_widget
!
.
focusReplaceInput
();
...
...
@@ -505,7 +505,7 @@ export class StartFindWithSelectionAction extends EditorAction {
});
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
void
{
public
async
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
Promise
<
void
>
{
let
controller
=
CommonFindController
.
get
(
editor
);
if
(
controller
)
{
controller
.
start
({
...
...
@@ -518,7 +518,7 @@ export class StartFindWithSelectionAction extends EditorAction {
loop
:
editor
.
getOption
(
EditorOption
.
find
).
loop
});
controller
.
setGlobalBufferTerm
(
controller
.
getState
().
searchString
);
return
controller
.
setGlobalBufferTerm
(
controller
.
getState
().
searchString
);
}
}
}
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
fc4b55ee
...
...
@@ -52,7 +52,7 @@ export const findNextMatchIcon = registerIcon('find-next-match', Codicon.arrowDo
export
interface
IFindController
{
replace
():
void
;
replaceAll
():
void
;
getGlobalBufferTerm
():
string
;
getGlobalBufferTerm
():
Promise
<
string
>
;
}
const
NLS_FIND_INPUT_LABEL
=
nls
.
localize
(
'
label.find
'
,
"
Find
"
);
...
...
@@ -224,9 +224,9 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this
.
_updateToggleSelectionFindButton
();
}
}));
this
.
_register
(
this
.
_codeEditor
.
onDidFocusEditorWidget
(()
=>
{
this
.
_register
(
this
.
_codeEditor
.
onDidFocusEditorWidget
(
async
()
=>
{
if
(
this
.
_isVisible
)
{
let
globalBufferTerm
=
this
.
_controller
.
getGlobalBufferTerm
();
let
globalBufferTerm
=
await
this
.
_controller
.
getGlobalBufferTerm
();
if
(
globalBufferTerm
&&
globalBufferTerm
!==
this
.
_state
.
searchString
)
{
this
.
_state
.
change
({
searchString
:
globalBufferTerm
},
true
);
this
.
_findInput
.
select
();
...
...
src/vs/editor/contrib/find/test/findController.test.ts
浏览文件 @
fc4b55ee
...
...
@@ -39,8 +39,8 @@ export class TestFindController extends CommonFindController {
this
.
hasFocus
=
false
;
}
protected
_start
(
opts
:
IFindStartOptions
):
void
{
super
.
_start
(
opts
);
protected
async
_start
(
opts
:
IFindStartOptions
):
Promise
<
void
>
{
await
super
.
_start
(
opts
);
if
(
opts
.
shouldFocus
!==
FindStartFocusAction
.
NoFocusChange
)
{
this
.
hasFocus
=
true
;
...
...
src/vs/platform/clipboard/browser/clipboardService.ts
浏览文件 @
fc4b55ee
...
...
@@ -97,14 +97,4 @@ export class BrowserClipboardService implements IClipboardService {
async
hasResources
():
Promise
<
boolean
>
{
return
this
.
resources
.
length
>
0
;
}
/** @deprecated */
readFindTextSync
():
string
{
return
this
.
findText
;
}
/** @deprecated */
writeFindTextSync
(
text
:
string
):
void
{
this
.
findText
=
text
;
}
}
src/vs/platform/clipboard/common/clipboardService.ts
浏览文件 @
fc4b55ee
...
...
@@ -46,12 +46,4 @@ export interface IClipboardService {
* Find out if resources are copied to the clipboard.
*/
hasResources
():
Promise
<
boolean
>
;
/** @deprecated */
readFindTextSync
():
string
;
/** @deprecated */
writeFindTextSync
(
text
:
string
):
void
;
}
src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts
浏览文件 @
fc4b55ee
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
clipboard
}
from
'
electron
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
...
...
@@ -77,22 +76,6 @@ export class NativeClipboardService implements IClipboardService {
return
[];
// do not trust clipboard data
}
}
/** @deprecated */
readFindTextSync
():
string
{
if
(
isMacintosh
)
{
return
clipboard
.
readFindText
();
}
return
''
;
}
/** @deprecated */
writeFindTextSync
(
text
:
string
):
void
{
if
(
isMacintosh
)
{
clipboard
.
writeFindText
(
text
);
}
}
}
registerSingleton
(
IClipboardService
,
NativeClipboardService
,
true
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录