Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
58aa1114
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,发现更多精彩内容 >>
未验证
提交
58aa1114
编写于
2月 21, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove TextModel.createFromString
上级
147f417a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
29 deletion
+17
-29
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+0
-24
src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts
src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts
+4
-2
src/vs/editor/test/common/editorTestUtils.ts
src/vs/editor/test/common/editorTestUtils.ts
+7
-1
src/vs/workbench/contrib/bulkEdit/browser/bulkEditTree.ts
src/vs/workbench/contrib/bulkEdit/browser/bulkEditTree.ts
+6
-2
未找到文件。
src/vs/editor/common/model/textModel.ts
浏览文件 @
58aa1114
...
...
@@ -37,9 +37,6 @@ import { Color } from 'vs/base/common/color';
import
{
Constants
}
from
'
vs/base/common/uint
'
;
import
{
EditorTheme
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
import
{
UndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedoService
'
;
import
{
IDialogService
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
NoOpNotification
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
function
createTextBufferBuilder
()
{
return
new
PieceTreeTextBufferBuilder
();
...
...
@@ -191,27 +188,6 @@ export class TextModel extends Disposable implements model.ITextModel {
largeFileOptimizations
:
EDITOR_MODEL_DEFAULTS
.
largeFileOptimizations
,
};
public
static
createFromString
(
text
:
string
,
options
:
model
.
ITextModelCreationOptions
=
TextModel
.
DEFAULT_CREATION_OPTIONS
,
languageIdentifier
:
LanguageIdentifier
|
null
=
null
,
uri
:
URI
|
null
=
null
):
TextModel
{
const
dialogService
=
new
class
implements
IDialogService
{
_serviceBrand
:
undefined
;
confirm
()
{
return
Promise
.
resolve
({
confirmed
:
false
});
}
show
()
{
return
Promise
.
resolve
({
choice
:
0
});
}
about
()
{
return
Promise
.
resolve
();
}
};
const
noop
=
new
NoOpNotification
();
const
notificationService
=
new
class
implements
INotificationService
{
_serviceBrand
:
undefined
;
info
()
{
return
noop
;
}
warn
()
{
return
noop
;
}
error
()
{
return
noop
;
}
notify
()
{
return
noop
;
}
prompt
()
{
return
noop
;
}
status
()
{
return
Disposable
.
None
;
}
setFilter
()
{
}
};
return
new
TextModel
(
text
,
options
,
languageIdentifier
,
uri
,
new
UndoRedoService
(
dialogService
,
notificationService
));
}
public
static
resolveOptions
(
textBuffer
:
model
.
ITextBuffer
,
options
:
model
.
ITextModelCreationOptions
):
model
.
TextModelResolvedOptions
{
if
(
options
.
detectIndentation
)
{
const
guessedIndentation
=
guessIndentation
(
textBuffer
,
options
.
tabSize
,
options
.
insertSpaces
);
...
...
src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts
浏览文件 @
58aa1114
...
...
@@ -33,6 +33,7 @@ import * as peekView from 'vs/editor/contrib/peekView/peekView';
import
{
FileReferences
,
OneReference
,
ReferencesModel
}
from
'
../referencesModel
'
;
import
{
FuzzyScore
}
from
'
vs/base/common/filters
'
;
import
{
SplitView
,
Sizing
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
class
DecorationsManager
implements
IDisposable
{
...
...
@@ -215,7 +216,8 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
peekView
.
IPeekViewService
private
readonly
_peekViewService
:
peekView
.
IPeekViewService
,
@
ILabelService
private
readonly
_uriLabel
:
ILabelService
@
ILabelService
private
readonly
_uriLabel
:
ILabelService
,
@
IUndoRedoService
private
readonly
_undoRedoService
:
IUndoRedoService
,
)
{
super
(
editor
,
{
showFrame
:
false
,
showArrow
:
true
,
isResizeable
:
true
,
isAccessible
:
true
});
...
...
@@ -304,7 +306,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
};
this
.
_preview
=
this
.
_instantiationService
.
createInstance
(
EmbeddedCodeEditorWidget
,
this
.
_previewContainer
,
options
,
this
.
editor
);
dom
.
hide
(
this
.
_previewContainer
);
this
.
_previewNotAvailableMessage
=
TextModel
.
createFromString
(
nls
.
localize
(
'
missingPreviewMessage
'
,
"
no preview available
"
)
);
this
.
_previewNotAvailableMessage
=
new
TextModel
(
nls
.
localize
(
'
missingPreviewMessage
'
,
"
no preview available
"
),
TextModel
.
DEFAULT_CREATION_OPTIONS
,
null
,
null
,
this
.
_undoRedoService
);
// tree
this
.
_treeContainer
=
dom
.
append
(
containerElement
,
dom
.
$
(
'
div.ref-tree.inline
'
));
...
...
src/vs/editor/test/common/editorTestUtils.ts
浏览文件 @
58aa1114
...
...
@@ -7,6 +7,9 @@ import { URI } from 'vs/base/common/uri';
import
{
DefaultEndOfLine
,
ITextModelCreationOptions
}
from
'
vs/editor/common/model
'
;
import
{
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
import
{
LanguageIdentifier
}
from
'
vs/editor/common/modes
'
;
import
{
TestDialogService
}
from
'
vs/platform/dialogs/test/common/testDialogService
'
;
import
{
TestNotificationService
}
from
'
vs/platform/notification/test/common/testNotificationService
'
;
import
{
UndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedoService
'
;
export
function
withEditorModel
(
text
:
string
[],
callback
:
(
model
:
TextModel
)
=>
void
):
void
{
let
model
=
createTextModel
(
text
.
join
(
'
\n
'
));
...
...
@@ -36,5 +39,8 @@ export function createTextModel(text: string, _options: IRelaxedTextModelCreatio
isForSimpleWidget
:
(
typeof
_options
.
isForSimpleWidget
===
'
undefined
'
?
TextModel
.
DEFAULT_CREATION_OPTIONS
.
isForSimpleWidget
:
_options
.
isForSimpleWidget
),
largeFileOptimizations
:
(
typeof
_options
.
largeFileOptimizations
===
'
undefined
'
?
TextModel
.
DEFAULT_CREATION_OPTIONS
.
largeFileOptimizations
:
_options
.
largeFileOptimizations
),
};
return
TextModel
.
createFromString
(
text
,
options
,
languageIdentifier
,
uri
);
const
dialogService
=
new
TestDialogService
();
const
notificationService
=
new
TestNotificationService
();
const
undoRedoService
=
new
UndoRedoService
(
dialogService
,
notificationService
);
return
new
TextModel
(
text
,
options
,
languageIdentifier
,
uri
,
undoRedoService
);
}
src/vs/workbench/contrib/bulkEdit/browser/bulkEditTree.ts
浏览文件 @
58aa1114
...
...
@@ -26,6 +26,7 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService';
import
{
WorkspaceFileEdit
}
from
'
vs/editor/common/modes
'
;
import
{
compare
}
from
'
vs/base/common/strings
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
// --- VIEW MODEL
...
...
@@ -174,7 +175,10 @@ export class BulkEditDataSource implements IAsyncDataSource<BulkFileOperations,
public
groupByFile
:
boolean
=
true
;
constructor
(@
ITextModelService
private
readonly
_textModelService
:
ITextModelService
)
{
}
constructor
(
@
ITextModelService
private
readonly
_textModelService
:
ITextModelService
,
@
IUndoRedoService
private
readonly
_undoRedoService
:
IUndoRedoService
,
)
{
}
hasChildren
(
element
:
BulkFileOperations
|
BulkEditElement
):
boolean
{
if
(
element
instanceof
FileElement
)
{
...
...
@@ -210,7 +214,7 @@ export class BulkEditDataSource implements IAsyncDataSource<BulkFileOperations,
textModel
=
ref
.
object
.
textEditorModel
;
textModelDisposable
=
ref
;
}
catch
{
textModel
=
TextModel
.
createFromString
(
''
);
textModel
=
new
TextModel
(
''
,
TextModel
.
DEFAULT_CREATION_OPTIONS
,
null
,
null
,
this
.
_undoRedoService
);
textModelDisposable
=
textModel
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录