Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
349c9b9b
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,发现更多精彩内容 >>
提交
349c9b9b
编写于
3月 16, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check if there are more characters on a line after a "configurations": [, if yes enter a newline
fixes #22624
上级
fa2e9d17
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
10 deletion
+15
-10
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+15
-10
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
349c9b9b
...
...
@@ -19,10 +19,9 @@ import { StandardTokenType } from 'vs/editor/common/modes';
import
{
DEFAULT_WORD_REGEXP
}
from
'
vs/editor/common/model/wordHelper
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
IDecorationOptions
,
IModelDecorationOptions
,
MouseTargetType
,
IModelDeltaDecoration
,
TrackedRangeStickiness
,
IPosition
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IDecorationOptions
,
IModelDecorationOptions
,
MouseTargetType
,
IModelDeltaDecoration
,
TrackedRangeStickiness
,
IPosition
,
Handler
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -396,7 +395,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
public
addLaunchConfiguration
():
TPromise
<
any
>
{
this
.
telemetryService
.
publicLog
(
'
debug/addLaunchConfiguration
'
);
let
configurationsPosition
:
IPosition
;
let
configurations
Array
Position
:
IPosition
;
const
model
=
this
.
editor
.
getModel
();
let
depthInArray
=
0
;
let
lastProperty
:
string
;
...
...
@@ -407,7 +406,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
},
onArrayBegin
:
(
offset
:
number
,
length
:
number
)
=>
{
if
(
lastProperty
===
'
configurations
'
&&
depthInArray
===
0
)
{
configurations
Position
=
model
.
getPositionAt
(
offset
);
configurations
ArrayPosition
=
model
.
getPositionAt
(
offset
+
1
);
}
depthInArray
++
;
},
...
...
@@ -417,21 +416,27 @@ export class DebugEditorContribution implements IDebugEditorContribution {
});
this
.
editor
.
focus
();
if
(
!
configurationsPosition
)
{
if
(
!
configurations
Array
Position
)
{
return
this
.
commandService
.
executeCommand
(
'
editor.action.triggerSuggest
'
);
}
const
insertLineAfter
=
(
lineNumber
:
number
):
TPromise
<
any
>
=>
{
if
(
this
.
editor
.
getModel
().
getLineLastNonWhitespaceColumn
(
lineNumber
+
1
)
===
0
)
{
this
.
editor
.
setSelection
(
new
Selection
(
lineNumber
+
1
,
Number
.
MAX_VALUE
,
lineNumber
+
1
,
Number
.
MAX_VALUE
));
const
insertLine
=
(
position
:
IPosition
):
TPromise
<
any
>
=>
{
// Check if there are more characters on a line after a "configurations": [, if yes enter a newline
if
(
this
.
editor
.
getModel
().
getLineLastNonWhitespaceColumn
(
position
.
lineNumber
)
>
position
.
column
)
{
this
.
editor
.
setPosition
(
position
);
this
.
editor
.
trigger
(
this
.
getId
(),
Handler
.
LineBreakInsert
,
undefined
);
}
// Check if there is already an empty line to insert suggest, if yes just place the cursor
if
(
this
.
editor
.
getModel
().
getLineLastNonWhitespaceColumn
(
position
.
lineNumber
+
1
)
===
0
)
{
this
.
editor
.
setPosition
({
lineNumber
:
position
.
lineNumber
+
1
,
column
:
Constants
.
MAX_SAFE_SMALL_INTEGER
});
return
TPromise
.
as
(
null
);
}
this
.
editor
.
set
Selection
(
new
Selection
(
lineNumber
,
Number
.
MAX_VALUE
,
lineNumber
,
Number
.
MAX_VALUE
)
);
this
.
editor
.
set
Position
(
position
);
return
this
.
commandService
.
executeCommand
(
'
editor.action.insertLineAfter
'
);
};
return
insertLine
After
(
configurationsPosition
.
lineNumber
).
then
(()
=>
this
.
commandService
.
executeCommand
(
'
editor.action.triggerSuggest
'
));
return
insertLine
(
configurationsArrayPosition
).
then
(()
=>
this
.
commandService
.
executeCommand
(
'
editor.action.triggerSuggest
'
));
}
private
static
BREAKPOINT_HELPER_DECORATION
:
IModelDecorationOptions
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录