Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fc8805df
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,发现更多精彩内容 >>
未验证
提交
fc8805df
编写于
9月 16, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adopt new APIs (for #103454)
上级
953d32c4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
32 addition
and
36 deletion
+32
-36
src/vs/base/browser/fastDomNode.ts
src/vs/base/browser/fastDomNode.ts
+1
-3
src/vs/base/browser/ui/findinput/findInput.ts
src/vs/base/browser/ui/findinput/findInput.ts
+5
-5
src/vs/base/browser/ui/findinput/replaceInput.ts
src/vs/base/browser/ui/findinput/replaceInput.ts
+5
-5
src/vs/base/parts/ipc/common/ipc.ts
src/vs/base/parts/ipc/common/ipc.ts
+1
-1
src/vs/editor/browser/controller/textAreaState.ts
src/vs/editor/browser/controller/textAreaState.ts
+2
-2
src/vs/editor/common/controller/cursorTypeOperations.ts
src/vs/editor/common/controller/cursorTypeOperations.ts
+1
-1
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+11
-11
src/vs/editor/contrib/hover/hoverWidgets.ts
src/vs/editor/contrib/hover/hoverWidgets.ts
+2
-3
src/vs/editor/contrib/links/links.ts
src/vs/editor/contrib/links/links.ts
+3
-4
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
+1
-1
未找到文件。
src/vs/base/browser/fastDomNode.ts
浏览文件 @
fc8805df
...
...
@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
dom
from
'
vs/base/browser/dom
'
;
export
class
FastDomNode
<
T
extends
HTMLElement
>
{
public
readonly
domNode
:
T
;
...
...
@@ -176,7 +174,7 @@ export class FastDomNode<T extends HTMLElement> {
}
public
toggleClassName
(
className
:
string
,
shouldHaveIt
?:
boolean
):
void
{
dom
.
toggleClass
(
this
.
domNode
,
className
,
shouldHaveIt
);
this
.
domNode
.
classList
.
toggle
(
className
,
shouldHaveIt
);
this
.
_className
=
this
.
domNode
.
className
;
}
...
...
src/vs/base/browser/ui/findinput/findInput.ts
浏览文件 @
fc8805df
...
...
@@ -128,7 +128,7 @@ export class FindInput extends Widget {
const
flexibleMaxHeight
=
options
.
flexibleMaxHeight
;
this
.
domNode
=
document
.
createElement
(
'
div
'
);
dom
.
addClass
(
this
.
domNode
,
'
monaco-findInput
'
);
this
.
domNode
.
classList
.
add
(
'
monaco-findInput
'
);
this
.
inputBox
=
this
.
_register
(
new
HistoryInputBox
(
this
.
domNode
,
this
.
contextViewProvider
,
{
placeholder
:
this
.
placeholder
||
''
,
...
...
@@ -258,7 +258,7 @@ export class FindInput extends Widget {
}
public
enable
():
void
{
dom
.
removeClass
(
this
.
domNode
,
'
disabled
'
);
this
.
domNode
.
classList
.
remove
(
'
disabled
'
);
this
.
inputBox
.
enable
();
this
.
regex
.
enable
();
this
.
wholeWords
.
enable
();
...
...
@@ -266,7 +266,7 @@ export class FindInput extends Widget {
}
public
disable
():
void
{
dom
.
addClass
(
this
.
domNode
,
'
disabled
'
);
this
.
domNode
.
classList
.
add
(
'
disabled
'
);
this
.
inputBox
.
disable
();
this
.
regex
.
disable
();
this
.
wholeWords
.
disable
();
...
...
@@ -398,9 +398,9 @@ export class FindInput extends Widget {
private
_lastHighlightFindOptions
:
number
=
0
;
public
highlightFindOptions
():
void
{
dom
.
removeClass
(
this
.
domNode
,
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
domNode
.
classList
.
remove
(
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
_lastHighlightFindOptions
=
1
-
this
.
_lastHighlightFindOptions
;
dom
.
addClass
(
this
.
domNode
,
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
domNode
.
classList
.
add
(
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
}
public
validate
():
void
{
...
...
src/vs/base/browser/ui/findinput/replaceInput.ts
浏览文件 @
fc8805df
...
...
@@ -134,7 +134,7 @@ export class ReplaceInput extends Widget {
const
flexibleMaxHeight
=
options
.
flexibleMaxHeight
;
this
.
domNode
=
document
.
createElement
(
'
div
'
);
dom
.
addClass
(
this
.
domNode
,
'
monaco-findInput
'
);
this
.
domNode
.
classList
.
add
(
'
monaco-findInput
'
);
this
.
inputBox
=
this
.
_register
(
new
HistoryInputBox
(
this
.
domNode
,
this
.
contextViewProvider
,
{
ariaLabel
:
this
.
label
||
''
,
...
...
@@ -231,13 +231,13 @@ export class ReplaceInput extends Widget {
}
public
enable
():
void
{
dom
.
removeClass
(
this
.
domNode
,
'
disabled
'
);
this
.
domNode
.
classList
.
remove
(
'
disabled
'
);
this
.
inputBox
.
enable
();
this
.
preserveCase
.
enable
();
}
public
disable
():
void
{
dom
.
addClass
(
this
.
domNode
,
'
disabled
'
);
this
.
domNode
.
classList
.
add
(
'
disabled
'
);
this
.
inputBox
.
disable
();
this
.
preserveCase
.
disable
();
}
...
...
@@ -344,9 +344,9 @@ export class ReplaceInput extends Widget {
private
_lastHighlightFindOptions
:
number
=
0
;
public
highlightFindOptions
():
void
{
dom
.
removeClass
(
this
.
domNode
,
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
domNode
.
classList
.
remove
(
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
_lastHighlightFindOptions
=
1
-
this
.
_lastHighlightFindOptions
;
dom
.
addClass
(
this
.
domNode
,
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
this
.
domNode
.
classList
.
add
(
'
highlight-
'
+
(
this
.
_lastHighlightFindOptions
));
}
public
validate
():
void
{
...
...
src/vs/base/parts/ipc/common/ipc.ts
浏览文件 @
fc8805df
...
...
@@ -1185,7 +1185,7 @@ export function logWithColors(direction: string, totalLength: number, msgLength:
const
colorTable
=
colorTables
[
initiator
];
const
color
=
colorTable
[
req
%
colorTable
.
length
];
let
args
=
[
`%c[
${
direction
}
]%c[
${
strings
.
pad
(
totalLength
,
7
,
'
'
)}
]%c[len:
${
strings
.
pad
(
msgLength
,
5
,
'
'
)}
]%c
${
strings
.
pad
(
req
,
5
,
'
'
)}
-
${
str
}
`
,
'
color: darkgreen
'
,
'
color: grey
'
,
'
color: grey
'
,
`color:
${
color
}
`
];
let
args
=
[
`%c[
${
direction
}
]%c[
${
String
(
totalLength
).
padStart
(
7
,
'
'
)}
]%c[len:
${
String
(
msgLength
).
padStart
(
5
,
'
'
)}
]%c
${
String
(
req
).
padStart
(
5
,
'
'
)}
-
${
str
}
`
,
'
color: darkgreen
'
,
'
color: grey
'
,
'
color: grey
'
,
`color:
${
color
}
`
];
if
(
/
\(
$/
.
test
(
str
))
{
args
=
args
.
concat
(
data
);
args
.
push
(
'
)
'
);
...
...
src/vs/editor/browser/controller/textAreaState.ts
浏览文件 @
fc8805df
...
...
@@ -145,13 +145,13 @@ export class TextAreaState {
if
(
currentSelectionStart
===
currentValue
.
length
)
{
// emoji potentially inserted "somewhere" after the previous selection => it should appear at the end of `currentValue`
if
(
strings
.
startsWith
(
currentValue
,
previousValue
))
{
if
(
currentValue
.
startsWith
(
previousValue
))
{
// only if all of the old text is accounted for
potentialEmojiInput
=
currentValue
.
substring
(
previousValue
.
length
);
}
}
else
{
// emoji potentially inserted "somewhere" before the previous selection => it should appear at the start of `currentValue`
if
(
strings
.
endsWith
(
currentValue
,
previousValue
))
{
if
(
currentValue
.
endsWith
(
previousValue
))
{
// only if all of the old text is accounted for
potentialEmojiInput
=
currentValue
.
substring
(
0
,
currentValue
.
length
-
previousValue
.
length
);
}
...
...
src/vs/editor/common/controller/cursorTypeOperations.ts
浏览文件 @
fc8805df
...
...
@@ -228,7 +228,7 @@ export class TypeOperations {
let
goodIndent
=
this
.
_goodIndentForLine
(
config
,
model
,
selection
.
startLineNumber
);
goodIndent
=
goodIndent
||
'
\t
'
;
let
possibleTypeText
=
config
.
normalizeIndentation
(
goodIndent
);
if
(
!
strings
.
startsWith
(
lineText
,
possibleTypeText
))
{
if
(
!
lineText
.
startsWith
(
possibleTypeText
))
{
commands
[
i
]
=
new
ReplaceCommand
(
new
Range
(
selection
.
startLineNumber
,
1
,
selection
.
startLineNumber
,
lineText
.
length
+
1
),
possibleTypeText
,
true
);
continue
;
}
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
fc8805df
...
...
@@ -363,7 +363,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
}
if
(
e
.
searchString
||
e
.
matchesCount
||
e
.
matchesPosition
)
{
let
showRedOutline
=
(
this
.
_state
.
searchString
.
length
>
0
&&
this
.
_state
.
matchesCount
===
0
);
dom
.
toggleClass
(
this
.
_domNode
,
'
no-results
'
,
showRedOutline
);
this
.
_domNode
.
classList
.
toggle
(
'
no-results
'
,
showRedOutline
);
this
.
_updateMatchesCount
();
this
.
_updateButtons
();
...
...
@@ -477,7 +477,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this
.
_replaceBtn
.
setEnabled
(
this
.
_isVisible
&&
this
.
_isReplaceVisible
&&
findInputIsNonEmpty
);
this
.
_replaceAllBtn
.
setEnabled
(
this
.
_isVisible
&&
this
.
_isReplaceVisible
&&
findInputIsNonEmpty
);
dom
.
toggleClass
(
this
.
_domNode
,
'
replaceToggled
'
,
this
.
_isReplaceVisible
);
this
.
_domNode
.
classList
.
toggle
(
'
replaceToggled
'
,
this
.
_isReplaceVisible
);
this
.
_toggleReplaceBtn
.
setExpanded
(
this
.
_isReplaceVisible
);
let
canReplace
=
!
this
.
_codeEditor
.
getOption
(
EditorOption
.
readOnly
);
...
...
@@ -510,7 +510,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this
.
_updateButtons
();
setTimeout
(()
=>
{
dom
.
addClass
(
this
.
_domNode
,
'
visible
'
);
this
.
_domNode
.
classList
.
add
(
'
visible
'
);
this
.
_domNode
.
setAttribute
(
'
aria-hidden
'
,
'
false
'
);
},
0
);
...
...
@@ -557,7 +557,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this
.
_updateButtons
();
dom
.
removeClass
(
this
.
_domNode
,
'
visible
'
);
this
.
_domNode
.
classList
.
remove
(
'
visible
'
);
this
.
_domNode
.
setAttribute
(
'
aria-hidden
'
,
'
true
'
);
this
.
_findInput
.
clearMessage
();
if
(
focusTheEditor
)
{
...
...
@@ -695,10 +695,10 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
if
(
editorContentWidth
<=
0
)
{
// for example, diff view original editor
dom
.
addClass
(
this
.
_domNode
,
'
hiddenEditor
'
);
this
.
_domNode
.
classList
.
add
(
'
hiddenEditor
'
);
return
;
}
else
if
(
dom
.
hasClass
(
this
.
_domNode
,
'
hiddenEditor
'
))
{
dom
.
removeClass
(
this
.
_domNode
,
'
hiddenEditor
'
);
}
else
if
(
this
.
_domNode
.
classList
.
contains
(
'
hiddenEditor
'
))
{
this
.
_domNode
.
classList
.
remove
(
'
hiddenEditor
'
);
}
const
editorWidth
=
layoutInfo
.
width
;
...
...
@@ -727,9 +727,9 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
if
(
FIND_WIDGET_INITIAL_WIDTH
+
28
+
minimapWidth
-
MAX_MATCHES_COUNT_WIDTH
>=
editorWidth
+
50
)
{
collapsedFindWidget
=
true
;
}
dom
.
toggleClass
(
this
.
_domNode
,
'
collapsed-find-widget
'
,
collapsedFindWidget
);
dom
.
toggleClass
(
this
.
_domNode
,
'
narrow-find-widget
'
,
narrowFindWidget
);
dom
.
toggleClass
(
this
.
_domNode
,
'
reduced-find-widget
'
,
reducedFindWidget
);
this
.
_domNode
.
classList
.
toggle
(
'
collapsed-find-widget
'
,
collapsedFindWidget
);
this
.
_domNode
.
classList
.
toggle
(
'
narrow-find-widget
'
,
narrowFindWidget
);
this
.
_domNode
.
classList
.
toggle
(
'
reduced-find-widget
'
,
reducedFindWidget
);
if
(
!
narrowFindWidget
&&
!
collapsedFindWidget
)
{
// the minimal left offset of findwidget is 15px.
...
...
@@ -1306,7 +1306,7 @@ export class SimpleButton extends Widget {
}
public
setEnabled
(
enabled
:
boolean
):
void
{
dom
.
toggleClass
(
this
.
_domNode
,
'
disabled
'
,
!
enabled
);
this
.
_domNode
.
classList
.
toggle
(
'
disabled
'
,
!
enabled
);
this
.
_domNode
.
setAttribute
(
'
aria-disabled
'
,
String
(
!
enabled
));
this
.
_domNode
.
tabIndex
=
enabled
?
0
:
-
1
;
}
...
...
src/vs/editor/contrib/hover/hoverWidgets.ts
浏览文件 @
fc8805df
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Widget
}
from
'
vs/base/browser/ui/widget
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
...
...
@@ -35,7 +34,7 @@ export class ContentHoverWidget extends Widget implements IContentWidget {
protected
set
isVisible
(
value
:
boolean
)
{
this
.
_isVisible
=
value
;
dom
.
toggleClass
(
this
.
_hover
.
containerDomNode
,
'
hidden
'
,
!
this
.
_isVisible
);
this
.
_hover
.
containerDomNode
.
classList
.
toggle
(
'
hidden
'
,
!
this
.
_isVisible
);
}
constructor
(
...
...
@@ -203,7 +202,7 @@ export class GlyphHoverWidget extends Widget implements IOverlayWidget {
protected
set
isVisible
(
value
:
boolean
)
{
this
.
_isVisible
=
value
;
dom
.
toggleClass
(
this
.
_domNode
,
'
hidden
'
,
!
this
.
_isVisible
);
this
.
_domNode
.
classList
.
toggle
(
'
hidden
'
,
!
this
.
_isVisible
);
}
public
getId
():
string
{
...
...
src/vs/editor/contrib/links/links.ts
浏览文件 @
fc8805df
...
...
@@ -28,7 +28,6 @@ import { EditorOption } from 'vs/editor/common/config/editorOptions';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
function
getHoverMessage
(
link
:
Link
,
useMetaKey
:
boolean
):
MarkdownString
{
const
executeCmd
=
link
.
url
&&
/^command:/i
.
test
(
link
.
url
.
toString
());
...
...
@@ -299,15 +298,15 @@ export class LinkDetector implements IEditorContribution {
// Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt
if
(
typeof
uri
===
'
string
'
&&
this
.
editor
.
hasModel
())
{
const
modelUri
=
this
.
editor
.
getModel
().
uri
;
if
(
modelUri
.
scheme
===
Schemas
.
file
&&
strings
.
startsWith
(
uri
,
'
file:
'
))
{
if
(
modelUri
.
scheme
===
Schemas
.
file
&&
uri
.
startsWith
(
'
file:
'
))
{
const
parsedUri
=
URI
.
parse
(
uri
);
if
(
parsedUri
.
scheme
===
Schemas
.
file
)
{
const
fsPath
=
resources
.
originalFSPath
(
parsedUri
);
let
relativePath
:
string
|
null
=
null
;
if
(
strings
.
startsWith
(
fsPath
,
'
/./
'
))
{
if
(
fsPath
.
startsWith
(
'
/./
'
))
{
relativePath
=
`.
${
fsPath
.
substr
(
1
)}
`
;
}
else
if
(
strings
.
startsWith
(
fsPath
,
'
//./
'
))
{
}
else
if
(
fsPath
.
startsWith
(
'
//./
'
))
{
relativePath
=
`.
${
fsPath
.
substr
(
2
)}
`
;
}
...
...
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
浏览文件 @
fc8805df
...
...
@@ -451,7 +451,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
this
.
container
.
classList
.
remove
(
classToReplace
);
}
dom
.
addClass
(
this
.
container
,
className
);
this
.
container
.
classList
.
add
(
className
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录