Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ae1c3b0e
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,发现更多精彩内容 >>
未验证
提交
ae1c3b0e
编写于
1月 29, 2018
作者:
A
Alexandru Dima
提交者:
GitHub
1月 29, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #42259 from svitlana-galianova/fixing41613
Fix #41613
上级
426f0b83
15f994af
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
145 deletion
+1
-145
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
+1
-2
src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts
...ch/parts/codeEditor/electron-browser/wordWrapMigration.ts
+0
-143
未找到文件。
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
浏览文件 @
ae1c3b0e
...
...
@@ -12,5 +12,4 @@ import './electron-browser/toggleMinimap';
import
'
./electron-browser/toggleMultiCursorModifier
'
;
import
'
./electron-browser/toggleRenderControlCharacter
'
;
import
'
./electron-browser/toggleRenderWhitespace
'
;
import
'
./electron-browser/toggleWordWrap
'
;
import
'
./electron-browser/wordWrapMigration
'
;
import
'
./electron-browser/toggleWordWrap
'
;
\ No newline at end of file
src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts
已删除
100644 → 0
浏览文件 @
426f0b83
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
registerEditorContribution
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
Severity
from
'
vs/base/common/severity
'
;
interface
IStorageData
{
dontShowPrompt
:
boolean
;
}
class
WordWrapMigrationStorage
{
private
static
readonly
KEY
=
'
wordWrapMigration
'
;
private
_storageService
:
IStorageService
;
private
_value
:
IStorageData
;
constructor
(
storageService
:
IStorageService
)
{
this
.
_storageService
=
storageService
;
this
.
_value
=
this
.
_read
();
}
private
_read
():
IStorageData
{
let
jsonValue
=
this
.
_storageService
.
get
(
WordWrapMigrationStorage
.
KEY
,
StorageScope
.
GLOBAL
);
if
(
!
jsonValue
)
{
return
null
;
}
try
{
return
JSON
.
parse
(
jsonValue
);
}
catch
(
err
)
{
return
null
;
}
}
public
get
():
IStorageData
{
return
this
.
_value
;
}
public
set
(
data
:
IStorageData
):
void
{
this
.
_value
=
data
;
this
.
_storageService
.
store
(
WordWrapMigrationStorage
.
KEY
,
JSON
.
stringify
(
this
.
_value
),
StorageScope
.
GLOBAL
);
}
}
class
WordWrapMigrationController
extends
Disposable
implements
IEditorContribution
{
private
static
readonly
ID
=
'
editor.contrib.wordWrapMigrationController
'
;
private
static
_checked
=
false
;
constructor
(
editor
:
ICodeEditor
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IMessageService
private
messageService
:
IMessageService
,
@
IStorageService
private
storageService
:
IStorageService
,
@
IPreferencesService
private
preferencesService
:
IPreferencesService
)
{
super
();
this
.
_promptIfNecessary
();
}
public
getId
():
string
{
return
WordWrapMigrationController
.
ID
;
}
private
_promptIfNecessary
():
void
{
if
(
WordWrapMigrationController
.
_checked
)
{
// Already checked
return
;
}
WordWrapMigrationController
.
_checked
=
true
;
let
result
=
this
.
configurationService
.
inspect
(
'
editor.wrappingColumn
'
);
if
(
typeof
result
.
value
===
'
undefined
'
)
{
// Setting is not used
return
;
}
const
storage
=
new
WordWrapMigrationStorage
(
this
.
storageService
);
const
storedData
=
storage
.
get
();
if
(
storedData
&&
storedData
.
dontShowPrompt
)
{
// Do not prompt stored
return
;
}
let
isUserSetting
=
(
typeof
result
.
user
!==
'
undefined
'
);
this
.
_prompt
(
storage
,
isUserSetting
);
}
private
_prompt
(
storage
:
WordWrapMigrationStorage
,
userSettings
:
boolean
):
void
{
const
okAction
=
new
Action
(
'
wordWrapMigration.ok
'
,
nls
.
localize
(
'
wordWrapMigration.ok
'
,
"
OK
"
),
null
,
true
,
()
=>
TPromise
.
as
(
true
)
);
const
dontShowAgainAction
=
new
Action
(
'
wordWrapMigration.dontShowAgain
'
,
nls
.
localize
(
'
wordWrapMigration.dontShowAgain
'
,
"
Don't Show Again
"
),
null
,
true
,
()
=>
{
storage
.
set
({
dontShowPrompt
:
true
});
return
TPromise
.
as
(
true
);
}
);
const
openSettings
=
new
Action
(
'
wordWrapMigration.openSettings
'
,
nls
.
localize
(
'
wordWrapMigration.openSettings
'
,
"
Open Settings
"
),
null
,
true
,
()
=>
{
if
(
userSettings
)
{
this
.
preferencesService
.
openGlobalSettings
();
}
else
{
this
.
preferencesService
.
openWorkspaceSettings
();
}
return
TPromise
.
as
(
true
);
}
);
this
.
messageService
.
show
(
Severity
.
Info
,
{
message
:
nls
.
localize
(
'
wordWrapMigration.prompt
'
,
"
The setting `editor.wrappingColumn` has been deprecated in favor of `editor.wordWrap`.
"
),
actions
:
[
okAction
,
openSettings
,
dontShowAgainAction
]
});
}
}
registerEditorContribution
(
WordWrapMigrationController
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录