Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
dcd813e6
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,发现更多精彩内容 >>
提交
dcd813e6
编写于
4月 18, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use Codicon.lightBulb
上级
3237fbc6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
12 deletion
+23
-12
src/vs/editor/browser/widget/inlineDiffMargin.ts
src/vs/editor/browser/widget/inlineDiffMargin.ts
+2
-1
src/vs/editor/contrib/codeAction/lightBulbWidget.ts
src/vs/editor/contrib/codeAction/lightBulbWidget.ts
+16
-8
src/vs/workbench/contrib/markers/browser/markersView.ts
src/vs/workbench/contrib/markers/browser/markersView.ts
+3
-2
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
...s/workbench/contrib/markers/browser/markersViewActions.ts
+2
-1
未找到文件。
src/vs/editor/browser/widget/inlineDiffMargin.ts
浏览文件 @
dcd813e6
...
...
@@ -13,6 +13,7 @@ import { IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrow
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
export
interface
IDiffLinesChange
{
readonly
originalStartLineNumber
:
number
;
...
...
@@ -57,7 +58,7 @@ export class InlineDiffMargin extends Disposable {
this
.
_marginDomNode
.
style
.
zIndex
=
'
10
'
;
this
.
_diffActions
=
document
.
createElement
(
'
div
'
);
this
.
_diffActions
.
className
=
'
codicon codicon-lightbulb
lightbulb-glyph
'
;
this
.
_diffActions
.
className
=
Codicon
.
lightBulb
.
classNames
+
'
lightbulb-glyph
'
;
this
.
_diffActions
.
style
.
position
=
'
absolute
'
;
const
lineHeight
=
editor
.
getOption
(
EditorOption
.
lineHeight
);
const
lineFeed
=
editor
.
getModel
()
!
.
getEOL
();
...
...
src/vs/editor/contrib/codeAction/lightBulbWidget.ts
浏览文件 @
dcd813e6
...
...
@@ -19,6 +19,7 @@ import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/
import
{
editorLightBulbForeground
,
editorLightBulbAutoFixForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
Gesture
}
from
'
vs/base/browser/touch
'
;
import
type
{
CodeActionTrigger
}
from
'
vs/editor/contrib/codeAction/types
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
namespace
LightBulbState
{
...
...
@@ -63,7 +64,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
)
{
super
();
this
.
_domNode
=
document
.
createElement
(
'
div
'
);
this
.
_domNode
.
className
=
'
codicon codicon-lightbulb
'
;
this
.
_domNode
.
className
=
Codicon
.
lightBulb
.
classNames
;
this
.
_editor
.
addContentWidget
(
this
);
...
...
@@ -121,8 +122,8 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
}
}));
this
.
_updateLightBulbTitle
();
this
.
_register
(
this
.
_keybindingService
.
onDidUpdateKeybindings
(
this
.
_updateLightBulbTitle
,
this
));
this
.
_updateLightBulbTitle
AndIcon
();
this
.
_register
(
this
.
_keybindingService
.
onDidUpdateKeybindings
(
this
.
_updateLightBulbTitle
AndIcon
,
this
));
}
dispose
():
void
{
...
...
@@ -184,7 +185,6 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
position
:
{
lineNumber
:
effectiveLineNumber
,
column
:
1
},
preference
:
LightBulbWidget
.
_posPref
});
dom
.
toggleClass
(
this
.
_domNode
,
'
codicon-lightbulb-autofix
'
,
actions
.
hasAutoFix
);
this
.
_editor
.
layoutContentWidget
(
this
);
}
...
...
@@ -197,11 +197,15 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
private
set
state
(
value
)
{
this
.
_state
=
value
;
this
.
_updateLightBulbTitle
();
this
.
_updateLightBulbTitle
AndIcon
();
}
private
_updateLightBulbTitle
():
void
{
private
_updateLightBulbTitle
AndIcon
():
void
{
if
(
this
.
state
.
type
===
LightBulbState
.
Type
.
Showing
&&
this
.
state
.
actions
.
hasAutoFix
)
{
// update icon
dom
.
removeClasses
(
this
.
_domNode
,
Codicon
.
lightBulb
.
classNames
);
dom
.
addClasses
(
this
.
_domNode
,
Codicon
.
lightbulbAutofix
.
classNames
);
const
preferredKb
=
this
.
_keybindingService
.
lookupKeybinding
(
this
.
_preferredFixActionId
);
if
(
preferredKb
)
{
this
.
title
=
nls
.
localize
(
'
prefferedQuickFixWithKb
'
,
"
Show Fixes. Preferred Fix Available ({0})
"
,
preferredKb
.
getLabel
());
...
...
@@ -209,6 +213,10 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
}
}
// update icon
dom
.
removeClasses
(
this
.
_domNode
,
Codicon
.
lightbulbAutofix
.
classNames
);
dom
.
addClasses
(
this
.
_domNode
,
Codicon
.
lightBulb
.
classNames
);
const
kb
=
this
.
_keybindingService
.
lookupKeybinding
(
this
.
_quickFixActionId
);
if
(
kb
)
{
this
.
title
=
nls
.
localize
(
'
quickFixWithKb
'
,
"
Show Fixes ({0})
"
,
kb
.
getLabel
());
...
...
@@ -228,7 +236,7 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
const
editorLightBulbForegroundColor
=
theme
.
getColor
(
editorLightBulbForeground
);
if
(
editorLightBulbForegroundColor
)
{
collector
.
addRule
(
`
.monaco-editor .contentWidgets
.codicon-lightbulb
{
.monaco-editor .contentWidgets
${
Codicon
.
lightBulb
.
cssSelector
}
{
color:
${
editorLightBulbForegroundColor
}
;
}`
);
}
...
...
@@ -237,7 +245,7 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
const
editorLightBulbAutoFixForegroundColor
=
theme
.
getColor
(
editorLightBulbAutoFixForeground
);
if
(
editorLightBulbAutoFixForegroundColor
)
{
collector
.
addRule
(
`
.monaco-editor .contentWidgets
.codicon-lightbulb-autofix
{
.monaco-editor .contentWidgets
${
Codicon
.
lightbulbAutofix
.
cssSelector
}
{
color:
${
editorLightBulbAutoFixForegroundColor
}
;
}`
);
}
...
...
src/vs/workbench/contrib/markers/browser/markersView.ts
浏览文件 @
dcd813e6
...
...
@@ -49,6 +49,7 @@ import { editorLightBulbForeground, editorLightBulbAutoFixForeground } from 'vs/
import
{
ViewPane
,
IViewPaneOptions
}
from
'
vs/workbench/browser/parts/views/viewPaneContainer
'
;
import
{
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
function
createResourceMarkersIterator
(
resourceMarkers
:
ResourceMarkers
):
Iterable
<
ITreeElement
<
TreeElement
>>
{
return
Iterable
.
map
(
resourceMarkers
.
markers
,
m
=>
{
...
...
@@ -887,7 +888,7 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
const
editorLightBulbForegroundColor
=
theme
.
getColor
(
editorLightBulbForeground
);
if
(
editorLightBulbForegroundColor
)
{
collector
.
addRule
(
`
.monaco-workbench .markers-panel-container
.codicon-lightbulb
{
.monaco-workbench .markers-panel-container
${
Codicon
.
lightBulb
.
cssSelector
}
{
color:
${
editorLightBulbForegroundColor
}
;
}`
);
}
...
...
@@ -896,7 +897,7 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
const
editorLightBulbAutoFixForegroundColor
=
theme
.
getColor
(
editorLightBulbAutoFixForeground
);
if
(
editorLightBulbAutoFixForegroundColor
)
{
collector
.
addRule
(
`
.monaco-workbench .markers-panel-container
.codicon-lightbulb-autofix
{
.monaco-workbench .markers-panel-container
${
Codicon
.
lightbulbAutofix
.
cssSelector
}
{
color:
${
editorLightBulbAutoFixForegroundColor
}
;
}`
);
}
...
...
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
浏览文件 @
dcd813e6
...
...
@@ -26,6 +26,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
DropdownMenuActionViewItem
}
from
'
vs/base/browser/ui/dropdown/dropdown
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
export
class
ShowProblemsPanelAction
extends
Action
{
...
...
@@ -443,7 +444,7 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
export
class
QuickFixAction
extends
Action
{
public
static
readonly
ID
:
string
=
'
workbench.actions.problems.quickfix
'
;
private
static
readonly
CLASS
:
string
=
'
markers-panel-action-quickfix
codicon-lightbulb
'
;
private
static
readonly
CLASS
:
string
=
'
markers-panel-action-quickfix
'
+
Codicon
.
lightBulb
.
classNames
;
private
static
readonly
AUTO_FIX_CLASS
:
string
=
QuickFixAction
.
CLASS
+
'
autofixable
'
;
private
readonly
_onShowQuickFixes
=
this
.
_register
(
new
Emitter
<
void
>
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录