Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
bf6db831
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf6db831
编写于
12月 10, 2015
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
unused imports and other tslint findings
上级
67fa01ef
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
60 deletion
+26
-60
src/vs/editor/contrib/format/common/format.ts
src/vs/editor/contrib/format/common/format.ts
+1
-2
src/vs/workbench/api/common/extHostApiCommands.ts
src/vs/workbench/api/common/extHostApiCommands.ts
+7
-24
src/vs/workbench/api/common/extHostLanguageFeatures.ts
src/vs/workbench/api/common/extHostLanguageFeatures.ts
+16
-22
src/vs/workbench/api/common/extHostLanguages.ts
src/vs/workbench/api/common/extHostLanguages.ts
+1
-11
src/vs/workbench/api/common/extHostOutputService.ts
src/vs/workbench/api/common/extHostOutputService.ts
+1
-1
未找到文件。
src/vs/editor/contrib/format/common/format.ts
浏览文件 @
bf6db831
...
...
@@ -7,9 +7,8 @@
import
{
IFormattingSupport
,
IFormattingOptions
}
from
'
vs/editor/common/modes
'
;
import
LanguageFeatureRegistry
from
'
vs/editor/common/modes/languageFeatureRegistry
'
;
import
{
onUnexpectedError
,
illegalArgument
}
from
'
vs/base/common/errors
'
;
import
{
illegalArgument
}
from
'
vs/base/common/errors
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IModel
,
IRange
,
IPosition
,
ISingleEditOperation
}
from
'
vs/editor/common/editorCommon
'
;
...
...
src/vs/workbench/api/common/extHostApiCommands.ts
浏览文件 @
bf6db831
...
...
@@ -5,36 +5,18 @@
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
DefaultFilter
}
from
'
vs/editor/common/modes/modesFilters
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
sequence
}
from
'
vs/base/common/async
'
;
import
{
Range
as
EditorRange
}
from
'
vs/editor/common/core/range
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
typeConverters
from
'
vs/workbench/api/common/pluginHostTypeConverters
'
;
import
*
as
types
from
'
vs/workbench/api/common/pluginHostTypes
'
;
import
{
I
Position
,
IRange
,
I
SingleEditOperation
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ISingleEditOperation
}
from
'
vs/editor/common/editorCommon
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
ICommandHandlerDescription
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
PluginHostModelService
}
from
'
vs/workbench/api/common/pluginHostDocuments
'
;
import
{
IMarkerService
,
IMarker
}
from
'
vs/platform/markers/common/markers
'
;
import
{
PluginHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/pluginHostCommands
'
;
import
{
DeclarationRegistry
}
from
'
vs/editor/contrib/goToDeclaration/common/goToDeclaration
'
;
import
{
ExtraInfoRegistry
}
from
'
vs/editor/contrib/hover/common/hover
'
;
import
{
OccurrencesRegistry
}
from
'
vs/editor/contrib/wordHighlighter/common/wordHighlighter
'
;
import
{
ReferenceRegistry
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
IQuickFix2
,
QuickFixRegistry
,
getQuickFixes
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
PluginHostCommands
}
from
'
vs/workbench/api/common/pluginHostCommands
'
;
import
{
IQuickFix2
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
LanguageFeatureRegistry
from
'
vs/editor/common/modes/languageFeatureRegistry
'
;
import
{
NavigateTypesSupportRegistry
,
INavigateTypesSupport
,
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
import
{
RenameRegistry
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
FormatRegistry
,
FormatOnTypeRegistry
}
from
'
vs/editor/contrib/format/common/format
'
;
import
{
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
import
{
ICodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
export
class
ExtHostApiCommands
{
...
...
@@ -313,7 +295,8 @@ export class ExtHostApiCommands {
return
this
.
_commands
.
executeCommand
<
ICodeLensData
[]
>
(
'
_executeCodeLensProvider
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
item
=>
{
return
new
types
.
CodeLens
(
typeConverters
.
toRange
(
item
.
symbol
.
range
),
return
new
types
.
CodeLens
(
typeConverters
.
toRange
(
item
.
symbol
.
range
),
typeConverters
.
Command
.
to
(
item
.
symbol
.
command
));
});
}
...
...
@@ -358,4 +341,4 @@ export class ExtHostApiCommands {
}
});
}
}
\ No newline at end of file
}
src/vs/workbench/api/common/extHostLanguageFeatures.ts
浏览文件 @
bf6db831
...
...
@@ -5,32 +5,26 @@
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
DefaultFilter
}
from
'
vs/editor/common/modes/modesFilters
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
sequence
}
from
'
vs/base/common/async
'
;
import
{
Range
as
EditorRange
}
from
'
vs/editor/common/core/range
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Range
as
EditorRange
}
from
'
vs/editor/common/core/range
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
TypeConverters
from
'
vs/workbench/api/common/pluginHostTypeConverters
'
;
import
{
Position
,
Range
,
SymbolKind
,
DocumentHighlightKind
,
Disposable
,
Diagnostic
,
DiagnosticSeverity
,
Location
,
SignatureHelp
,
CompletionItemKind
}
from
'
vs/workbench/api/common/pluginHostTypes
'
;
import
{
Range
,
DocumentHighlightKind
,
Disposable
,
Diagnostic
,
SignatureHelp
}
from
'
vs/workbench/api/common/pluginHostTypes
'
;
import
{
IPosition
,
IRange
,
ISingleEditOperation
}
from
'
vs/editor/common/editorCommon
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
PluginHostModelService
}
from
'
vs/workbench/api/common/pluginHostDocuments
'
;
import
{
IMarkerService
,
IMarker
}
from
'
vs/platform/markers/common/markers
'
;
import
{
PluginHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/pluginHostCommands
'
;
import
{
PluginHostCommands
}
from
'
vs/workbench/api/common/pluginHostCommands
'
;
import
{
DeclarationRegistry
}
from
'
vs/editor/contrib/goToDeclaration/common/goToDeclaration
'
;
import
{
ExtraInfoRegistry
}
from
'
vs/editor/contrib/hover/common/hover
'
;
import
{
OccurrencesRegistry
}
from
'
vs/editor/contrib/wordHighlighter/common/wordHighlighter
'
;
import
{
ReferenceRegistry
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
QuickFixRegistry
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
OutlineRegistry
,
IOutlineEntry
,
IOutlineSupport
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
LanguageFeatureRegistry
from
'
vs/editor/common/modes/languageFeatureRegistry
'
;
import
{
NavigateTypesSupportRegistry
,
INavigateTypesSupport
,
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
import
{
RenameRegistry
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
FormatRegistry
,
FormatOnTypeRegistry
}
from
'
vs/editor/contrib/format/common/format
'
;
...
...
@@ -256,7 +250,7 @@ class ReferenceAdapter implements modes.IReferenceSupport {
this
.
_provider
=
provider
;
}
canFindReferences
():
boolean
{
canFindReferences
():
boolean
{
return
true
}
...
...
@@ -376,7 +370,7 @@ class OnTypeFormattingAdapter implements modes.IFormattingSupport {
this
.
_provider
=
provider
;
}
autoFormatTriggerCharacters
=
[];
// not here
autoFormatTriggerCharacters
:
string
[]
=
[];
// not here
formatAfterKeystroke
(
resource
:
URI
,
position
:
IPosition
,
ch
:
string
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
...
...
@@ -548,7 +542,7 @@ class SuggestAdapter implements modes.ISuggestSupport {
});
}
getFilter
():
any
{
getFilter
():
any
{
throw
new
Error
(
'
illegal state
'
);
}
getTriggerCharacters
():
string
[]
{
...
...
@@ -601,7 +595,7 @@ type Adapter = OutlineAdapter | CodeLensAdapter | DeclarationAdapter | ExtraInfo
@
Remotable
.
PluginHostContext
(
'
ExtHostLanguageFeatures
'
)
export
class
ExtHostLanguageFeatures
{
private
static
_handlePool
=
0
;
private
static
_handlePool
:
number
=
0
;
private
_proxy
:
MainThreadLanguageFeatures
;
private
_documents
:
PluginHostModelService
;
...
...
@@ -642,7 +636,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$getOutline
(
handle
:
number
,
resource
:
URI
):
TPromise
<
IOutlineEntry
[]
>
{
$getOutline
(
handle
:
number
,
resource
:
URI
):
TPromise
<
IOutlineEntry
[]
>
{
return
this
.
_withAdapter
(
handle
,
OutlineAdapter
,
adapter
=>
adapter
.
getOutline
(
resource
));
}
...
...
@@ -659,7 +653,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_withAdapter
(
handle
,
CodeLensAdapter
,
adapter
=>
adapter
.
findCodeLensSymbols
(
resource
));
}
$resolveCodeLensSymbol
(
handle
:
number
,
resource
:
URI
,
symbol
:
modes
.
ICodeLensSymbol
):
TPromise
<
modes
.
ICodeLensSymbol
>
{
$resolveCodeLensSymbol
(
handle
:
number
,
resource
:
URI
,
symbol
:
modes
.
ICodeLensSymbol
):
TPromise
<
modes
.
ICodeLensSymbol
>
{
return
this
.
_withAdapter
(
handle
,
CodeLensAdapter
,
adapter
=>
adapter
.
resolveCodeLensSymbol
(
resource
,
symbol
));
}
...
...
@@ -685,7 +679,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$computeInfo
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IComputeExtraInfoResult
>
{
$computeInfo
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IComputeExtraInfoResult
>
{
return
this
.
_withAdapter
(
handle
,
ExtraInfoAdapter
,
adpater
=>
adpater
.
computeInfo
(
resource
,
position
));
}
...
...
@@ -698,7 +692,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$findOccurrences
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IOccurence
[]
>
{
$findOccurrences
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IOccurence
[]
>
{
return
this
.
_withAdapter
(
handle
,
OccurrencesAdapter
,
adapter
=>
adapter
.
findOccurrences
(
resource
,
position
));
}
...
...
@@ -724,7 +718,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$getQuickFixes
(
handle
:
number
,
resource
:
URI
,
range
:
IRange
,
marker
:
IMarker
[]):
TPromise
<
modes
.
IQuickFix
[]
>
{
$getQuickFixes
(
handle
:
number
,
resource
:
URI
,
range
:
IRange
,
marker
:
IMarker
[]):
TPromise
<
modes
.
IQuickFix
[]
>
{
return
this
.
_withAdapter
(
handle
,
QuickFixAdapter
,
adapter
=>
adapter
.
getQuickFixes
(
resource
,
range
,
marker
));
}
...
...
@@ -741,7 +735,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$formatDocument
(
handle
:
number
,
resource
:
URI
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
$formatDocument
(
handle
:
number
,
resource
:
URI
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
return
this
.
_withAdapter
(
handle
,
DocumentFormattingAdapter
,
adapter
=>
adapter
.
formatDocument
(
resource
,
options
));
}
...
...
@@ -752,7 +746,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$formatRange
(
handle
:
number
,
resource
:
URI
,
range
:
IRange
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
$formatRange
(
handle
:
number
,
resource
:
URI
,
range
:
IRange
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
return
this
.
_withAdapter
(
handle
,
RangeFormattingAdapter
,
adapter
=>
adapter
.
formatRange
(
resource
,
range
,
options
));
}
...
...
@@ -763,7 +757,7 @@ export class ExtHostLanguageFeatures {
return
this
.
_createDisposable
(
handle
);
}
$formatAfterKeystroke
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
,
ch
:
string
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
$formatAfterKeystroke
(
handle
:
number
,
resource
:
URI
,
position
:
IPosition
,
ch
:
string
,
options
:
modes
.
IFormattingOptions
):
TPromise
<
ISingleEditOperation
[]
>
{
return
this
.
_withAdapter
(
handle
,
OnTypeFormattingAdapter
,
adapter
=>
adapter
.
formatAfterKeystroke
(
resource
,
position
,
ch
,
options
));
}
...
...
@@ -1036,4 +1030,4 @@ export class MainThreadLanguageFeatures {
});
return
undefined
;
}
}
\ No newline at end of file
}
src/vs/workbench/api/common/extHostLanguages.ts
浏览文件 @
bf6db831
...
...
@@ -4,18 +4,8 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
PluginHostModelService
}
from
'
vs/workbench/api/common/pluginHostDocuments
'
;
import
{
ISingleEditOperation
,
ISelection
,
IRange
,
IInternalIndentationOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
MainThreadEditorsTracker
,
MainThreadTextEditor
,
ITextEditorConfiguration
}
from
'
vs/workbench/api/common/mainThreadEditors
'
;
import
*
as
TypeConverters
from
'
./pluginHostTypeConverters
'
;
import
{
TextEditorSelectionChangeEvent
,
TextEditorOptionsChangeEvent
}
from
'
vscode
'
;
import
{
IEditorModesRegistry
,
Extensions
}
from
'
vs/editor/common/modes/modesRegistry
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
INullService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -45,4 +35,4 @@ export class MainThreadLanguages {
_getLanguages
():
TPromise
<
string
[]
>
{
return
TPromise
.
as
(
this
.
_registry
.
getRegisteredModes
());
}
}
\ No newline at end of file
}
src/vs/workbench/api/common/extHostOutputService.ts
浏览文件 @
bf6db831
...
...
@@ -109,4 +109,4 @@ export class MainThreadOutputService {
}
}
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录