Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a6a9f771
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a6a9f771
编写于
5月 04, 2021
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Lint progress
上级
0fa9d367
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
78 addition
and
78 deletion
+78
-78
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
+1
-1
src/vs/platform/quickinput/browser/pickerQuickAccess.ts
src/vs/platform/quickinput/browser/pickerQuickAccess.ts
+2
-2
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
+1
-1
src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts
...bench/contrib/codeEditor/browser/find/simpleFindWidget.ts
+10
-10
src/vs/workbench/contrib/debug/browser/debugQuickAccess.ts
src/vs/workbench/contrib/debug/browser/debugQuickAccess.ts
+1
-1
src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.ts
...bench/contrib/extensions/browser/extensionsQuickAccess.ts
+2
-2
src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts
.../workbench/contrib/quickaccess/browser/viewQuickAccess.ts
+1
-1
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
...s/workbench/contrib/search/browser/anythingQuickAccess.ts
+1
-1
src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
...vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
+1
-1
src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.ts
src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/links/terminalLinkManager.ts
...nch/contrib/terminal/browser/links/terminalLinkManager.ts
+6
-6
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
+3
-3
src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts
...orkbench/contrib/terminal/browser/terminalConfigHelper.ts
+16
-16
src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts
.../workbench/contrib/terminal/browser/terminalFindWidget.ts
+5
-5
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
...kbench/contrib/terminal/browser/terminalProcessManager.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts
...workbench/contrib/terminal/browser/terminalQuickAccess.ts
+9
-9
src/vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget.ts
...terminal/browser/widgets/environmentVariableInfoWidget.ts
+1
-1
src/vs/workbench/contrib/terminal/test/browser/terminalTypeahead.test.ts
...h/contrib/terminal/test/browser/terminalTypeahead.test.ts
+8
-8
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
...vs/workbench/contrib/webview/browser/webviewFindWidget.ts
+5
-5
src/vs/workbench/test/browser/quickAccess.test.ts
src/vs/workbench/test/browser/quickAccess.test.ts
+3
-3
未找到文件。
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -55,7 +55,7 @@ export abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAcc
this
.
options
=
options
;
}
protected
async
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
ICommandQuickPick
|
IQuickPickSeparator
>>
{
protected
async
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
ICommandQuickPick
|
IQuickPickSeparator
>>
{
// Ask subclass for all command picks
const
allCommandPicks
=
await
this
.
getCommandPicks
(
disposables
,
token
);
...
...
src/vs/platform/quickinput/browser/pickerQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -122,7 +122,7 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
// Collect picks and support both long running and short or combined
const
picksToken
=
picksCts
.
token
;
const
picksFilter
=
picker
.
value
.
substr
(
this
.
prefix
.
length
).
trim
();
const
providedPicks
=
this
.
getPicks
(
picksFilter
,
picksDisposables
,
picksToken
);
const
providedPicks
=
this
.
_
getPicks
(
picksFilter
,
picksDisposables
,
picksToken
);
const
applyPicks
=
(
picks
:
Picks
<
T
>
,
skipEmpty
?:
boolean
):
boolean
=>
{
let
items
:
readonly
Pick
<
T
>
[];
...
...
@@ -330,5 +330,5 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
* @returns the picks either directly, as promise or combined fast and slow results.
* Pickers can return `null` to signal that no change in picks is needed.
*/
protected
abstract
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Picks
<
T
>
|
Promise
<
Picks
<
T
>>
|
FastAndSlowPicks
<
T
>
|
null
;
protected
abstract
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Picks
<
T
>
|
Promise
<
Picks
<
T
>>
|
FastAndSlowPicks
<
T
>
|
null
;
}
src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -68,7 +68,7 @@ export abstract class BaseEditorQuickAccessProvider extends PickerQuickAccessPro
return
super
.
provide
(
picker
,
token
);
}
protected
getPicks
(
filter
:
string
):
Array
<
IEditorQuickPickItem
|
IQuickPickSeparator
>
{
protected
_
getPicks
(
filter
:
string
):
Array
<
IEditorQuickPickItem
|
IQuickPickSeparator
>
{
const
query
=
prepareQuery
(
filter
);
// Filtering
...
...
src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts
浏览文件 @
a6a9f771
...
...
@@ -69,7 +69,7 @@ export abstract class SimpleFindWidget extends Widget {
this
.
_updateHistoryDelayer
=
new
Delayer
<
void
>
(
500
);
this
.
oninput
(
this
.
_findInput
.
domNode
,
(
e
)
=>
{
this
.
foundMatch
=
this
.
onInputChanged
();
this
.
foundMatch
=
this
.
_
onInputChanged
();
this
.
updateButtons
(
this
.
foundMatch
);
this
.
_delayedUpdateHistory
();
});
...
...
@@ -138,25 +138,25 @@ export abstract class SimpleFindWidget extends Widget {
});
this
.
_focusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
_innerDomNode
));
this
.
_register
(
this
.
_focusTracker
.
onDidFocus
(
this
.
onFocusTrackerFocus
.
bind
(
this
)));
this
.
_register
(
this
.
_focusTracker
.
onDidBlur
(
this
.
onFocusTrackerBlur
.
bind
(
this
)));
this
.
_register
(
this
.
_focusTracker
.
onDidFocus
(
this
.
_
onFocusTrackerFocus
.
bind
(
this
)));
this
.
_register
(
this
.
_focusTracker
.
onDidBlur
(
this
.
_
onFocusTrackerBlur
.
bind
(
this
)));
this
.
_findInputFocusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
_findInput
.
domNode
));
this
.
_register
(
this
.
_findInputFocusTracker
.
onDidFocus
(
this
.
onFindInputFocusTrackerFocus
.
bind
(
this
)));
this
.
_register
(
this
.
_findInputFocusTracker
.
onDidBlur
(
this
.
onFindInputFocusTrackerBlur
.
bind
(
this
)));
this
.
_register
(
this
.
_findInputFocusTracker
.
onDidFocus
(
this
.
_
onFindInputFocusTrackerFocus
.
bind
(
this
)));
this
.
_register
(
this
.
_findInputFocusTracker
.
onDidBlur
(
this
.
_
onFindInputFocusTrackerBlur
.
bind
(
this
)));
this
.
_register
(
dom
.
addDisposableListener
(
this
.
_innerDomNode
,
'
click
'
,
(
event
)
=>
{
event
.
stopPropagation
();
}));
}
protected
abstract
onInputChanged
():
boolean
;
protected
abstract
_
onInputChanged
():
boolean
;
protected
abstract
find
(
previous
:
boolean
):
void
;
protected
abstract
findFirst
():
void
;
protected
abstract
onFocusTrackerFocus
():
void
;
protected
abstract
onFocusTrackerBlur
():
void
;
protected
abstract
onFindInputFocusTrackerFocus
():
void
;
protected
abstract
onFindInputFocusTrackerBlur
():
void
;
protected
abstract
_
onFocusTrackerFocus
():
void
;
protected
abstract
_
onFocusTrackerBlur
():
void
;
protected
abstract
_
onFindInputFocusTrackerFocus
():
void
;
protected
abstract
_
onFindInputFocusTrackerBlur
():
void
;
protected
get
inputValue
()
{
return
this
.
_findInput
.
getValue
();
...
...
src/vs/workbench/contrib/debug/browser/debugQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -33,7 +33,7 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
});
}
protected
async
getPicks
(
filter
:
string
):
Promise
<
(
IQuickPickSeparator
|
IPickerQuickAccessItem
)[]
>
{
protected
async
_
getPicks
(
filter
:
string
):
Promise
<
(
IQuickPickSeparator
|
IPickerQuickAccessItem
)[]
>
{
const
picks
:
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
=
[];
picks
.
push
({
type
:
'
separator
'
,
label
:
'
launch.json
'
});
...
...
src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -28,7 +28,7 @@ export class InstallExtensionQuickAccessProvider extends PickerQuickAccessProvid
super
(
InstallExtensionQuickAccessProvider
.
PREFIX
);
}
protected
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
|
Promise
<
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>>
{
protected
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
|
Promise
<
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>>
{
// Nothing typed
if
(
!
filter
)
{
...
...
@@ -100,7 +100,7 @@ export class ManageExtensionsQuickAccessProvider extends PickerQuickAccessProvid
super
(
ManageExtensionsQuickAccessProvider
.
PREFIX
);
}
protected
getPicks
():
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
{
protected
_
getPicks
():
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
{
return
[{
label
:
localize
(
'
manage
'
,
"
Press Enter to manage your extensions.
"
),
accept
:
()
=>
openExtensionsViewlet
(
this
.
viewletService
)
...
...
src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -48,7 +48,7 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
});
}
protected
getPicks
(
filter
:
string
):
Array
<
IViewQuickPickItem
|
IQuickPickSeparator
>
{
protected
_
getPicks
(
filter
:
string
):
Array
<
IViewQuickPickItem
|
IQuickPickSeparator
>
{
const
filteredViewEntries
=
this
.
doGetViewPickItems
().
filter
(
entry
=>
{
if
(
!
filter
)
{
return
true
;
...
...
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -259,7 +259,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
return
toDisposable
(()
=>
this
.
clearDecorations
(
activeEditorControl
));
}
protected
getPicks
(
originalFilter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Picks
<
IAnythingQuickPickItem
>
|
Promise
<
Picks
<
IAnythingQuickPickItem
>>
|
FastAndSlowPicks
<
IAnythingQuickPickItem
>
|
null
{
protected
_
getPicks
(
originalFilter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Picks
<
IAnythingQuickPickItem
>
|
Promise
<
Picks
<
IAnythingQuickPickItem
>>
|
FastAndSlowPicks
<
IAnythingQuickPickItem
>
|
null
{
// Find a suitable range from the pattern looking for ":", "#" or ","
// unless we have the `@` editor symbol character inside the filter
...
...
src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -83,7 +83,7 @@ export class SymbolsQuickAccessProvider extends PickerQuickAccessProvider<ISymbo
};
}
protected
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
ISymbolQuickPickItem
>>
{
protected
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
ISymbolQuickPickItem
>>
{
return
this
.
getSymbolPicks
(
filter
,
undefined
,
token
);
}
...
...
src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -39,7 +39,7 @@ export class TasksQuickAccessProvider extends PickerQuickAccessProvider<IPickerQ
this
.
activationPromise
=
extensionService
.
activateByEvent
(
'
onCommand:workbench.action.tasks.runTask
'
);
}
protected
async
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>>
{
protected
async
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>>
{
// always await extensions
await
this
.
activationPromise
;
...
...
src/vs/workbench/contrib/terminal/browser/links/terminalLinkManager.ts
浏览文件 @
a6a9f771
...
...
@@ -200,7 +200,7 @@ export class TerminalLinkManager extends DisposableStore {
if
(
uri
.
scheme
===
Schemas
.
file
)
{
// Just using fsPath here is unsafe: https://github.com/microsoft/vscode/issues/109076
const
fsPath
=
uri
.
fsPath
;
this
.
_handleLocalLink
(((
this
.
osPath
.
sep
===
posix
.
sep
)
&&
isWindows
)
?
fsPath
.
replace
(
/
\\
/g
,
posix
.
sep
)
:
fsPath
);
this
.
_handleLocalLink
(((
this
.
_
osPath
.
sep
===
posix
.
sep
)
&&
isWindows
)
?
fsPath
.
replace
(
/
\\
/g
,
posix
.
sep
)
:
fsPath
);
return
;
}
...
...
@@ -263,7 +263,7 @@ export class TerminalLinkManager extends DisposableStore {
return
markdown
.
appendMarkdown
(
`[
${
label
}
](
${
uri
}
) (
${
clickLabel
}
)`
);
}
private
get
osPath
():
IPath
{
private
get
_
osPath
():
IPath
{
if
(
!
this
.
_processManager
)
{
throw
new
Error
(
'
Process manager is required
'
);
}
...
...
@@ -282,7 +282,7 @@ export class TerminalLinkManager extends DisposableStore {
if
(
!
this
.
_processManager
.
userHome
)
{
return
null
;
}
link
=
this
.
osPath
.
join
(
this
.
_processManager
.
userHome
,
link
.
substring
(
1
));
link
=
this
.
_
osPath
.
join
(
this
.
_processManager
.
userHome
,
link
.
substring
(
1
));
}
else
if
(
link
.
charAt
(
0
)
!==
'
/
'
&&
link
.
charAt
(
0
)
!==
'
~
'
)
{
// Resolve workspace path . | .. | <relative_path> -> <path>/. | <path>/.. | <path>/<relative_path>
if
(
this
.
_processManager
.
os
===
OperatingSystem
.
Windows
)
{
...
...
@@ -291,7 +291,7 @@ export class TerminalLinkManager extends DisposableStore {
// Abort if no workspace is open
return
null
;
}
link
=
this
.
osPath
.
join
(
this
.
_processCwd
,
link
);
link
=
this
.
_
osPath
.
join
(
this
.
_processCwd
,
link
);
}
else
{
// Remove \\?\ from paths so that they share the same underlying
// uri and don't open multiple tabs for the same file
...
...
@@ -302,10 +302,10 @@ export class TerminalLinkManager extends DisposableStore {
// Abort if no workspace is open
return
null
;
}
link
=
this
.
osPath
.
join
(
this
.
_processCwd
,
link
);
link
=
this
.
_
osPath
.
join
(
this
.
_processCwd
,
link
);
}
}
link
=
this
.
osPath
.
normalize
(
link
);
link
=
this
.
_
osPath
.
normalize
(
link
);
return
link
;
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
浏览文件 @
a6a9f771
...
...
@@ -464,11 +464,11 @@ export function registerTerminalActions() {
const
codeEditorService
=
accessor
.
get
(
ICodeEditorService
);
const
instance
=
terminalService
.
getActiveOrCreateInstance
();
le
t
editor
=
codeEditorService
.
getActiveCodeEditor
();
cons
t
editor
=
codeEditorService
.
getActiveCodeEditor
();
if
(
!
editor
||
!
editor
.
hasModel
())
{
return
;
}
le
t
selection
=
editor
.
getSelection
();
cons
t
selection
=
editor
.
getSelection
();
let
text
:
string
;
if
(
selection
.
isEmpty
())
{
text
=
editor
.
getModel
().
getLineContent
(
selection
.
selectionStartLineNumber
).
trim
();
...
...
@@ -836,7 +836,7 @@ export function registerTerminalActions() {
const
labelService
=
accessor
.
get
(
ILabelService
);
const
remoteAgentService
=
accessor
.
get
(
IRemoteAgentService
);
const
notificationService
=
accessor
.
get
(
INotificationService
);
le
t
offProcTerminalService
=
remoteAgentService
.
getConnection
()
?
accessor
.
get
(
IRemoteTerminalService
)
:
accessor
.
get
(
ILocalTerminalService
);
cons
t
offProcTerminalService
=
remoteAgentService
.
getConnection
()
?
accessor
.
get
(
IRemoteTerminalService
)
:
accessor
.
get
(
ILocalTerminalService
);
const
terms
=
await
offProcTerminalService
.
listProcesses
();
...
...
src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts
浏览文件 @
a6a9f771
...
...
@@ -43,9 +43,9 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
@
IExtensionManagementService
private
readonly
_extensionManagementService
:
IExtensionManagementService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IProductService
private
readonly
productService
:
IProductService
,
@
ITelemetryService
private
readonly
_
telemetryService
:
ITelemetryService
,
@
IInstantiationService
private
readonly
_
instantiationService
:
IInstantiationService
,
@
IProductService
private
readonly
_
productService
:
IProductService
,
)
{
this
.
_updateConfig
();
this
.
_configurationService
.
onDidChangeConfiguration
(
e
=>
{
...
...
@@ -74,15 +74,15 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
public
configFontIsMonospace
():
boolean
{
const
fontSize
=
15
;
const
fontFamily
=
this
.
config
.
fontFamily
||
this
.
_configurationService
.
getValue
<
IEditorOptions
>
(
'
editor
'
).
fontFamily
||
EDITOR_FONT_DEFAULTS
.
fontFamily
;
const
i
_r
ect
=
this
.
_getBoundingRectFor
(
'
i
'
,
fontFamily
,
fontSize
);
const
w
_r
ect
=
this
.
_getBoundingRectFor
(
'
w
'
,
fontFamily
,
fontSize
);
const
i
R
ect
=
this
.
_getBoundingRectFor
(
'
i
'
,
fontFamily
,
fontSize
);
const
w
R
ect
=
this
.
_getBoundingRectFor
(
'
w
'
,
fontFamily
,
fontSize
);
// Check for invalid bounds, there is no reason to believe the font is not monospace
if
(
!
i
_rect
||
!
w_rect
||
!
i_rect
.
width
||
!
w_r
ect
.
width
)
{
if
(
!
i
Rect
||
!
wRect
||
!
iRect
.
width
||
!
wR
ect
.
width
)
{
return
true
;
}
return
i
_rect
.
width
===
w_r
ect
.
width
;
return
i
Rect
.
width
===
wR
ect
.
width
;
}
private
_createCharMeasureElementIfNecessary
():
HTMLElement
{
...
...
@@ -217,21 +217,21 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
return
r
;
}
private
recommendationsShown
=
false
;
private
_
recommendationsShown
=
false
;
public
async
showRecommendations
(
shellLaunchConfig
:
IShellLaunchConfig
):
Promise
<
void
>
{
if
(
this
.
recommendationsShown
)
{
if
(
this
.
_
recommendationsShown
)
{
return
;
}
this
.
recommendationsShown
=
true
;
this
.
_
recommendationsShown
=
true
;
if
(
isWindows
&&
shellLaunchConfig
.
executable
&&
basename
(
shellLaunchConfig
.
executable
).
toLowerCase
()
===
'
wsl.exe
'
)
{
const
exeBasedExtensionTips
=
this
.
productService
.
exeBasedExtensionTips
;
const
exeBasedExtensionTips
=
this
.
_
productService
.
exeBasedExtensionTips
;
if
(
!
exeBasedExtensionTips
||
!
exeBasedExtensionTips
.
wsl
)
{
return
;
}
const
extId
=
Object
.
keys
(
exeBasedExtensionTips
.
wsl
.
recommendations
).
find
(
extId
=>
exeBasedExtensionTips
.
wsl
.
recommendations
[
extId
].
important
);
if
(
extId
&&
!
await
this
.
isExtensionInstalled
(
extId
))
{
if
(
extId
&&
!
await
this
.
_
isExtensionInstalled
(
extId
))
{
this
.
_notificationService
.
prompt
(
Severity
.
Info
,
nls
.
localize
(
...
...
@@ -246,8 +246,8 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
}
*/
this
.
telemetryService
.
publicLog
(
'
terminalLaunchRecommendation:popup
'
,
{
userReaction
:
'
install
'
,
extId
});
this
.
instantiationService
.
createInstance
(
InstallRecommendedExtensionAction
,
extId
).
run
();
this
.
_
telemetryService
.
publicLog
(
'
terminalLaunchRecommendation:popup
'
,
{
userReaction
:
'
install
'
,
extId
});
this
.
_
instantiationService
.
createInstance
(
InstallRecommendedExtensionAction
,
extId
).
run
();
}
}
],
...
...
@@ -260,7 +260,7 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
"userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this
.
telemetryService
.
publicLog
(
'
terminalLaunchRecommendation:popup
'
,
{
userReaction
:
'
cancelled
'
});
this
.
_
telemetryService
.
publicLog
(
'
terminalLaunchRecommendation:popup
'
,
{
userReaction
:
'
cancelled
'
});
}
}
);
...
...
@@ -268,7 +268,7 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
}
}
private
async
isExtensionInstalled
(
id
:
string
):
Promise
<
boolean
>
{
private
async
_
isExtensionInstalled
(
id
:
string
):
Promise
<
boolean
>
{
const
extensions
=
await
this
.
_extensionManagementService
.
getInstalled
();
return
extensions
.
some
(
e
=>
e
.
identifier
.
id
===
id
);
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts
浏览文件 @
a6a9f771
...
...
@@ -47,7 +47,7 @@ export class TerminalFindWidget extends SimpleFindWidget {
}
}
protected
onInputChanged
()
{
protected
_
onInputChanged
()
{
// Ignore input changes for now
const
instance
=
this
.
_terminalService
.
getActiveInstance
();
if
(
instance
!==
null
)
{
...
...
@@ -56,7 +56,7 @@ export class TerminalFindWidget extends SimpleFindWidget {
return
false
;
}
protected
onFocusTrackerFocus
()
{
protected
_
onFocusTrackerFocus
()
{
const
instance
=
this
.
_terminalService
.
getActiveInstance
();
if
(
instance
)
{
instance
.
notifyFindWidgetFocusChanged
(
true
);
...
...
@@ -64,7 +64,7 @@ export class TerminalFindWidget extends SimpleFindWidget {
this
.
_findWidgetFocused
.
set
(
true
);
}
protected
onFocusTrackerBlur
()
{
protected
_
onFocusTrackerBlur
()
{
const
instance
=
this
.
_terminalService
.
getActiveInstance
();
if
(
instance
)
{
instance
.
notifyFindWidgetFocusChanged
(
false
);
...
...
@@ -72,11 +72,11 @@ export class TerminalFindWidget extends SimpleFindWidget {
this
.
_findWidgetFocused
.
reset
();
}
protected
onFindInputFocusTrackerFocus
()
{
protected
_
onFindInputFocusTrackerFocus
()
{
this
.
_findInputFocused
.
set
(
true
);
}
protected
onFindInputFocusTrackerBlur
()
{
protected
_
onFindInputFocusTrackerBlur
()
{
this
.
_findInputFocused
.
reset
();
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
浏览文件 @
a6a9f771
...
...
@@ -448,7 +448,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
}
else
{
// For normal terminals write a message indicating what happened and relaunch
// using the previous shellLaunchConfig
le
t
message
=
localize
(
'
ptyHostRelaunch
'
,
"
Restarting the terminal because the connection to the shell process was lost...
"
);
cons
t
message
=
localize
(
'
ptyHostRelaunch
'
,
"
Restarting the terminal because the connection to the shell process was lost...
"
);
this
.
_onProcessData
.
fire
({
data
:
formatMessageForTerminal
(
message
),
trackCommit
:
false
});
await
this
.
relaunch
(
this
.
_shellLaunchConfig
,
this
.
_dimensions
.
cols
,
this
.
_dimensions
.
rows
,
this
.
_isScreenReaderModeEnabled
,
false
);
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.ts
浏览文件 @
a6a9f771
...
...
@@ -18,16 +18,16 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
static
PREFIX
=
'
term
'
;
constructor
(
@
ITerminalService
private
readonly
terminalService
:
ITerminalService
,
@
ICommandService
private
readonly
commandService
:
ICommandService
,
@
ITerminalService
private
readonly
_
terminalService
:
ITerminalService
,
@
ICommandService
private
readonly
_
commandService
:
ICommandService
,
)
{
super
(
TerminalQuickAccessProvider
.
PREFIX
,
{
canAcceptInBackground
:
true
});
}
protected
getPicks
(
filter
:
string
):
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
{
protected
_
getPicks
(
filter
:
string
):
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
{
const
terminalPicks
:
Array
<
IPickerQuickAccessItem
|
IQuickPickSeparator
>
=
[];
const
terminalTabs
=
this
.
terminalService
.
terminalTabs
;
const
terminalTabs
=
this
.
_
terminalService
.
terminalTabs
;
for
(
let
tabIndex
=
0
;
tabIndex
<
terminalTabs
.
length
;
tabIndex
++
)
{
const
terminalTab
=
terminalTabs
[
tabIndex
];
for
(
let
terminalIndex
=
0
;
terminalIndex
<
terminalTab
.
terminalInstances
.
length
;
terminalIndex
++
)
{
...
...
@@ -52,7 +52,7 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
trigger
:
buttonIndex
=>
{
switch
(
buttonIndex
)
{
case
0
:
this
.
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
RENAME
,
terminal
);
this
.
_
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
RENAME
,
terminal
);
return
TriggerAction
.
NO_ACTION
;
case
1
:
terminal
.
dispose
(
true
);
...
...
@@ -62,8 +62,8 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
return
TriggerAction
.
NO_ACTION
;
},
accept
:
(
keyMod
,
event
)
=>
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
!
event
.
inBackground
);
this
.
_
terminalService
.
setActiveInstance
(
terminal
);
this
.
_
terminalService
.
showPanel
(
!
event
.
inBackground
);
}
});
}
...
...
@@ -78,13 +78,13 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
terminalPicks
.
push
({
label
:
`$(plus)
${
createTerminalLabel
}
`
,
ariaLabel
:
createTerminalLabel
,
accept
:
()
=>
this
.
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
NEW
)
accept
:
()
=>
this
.
_
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
NEW
)
});
const
createWithProfileLabel
=
localize
(
"
workbench.action.terminal.newWithProfilePlus
"
,
"
Create New Terminal With Profile
"
);
terminalPicks
.
push
({
label
:
`$(plus)
${
createWithProfileLabel
}
`
,
ariaLabel
:
createWithProfileLabel
,
accept
:
()
=>
this
.
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
NEW_WITH_PROFILE
)
accept
:
()
=>
this
.
_
commandService
.
executeCommand
(
TERMINAL_COMMAND_ID
.
NEW_WITH_PROFILE
)
});
return
terminalPicks
;
...
...
src/vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget.ts
浏览文件 @
a6a9f771
...
...
@@ -43,7 +43,7 @@ export class EnvironmentVariableInfoWidget extends Widget implements ITerminalWi
const
scheduler
:
RunOnceScheduler
=
new
RunOnceScheduler
(()
=>
this
.
_showHover
(),
this
.
_configurationService
.
getValue
<
number
>
(
'
workbench.hover.delay
'
));
this
.
_register
(
scheduler
);
le
t
origin
=
{
x
:
0
,
y
:
0
};
cons
t
origin
=
{
x
:
0
,
y
:
0
};
this
.
onmouseover
(
this
.
_domNode
,
e
=>
{
origin
.
x
=
e
.
browserEvent
.
pageX
;
...
...
src/vs/workbench/contrib/terminal/test/browser/terminalTypeahead.test.ts
浏览文件 @
a6a9f771
...
...
@@ -389,35 +389,35 @@ suite('Workbench - Terminal Typeahead', () => {
class
TestTypeAheadAddon
extends
TypeAheadAddon
{
public
unlockMakingPredictions
()
{
this
.
lastRow
=
{
y
:
1
,
startingX
:
100
,
endingX
:
100
,
charState
:
CharPredictState
.
Validated
};
this
.
_
lastRow
=
{
y
:
1
,
startingX
:
100
,
endingX
:
100
,
charState
:
CharPredictState
.
Validated
};
}
public
lockMakingPredictions
()
{
this
.
lastRow
=
undefined
;
this
.
_
lastRow
=
undefined
;
}
public
unlockNavigating
()
{
this
.
lastRow
=
{
y
:
1
,
startingX
:
1
,
endingX
:
1
,
charState
:
CharPredictState
.
Validated
};
this
.
_
lastRow
=
{
y
:
1
,
startingX
:
1
,
endingX
:
1
,
charState
:
CharPredictState
.
Validated
};
}
public
reevaluateNow
()
{
this
.
reevaluatePredictorStateNow
(
this
.
stats
!
,
this
.
timeline
!
);
this
.
_reevaluatePredictorStateNow
(
this
.
stats
!
,
this
.
_
timeline
!
);
}
public
get
isShowing
()
{
return
!!
this
.
timeline
?.
isShowingPredictions
;
return
!!
this
.
_
timeline
?.
isShowingPredictions
;
}
public
undoAllPredictions
()
{
this
.
timeline
?.
undoAllPredictions
();
this
.
_
timeline
?.
undoAllPredictions
();
}
public
physicalCursor
(
buffer
:
IBuffer
)
{
return
this
.
timeline
?.
physicalCursor
(
buffer
);
return
this
.
_
timeline
?.
physicalCursor
(
buffer
);
}
public
tentativeCursor
(
buffer
:
IBuffer
)
{
return
this
.
timeline
?.
tentativeCursor
(
buffer
);
return
this
.
_
timeline
?.
tentativeCursor
(
buffer
);
}
}
...
...
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
浏览文件 @
a6a9f771
...
...
@@ -46,7 +46,7 @@ export class WebviewFindWidget extends SimpleFindWidget {
this
.
_delegate
.
focus
();
}
public
onInputChanged
()
{
public
_
onInputChanged
()
{
const
val
=
this
.
inputValue
;
if
(
val
)
{
this
.
_delegate
.
startFind
(
val
);
...
...
@@ -56,17 +56,17 @@ export class WebviewFindWidget extends SimpleFindWidget {
return
false
;
}
protected
onFocusTrackerFocus
()
{
protected
_
onFocusTrackerFocus
()
{
this
.
_findWidgetFocused
.
set
(
true
);
}
protected
onFocusTrackerBlur
()
{
protected
_
onFocusTrackerBlur
()
{
this
.
_findWidgetFocused
.
reset
();
}
protected
onFindInputFocusTrackerFocus
()
{
}
protected
_
onFindInputFocusTrackerFocus
()
{
}
protected
onFindInputFocusTrackerBlur
()
{
}
protected
_
onFindInputFocusTrackerBlur
()
{
}
protected
findFirst
()
{
}
}
src/vs/workbench/test/browser/quickAccess.test.ts
浏览文件 @
a6a9f771
...
...
@@ -207,7 +207,7 @@ suite('QuickAccess', () => {
super
(
'
fast
'
);
}
protected
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Array
<
IQuickPickItem
>
{
protected
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Array
<
IQuickPickItem
>
{
fastProviderCalled
=
true
;
return
[{
label
:
'
Fast Pick
'
}];
...
...
@@ -220,7 +220,7 @@ suite('QuickAccess', () => {
super
(
'
slow
'
);
}
protected
async
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
IQuickPickItem
>>
{
protected
async
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
Promise
<
Array
<
IQuickPickItem
>>
{
slowProviderCalled
=
true
;
await
timeout
(
1
);
...
...
@@ -239,7 +239,7 @@ suite('QuickAccess', () => {
super
(
'
bothFastAndSlow
'
);
}
protected
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
FastAndSlowPicks
<
IQuickPickItem
>
{
protected
_
getPicks
(
filter
:
string
,
disposables
:
DisposableStore
,
token
:
CancellationToken
):
FastAndSlowPicks
<
IQuickPickItem
>
{
fastAndSlowProviderCalled
=
true
;
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录