Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
27568c03
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,发现更多精彩内容 >>
提交
27568c03
编写于
8月 18, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extract SnippetController to its own file
上级
cfe6a58d
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
621 addition
and
619 deletion
+621
-619
src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts
...itor/contrib/defineKeybinding/browser/defineKeybinding.ts
+3
-2
src/vs/editor/contrib/snippet/common/snippet.ts
src/vs/editor/contrib/snippet/common/snippet.ts
+0
-609
src/vs/editor/contrib/snippet/common/snippetController.ts
src/vs/editor/contrib/snippet/common/snippetController.ts
+606
-0
src/vs/editor/contrib/suggest/browser/suggestController.ts
src/vs/editor/contrib/suggest/browser/suggestController.ts
+3
-2
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
+4
-3
src/vs/editor/contrib/suggest/electron-browser/snippetCompletion.ts
...tor/contrib/suggest/electron-browser/snippetCompletion.ts
+3
-2
src/vs/workbench/parts/emmet/node/editorAccessor.ts
src/vs/workbench/parts/emmet/node/editorAccessor.ts
+2
-1
未找到文件。
src/vs/editor/contrib/defineKeybinding/browser/defineKeybinding.ts
浏览文件 @
27568c03
...
...
@@ -23,7 +23,8 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
import
{
editorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
,
IOverlayWidget
,
IOverlayWidgetPosition
,
OverlayWidgetPositionPreference
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
CodeSnippet
,
getSnippetController
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
{
SmartSnippetInserter
}
from
'
vs/editor/contrib/defineKeybinding/common/smartSnippetInserter
'
;
import
EditorContextKeys
=
editorCommon
.
EditorContextKeys
;
...
...
@@ -116,7 +117,7 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut
snippetText
=
smartInsertInfo
.
prepend
+
snippetText
+
smartInsertInfo
.
append
;
this
.
_editor
.
setPosition
(
smartInsertInfo
.
position
);
getSnippetController
(
this
.
_editor
).
run
(
new
CodeSnippet
(
snippetText
),
0
,
0
);
SnippetController
.
get
(
this
.
_editor
).
run
(
new
CodeSnippet
(
snippetText
),
0
,
0
);
}
private
_onModel
():
void
{
...
...
src/vs/editor/contrib/snippet/common/snippet.ts
浏览文件 @
27568c03
此差异已折叠。
点击以展开。
src/vs/editor/contrib/snippet/common/snippetController.ts
0 → 100644
浏览文件 @
27568c03
此差异已折叠。
点击以展开。
src/vs/editor/contrib/suggest/browser/suggestController.ts
浏览文件 @
27568c03
...
...
@@ -15,7 +15,8 @@ import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEdit
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
EditOperation
}
from
'
vs/editor/common/core/editOperation
'
;
import
{
getSnippetController
,
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
{
Context
as
SuggestContext
}
from
'
vs/editor/contrib/suggest/common/suggest
'
;
import
{
SuggestModel
}
from
'
../common/suggestModel
'
;
import
{
CompletionItem
}
from
'
../common/completionModel
'
;
...
...
@@ -83,7 +84,7 @@ export class SuggestController implements IEditorContribution {
this
.
editor
.
pushUndoStop
();
}
getSnippetController
(
this
.
editor
).
run
(
SnippetController
.
get
(
this
.
editor
).
run
(
new
CodeSnippet
(
insertText
),
overwriteBefore
+
columnDelta
,
overwriteAfter
,
...
...
src/vs/editor/contrib/suggest/browser/tabCompletion.ts
浏览文件 @
27568c03
...
...
@@ -13,7 +13,8 @@ import {Registry} from 'vs/platform/platform';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
CommonEditorRegistry
,
EditorCommand
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CodeSnippet
,
ISnippetController
,
getSnippetController
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
EditorContextKeys
=
editorCommon
.
EditorContextKeys
;
...
...
@@ -28,7 +29,7 @@ class TabCompletionController implements editorCommon.IEditorContribution {
return
editor
.
getContribution
<
TabCompletionController
>
(
TabCompletionController
.
ID
);
}
private
_snippetController
:
I
SnippetController
;
private
_snippetController
:
SnippetController
;
private
_cursorChangeSubscription
:
IDisposable
;
private
_currentSnippets
:
ISnippet
[]
=
[];
...
...
@@ -36,7 +37,7 @@ class TabCompletionController implements editorCommon.IEditorContribution {
editor
:
editorCommon
.
ICommonCodeEditor
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
this
.
_snippetController
=
getSnippetController
(
editor
);
this
.
_snippetController
=
SnippetController
.
get
(
editor
);
const
hasSnippets
=
TabCompletionController
.
ContextKey
.
bindTo
(
contextKeyService
);
this
.
_cursorChangeSubscription
=
editor
.
onDidChangeCursorSelection
(
e
=>
{
...
...
src/vs/editor/contrib/suggest/electron-browser/snippetCompletion.ts
浏览文件 @
27568c03
...
...
@@ -9,7 +9,8 @@ import {Registry} from 'vs/platform/platform';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICommonCodeEditor
,
EditorContextKeys
}
from
'
vs/editor/common/editorCommon
'
;
import
{
editorAction
,
ServicesAccessor
,
EditorAction
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
getSnippetController
,
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
CodeSnippet
}
from
'
vs/editor/contrib/snippet/common/snippet
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
ISnippetsRegistry
,
Extensions
,
ISnippet
}
from
'
vs/editor/common/modes/snippetsRegistry
'
;
...
...
@@ -48,7 +49,7 @@ class ShowSnippetsActions extends EditorAction {
return
quickOpenService
.
pick
(
picks
).
then
(
pick
=>
{
if
(
pick
)
{
getSnippetController
(
editor
).
run
(
new
CodeSnippet
(
pick
.
snippet
.
codeSnippet
),
0
,
0
);
SnippetController
.
get
(
editor
).
run
(
new
CodeSnippet
(
pick
.
snippet
.
codeSnippet
),
0
,
0
);
}
});
}
...
...
src/vs/workbench/parts/emmet/node/editorAccessor.ts
浏览文件 @
27568c03
...
...
@@ -9,6 +9,7 @@ import {IPosition, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
snippets
=
require
(
'
vs/editor/contrib/snippet/common/snippet
'
);
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
emmet
=
require
(
'
emmet
'
);
...
...
@@ -88,7 +89,7 @@ export class EditorAccessor implements emmet.Editor {
let
range
=
new
Range
(
startPosition
.
lineNumber
,
startPosition
.
column
,
endPosition
.
lineNumber
,
endPosition
.
column
);
let
snippet
=
snippets
.
CodeSnippet
.
convertExternalSnippet
(
value
,
snippets
.
ExternalSnippetType
.
EmmetSnippet
);
let
codeSnippet
=
new
snippets
.
CodeSnippet
(
snippet
);
snippets
.
getSnippetController
(
this
.
editor
).
runWithReplaceRange
(
codeSnippet
,
range
,
false
);
SnippetController
.
get
(
this
.
editor
).
runWithReplaceRange
(
codeSnippet
,
range
,
false
);
}
public
onAfterEmmetAction
():
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录