Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fea0ee3d
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,发现更多精彩内容 >>
提交
fea0ee3d
编写于
8月 29, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #57411: Rename `autoWrapping` to `autoSurround` to avoid confusions related to text wrapping
上级
1e164410
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
39 addition
and
39 deletion
+39
-39
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+5
-5
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+18
-18
src/vs/editor/common/controller/cursorCommon.ts
src/vs/editor/common/controller/cursorCommon.ts
+4
-4
src/vs/editor/common/controller/cursorTypeOperations.ts
src/vs/editor/common/controller/cursorTypeOperations.ts
+2
-2
src/vs/editor/test/browser/controller/cursor.test.ts
src/vs/editor/test/browser/controller/cursor.test.ts
+3
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+6
-6
src/vs/platform/telemetry/common/telemetryUtils.ts
src/vs/platform/telemetry/common/telemetryUtils.ts
+1
-1
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
fea0ee3d
...
...
@@ -524,17 +524,17 @@ const editorConfiguration: IConfigurationNode = {
'
default
'
:
EDITOR_DEFAULTS
.
autoClosingQuotes
,
'
description
'
:
nls
.
localize
(
'
autoClosingQuotes
'
,
"
Controls whether the editor should automatically close quotes after the user adds an opening quote.
"
)
},
'
editor.auto
Wrapping
'
:
{
'
editor.auto
Surround
'
:
{
type
:
'
string
'
,
enum
:
[
'
always
'
,
'
brackets
'
,
'
quotes
'
,
'
never
'
],
enumDescriptions
:
[
''
,
nls
.
localize
(
'
editor.auto
Wrapping.brackets
'
,
"
Wrap
with brackets but not quotes.
"
),
nls
.
localize
(
'
editor.auto
Wrapping.quotes
'
,
"
Wrap
with quotes but not brackets.
"
),
nls
.
localize
(
'
editor.auto
Surround.brackets
'
,
"
Surround
with brackets but not quotes.
"
),
nls
.
localize
(
'
editor.auto
Surround.quotes
'
,
"
Surround
with quotes but not brackets.
"
),
''
],
'
default
'
:
EDITOR_DEFAULTS
.
auto
Wrapping
,
'
description
'
:
nls
.
localize
(
'
auto
Wrapping
'
,
"
Controls whether the editor should automatically wrap
selections.
"
)
'
default
'
:
EDITOR_DEFAULTS
.
auto
Surround
,
'
description
'
:
nls
.
localize
(
'
auto
Surround
'
,
"
Controls whether the editor should automatically surround
selections.
"
)
},
'
editor.formatOnType
'
:
{
'
type
'
:
'
boolean
'
,
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
fea0ee3d
...
...
@@ -103,7 +103,7 @@ export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWh
/**
* Configuration options for auto wrapping quotes and brackets
*/
export
type
EditorAuto
Wrapping
Strategy
=
'
always
'
|
'
quotes
'
|
'
brackets
'
|
'
never
'
;
export
type
EditorAuto
Surround
Strategy
=
'
always
'
|
'
quotes
'
|
'
brackets
'
|
'
never
'
;
/**
* Configuration options for editor minimap
...
...
@@ -496,10 +496,10 @@ export interface IEditorOptions {
*/
autoClosingQuotes
?:
EditorAutoClosingStrategy
;
/**
* Options for auto
wrapp
ing.
* Defaults to always allowing auto
wrapp
ing.
* Options for auto
surround
ing.
* Defaults to always allowing auto
surround
ing.
*/
auto
Wrapping
?:
EditorAutoWrapping
Strategy
;
auto
Surround
?:
EditorAutoSurround
Strategy
;
/**
* Enable auto indentation adjustment.
* Defaults to false.
...
...
@@ -1002,7 +1002,7 @@ export interface IValidatedEditorOptions {
readonly
wordWrapBreakObtrusiveCharacters
:
string
;
readonly
autoClosingBrackets
:
EditorAutoClosingStrategy
;
readonly
autoClosingQuotes
:
EditorAutoClosingStrategy
;
readonly
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
readonly
auto
Surround
:
EditorAutoSurround
Strategy
;
readonly
autoIndent
:
boolean
;
readonly
dragAndDrop
:
boolean
;
readonly
emptySelectionClipboard
:
boolean
;
...
...
@@ -1039,7 +1039,7 @@ export class InternalEditorOptions {
readonly
wordSeparators
:
string
;
readonly
autoClosingBrackets
:
EditorAutoClosingStrategy
;
readonly
autoClosingQuotes
:
EditorAutoClosingStrategy
;
readonly
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
readonly
auto
Surround
:
EditorAutoSurround
Strategy
;
readonly
autoIndent
:
boolean
;
readonly
useTabStops
:
boolean
;
readonly
tabFocusMode
:
boolean
;
...
...
@@ -1068,7 +1068,7 @@ export class InternalEditorOptions {
wordSeparators
:
string
;
autoClosingBrackets
:
EditorAutoClosingStrategy
;
autoClosingQuotes
:
EditorAutoClosingStrategy
;
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
auto
Surround
:
EditorAutoSurround
Strategy
;
autoIndent
:
boolean
;
useTabStops
:
boolean
;
tabFocusMode
:
boolean
;
...
...
@@ -1092,7 +1092,7 @@ export class InternalEditorOptions {
this
.
wordSeparators
=
source
.
wordSeparators
;
this
.
autoClosingBrackets
=
source
.
autoClosingBrackets
;
this
.
autoClosingQuotes
=
source
.
autoClosingQuotes
;
this
.
auto
Wrapping
=
source
.
autoWrapping
;
this
.
auto
Surround
=
source
.
autoSurround
;
this
.
autoIndent
=
source
.
autoIndent
;
this
.
useTabStops
=
source
.
useTabStops
;
this
.
tabFocusMode
=
source
.
tabFocusMode
;
...
...
@@ -1122,7 +1122,7 @@ export class InternalEditorOptions {
&&
this
.
wordSeparators
===
other
.
wordSeparators
&&
this
.
autoClosingBrackets
===
other
.
autoClosingBrackets
&&
this
.
autoClosingQuotes
===
other
.
autoClosingQuotes
&&
this
.
auto
Wrapping
===
other
.
autoWrapping
&&
this
.
auto
Surround
===
other
.
autoSurround
&&
this
.
autoIndent
===
other
.
autoIndent
&&
this
.
useTabStops
===
other
.
useTabStops
&&
this
.
tabFocusMode
===
other
.
tabFocusMode
...
...
@@ -1153,7 +1153,7 @@ export class InternalEditorOptions {
wordSeparators
:
(
this
.
wordSeparators
!==
newOpts
.
wordSeparators
),
autoClosingBrackets
:
(
this
.
autoClosingBrackets
!==
newOpts
.
autoClosingBrackets
),
autoClosingQuotes
:
(
this
.
autoClosingQuotes
!==
newOpts
.
autoClosingQuotes
),
auto
Wrapping
:
(
this
.
autoWrapping
!==
newOpts
.
autoWrapping
),
auto
Surround
:
(
this
.
autoSurround
!==
newOpts
.
autoSurround
),
autoIndent
:
(
this
.
autoIndent
!==
newOpts
.
autoIndent
),
useTabStops
:
(
this
.
useTabStops
!==
newOpts
.
useTabStops
),
tabFocusMode
:
(
this
.
tabFocusMode
!==
newOpts
.
tabFocusMode
),
...
...
@@ -1536,7 +1536,7 @@ export interface IConfigurationChangedEvent {
readonly
wordSeparators
:
boolean
;
readonly
autoClosingBrackets
:
boolean
;
readonly
autoClosingQuotes
:
boolean
;
readonly
auto
Wrapping
:
boolean
;
readonly
auto
Surround
:
boolean
;
readonly
autoIndent
:
boolean
;
readonly
useTabStops
:
boolean
;
readonly
tabFocusMode
:
boolean
;
...
...
@@ -1717,16 +1717,16 @@ export class EditorOptionsValidator {
let
autoClosingBrackets
:
EditorAutoClosingStrategy
;
let
autoClosingQuotes
:
EditorAutoClosingStrategy
;
let
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
let
auto
Surround
:
EditorAutoSurround
Strategy
;
if
(
typeof
opts
.
autoClosingBrackets
===
'
boolean
'
&&
opts
.
autoClosingBrackets
===
false
)
{
// backwards compatibility: disable all on boolean false
autoClosingBrackets
=
'
never
'
;
autoClosingQuotes
=
'
never
'
;
auto
Wrapping
=
'
never
'
;
auto
Surround
=
'
never
'
;
}
else
{
autoClosingBrackets
=
_stringSet
<
EditorAutoClosingStrategy
>
(
opts
.
autoClosingBrackets
,
defaults
.
autoClosingBrackets
,
[
'
always
'
,
'
languageDefined
'
,
'
beforeWhitespace
'
,
'
never
'
]);
autoClosingQuotes
=
_stringSet
<
EditorAutoClosingStrategy
>
(
opts
.
autoClosingQuotes
,
defaults
.
autoClosingQuotes
,
[
'
always
'
,
'
languageDefined
'
,
'
beforeWhitespace
'
,
'
never
'
]);
auto
Wrapping
=
_stringSet
<
EditorAutoWrappingStrategy
>
(
opts
.
autoWrapping
,
defaults
.
autoWrapping
,
[
'
always
'
,
'
brackets
'
,
'
quotes
'
,
'
never
'
],
);
auto
Surround
=
_stringSet
<
EditorAutoSurroundStrategy
>
(
opts
.
autoSurround
,
defaults
.
autoSurround
,
[
'
always
'
,
'
brackets
'
,
'
quotes
'
,
'
never
'
],
);
}
return
{
...
...
@@ -1747,7 +1747,7 @@ export class EditorOptionsValidator {
wordWrapBreakObtrusiveCharacters
:
_string
(
opts
.
wordWrapBreakObtrusiveCharacters
,
defaults
.
wordWrapBreakObtrusiveCharacters
),
autoClosingBrackets
,
autoClosingQuotes
,
auto
Wrapping
,
auto
Surround
,
autoIndent
:
_boolean
(
opts
.
autoIndent
,
defaults
.
autoIndent
),
dragAndDrop
:
_boolean
(
opts
.
dragAndDrop
,
defaults
.
dragAndDrop
),
emptySelectionClipboard
:
_boolean
(
opts
.
emptySelectionClipboard
,
defaults
.
emptySelectionClipboard
),
...
...
@@ -2030,7 +2030,7 @@ export class InternalEditorOptionsFactory {
wordWrapBreakObtrusiveCharacters
:
opts
.
wordWrapBreakObtrusiveCharacters
,
autoClosingBrackets
:
opts
.
autoClosingBrackets
,
autoClosingQuotes
:
opts
.
autoClosingQuotes
,
auto
Wrapping
:
opts
.
autoWrapping
,
auto
Surround
:
opts
.
autoSurround
,
autoIndent
:
opts
.
autoIndent
,
dragAndDrop
:
opts
.
dragAndDrop
,
emptySelectionClipboard
:
opts
.
emptySelectionClipboard
,
...
...
@@ -2253,7 +2253,7 @@ export class InternalEditorOptionsFactory {
wordSeparators
:
opts
.
wordSeparators
,
autoClosingBrackets
:
opts
.
autoClosingBrackets
,
autoClosingQuotes
:
opts
.
autoClosingQuotes
,
auto
Wrapping
:
opts
.
autoWrapping
,
auto
Surround
:
opts
.
autoSurround
,
autoIndent
:
opts
.
autoIndent
,
useTabStops
:
opts
.
useTabStops
,
tabFocusMode
:
opts
.
readOnly
?
true
:
env
.
tabFocusMode
,
...
...
@@ -2488,7 +2488,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
wordWrapBreakObtrusiveCharacters
:
'
.
'
,
autoClosingBrackets
:
'
languageDefined
'
,
autoClosingQuotes
:
'
languageDefined
'
,
auto
Wrapping
:
'
always
'
,
auto
Surround
:
'
always
'
,
autoIndent
:
true
,
dragAndDrop
:
true
,
emptySelectionClipboard
:
true
,
...
...
src/vs/editor/common/controller/cursorCommon.ts
浏览文件 @
fea0ee3d
...
...
@@ -15,7 +15,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
LanguageIdentifier
}
from
'
vs/editor/common/modes
'
;
import
{
IAutoClosingPair
}
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
{
IConfigurationChangedEvent
,
EditorAutoClosingStrategy
,
EditorAuto
Wrapping
Strategy
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IConfigurationChangedEvent
,
EditorAutoClosingStrategy
,
EditorAuto
Surround
Strategy
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IViewModel
}
from
'
vs/editor/common/viewModel/viewModel
'
;
import
{
CursorChangeReason
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
VerticalRevealType
}
from
'
vs/editor/common/view/viewEvents
'
;
...
...
@@ -85,7 +85,7 @@ export class CursorConfiguration {
public
readonly
multiCursorMergeOverlapping
:
boolean
;
public
readonly
autoClosingBrackets
:
EditorAutoClosingStrategy
;
public
readonly
autoClosingQuotes
:
EditorAutoClosingStrategy
;
public
readonly
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
public
readonly
auto
Surround
:
EditorAutoSurround
Strategy
;
public
readonly
autoIndent
:
boolean
;
public
readonly
autoClosingPairsOpen
:
CharacterMap
;
public
readonly
autoClosingPairsClose
:
CharacterMap
;
...
...
@@ -103,7 +103,7 @@ export class CursorConfiguration {
||
e
.
multiCursorMergeOverlapping
||
e
.
autoClosingBrackets
||
e
.
autoClosingQuotes
||
e
.
auto
Wrapping
||
e
.
auto
Surround
||
e
.
useTabStops
||
e
.
lineHeight
||
e
.
readOnly
...
...
@@ -132,7 +132,7 @@ export class CursorConfiguration {
this
.
multiCursorMergeOverlapping
=
c
.
multiCursorMergeOverlapping
;
this
.
autoClosingBrackets
=
c
.
autoClosingBrackets
;
this
.
autoClosingQuotes
=
c
.
autoClosingQuotes
;
this
.
auto
Wrapping
=
c
.
autoWrapping
;
this
.
auto
Surround
=
c
.
autoSurround
;
this
.
autoIndent
=
c
.
autoIndent
;
this
.
autoClosingPairsOpen
=
{};
...
...
src/vs/editor/common/controller/cursorTypeOperations.ts
浏览文件 @
fea0ee3d
...
...
@@ -589,10 +589,10 @@ export class TypeOperations {
private
static
_shouldSurroundChar
(
config
:
CursorConfiguration
,
ch
:
string
):
boolean
{
if
(
isQuote
(
ch
))
{
return
(
config
.
auto
Wrapping
===
'
quotes
'
||
config
.
autoWrapping
===
'
always
'
);
return
(
config
.
auto
Surround
===
'
quotes
'
||
config
.
autoSurround
===
'
always
'
);
}
else
{
// Character is a bracket
return
(
config
.
auto
Wrapping
===
'
brackets
'
||
config
.
autoWrapping
===
'
always
'
);
return
(
config
.
auto
Surround
===
'
brackets
'
||
config
.
autoSurround
===
'
always
'
);
}
}
...
...
src/vs/editor/test/browser/controller/cursor.test.ts
浏览文件 @
fea0ee3d
...
...
@@ -4277,7 +4277,7 @@ suite('autoClosingPairs', () => {
],
languageIdentifier
:
mode
.
getLanguageIdentifier
(),
editorOpts
:
{
auto
Wrapping
:
'
never
'
auto
Surround
:
'
never
'
}
},
(
model
,
cursor
)
=>
{
...
...
@@ -4297,7 +4297,7 @@ suite('autoClosingPairs', () => {
],
languageIdentifier
:
mode
.
getLanguageIdentifier
(),
editorOpts
:
{
auto
Wrapping
:
'
quotes
'
auto
Surround
:
'
quotes
'
}
},
(
model
,
cursor
)
=>
{
...
...
@@ -4320,7 +4320,7 @@ suite('autoClosingPairs', () => {
],
languageIdentifier
:
mode
.
getLanguageIdentifier
(),
editorOpts
:
{
auto
Wrapping
:
'
brackets
'
auto
Surround
:
'
brackets
'
}
},
(
model
,
cursor
)
=>
{
...
...
src/vs/monaco.d.ts
浏览文件 @
fea0ee3d
...
...
@@ -2485,7 +2485,7 @@ declare namespace monaco.editor {
/**
* Configuration options for auto wrapping quotes and brackets
*/
export
type
EditorAuto
Wrapping
Strategy
=
'
always
'
|
'
quotes
'
|
'
brackets
'
|
'
never
'
;
export
type
EditorAuto
Surround
Strategy
=
'
always
'
|
'
quotes
'
|
'
brackets
'
|
'
never
'
;
/**
* Configuration options for editor minimap
...
...
@@ -2870,10 +2870,10 @@ declare namespace monaco.editor {
*/
autoClosingQuotes
?:
EditorAutoClosingStrategy
;
/**
* Options for auto
wrapp
ing.
* Defaults to always allowing auto
wrapp
ing.
* Options for auto
surround
ing.
* Defaults to always allowing auto
surround
ing.
*/
auto
Wrapping
?:
EditorAutoWrapping
Strategy
;
auto
Surround
?:
EditorAutoSurround
Strategy
;
/**
* Enable auto indentation adjustment.
* Defaults to false.
...
...
@@ -3309,7 +3309,7 @@ declare namespace monaco.editor {
readonly
wordSeparators
:
string
;
readonly
autoClosingBrackets
:
EditorAutoClosingStrategy
;
readonly
autoClosingQuotes
:
EditorAutoClosingStrategy
;
readonly
auto
Wrapping
:
EditorAutoWrapping
Strategy
;
readonly
auto
Surround
:
EditorAutoSurround
Strategy
;
readonly
autoIndent
:
boolean
;
readonly
useTabStops
:
boolean
;
readonly
tabFocusMode
:
boolean
;
...
...
@@ -3449,7 +3449,7 @@ declare namespace monaco.editor {
readonly
wordSeparators
:
boolean
;
readonly
autoClosingBrackets
:
boolean
;
readonly
autoClosingQuotes
:
boolean
;
readonly
auto
Wrapping
:
boolean
;
readonly
auto
Surround
:
boolean
;
readonly
autoIndent
:
boolean
;
readonly
useTabStops
:
boolean
;
readonly
tabFocusMode
:
boolean
;
...
...
src/vs/platform/telemetry/common/telemetryUtils.ts
浏览文件 @
fea0ee3d
...
...
@@ -117,7 +117,7 @@ const configurationValueWhitelist = [
'
editor.parameterHints.cycle
'
,
'
editor.autoClosingBrackets
'
,
'
editor.autoClosingQuotes
'
,
'
editor.auto
Wrapping
'
,
'
editor.auto
Surround
'
,
'
editor.autoIndent
'
,
'
editor.formatOnType
'
,
'
editor.formatOnPaste
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录