Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
59062070
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
59062070
编写于
12月 21, 2015
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
workbench api linting
上级
acd6a190
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
67 addition
and
94 deletion
+67
-94
src/vs/workbench/api/browser/extHost.api.impl.ts
src/vs/workbench/api/browser/extHost.api.impl.ts
+5
-11
src/vs/workbench/api/common/extHostApiCommands.ts
src/vs/workbench/api/common/extHostApiCommands.ts
+5
-5
src/vs/workbench/api/common/extHostCommands.ts
src/vs/workbench/api/common/extHostCommands.ts
+5
-12
src/vs/workbench/api/common/extHostConfiguration.ts
src/vs/workbench/api/common/extHostConfiguration.ts
+2
-3
src/vs/workbench/api/common/extHostDiagnostics.ts
src/vs/workbench/api/common/extHostDiagnostics.ts
+1
-1
src/vs/workbench/api/common/extHostDocuments.ts
src/vs/workbench/api/common/extHostDocuments.ts
+5
-5
src/vs/workbench/api/common/extHostEditors.ts
src/vs/workbench/api/common/extHostEditors.ts
+8
-8
src/vs/workbench/api/common/extHostFileSystemEventService.ts
src/vs/workbench/api/common/extHostFileSystemEventService.ts
+0
-1
src/vs/workbench/api/common/extHostLanguageFeatures.ts
src/vs/workbench/api/common/extHostLanguageFeatures.ts
+7
-7
src/vs/workbench/api/common/extHostMessageService.ts
src/vs/workbench/api/common/extHostMessageService.ts
+0
-1
src/vs/workbench/api/common/extHostTelemetry.ts
src/vs/workbench/api/common/extHostTelemetry.ts
+2
-8
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+9
-11
src/vs/workbench/api/common/extHostTypes.marshalling.ts
src/vs/workbench/api/common/extHostTypes.marshalling.ts
+0
-1
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+8
-8
src/vs/workbench/api/common/extHostWorkspace.ts
src/vs/workbench/api/common/extHostWorkspace.ts
+4
-5
src/vs/workbench/api/common/mainThreadEditors.ts
src/vs/workbench/api/common/mainThreadEditors.ts
+6
-7
未找到文件。
src/vs/workbench/api/browser/extHost.api.impl.ts
浏览文件 @
59062070
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
{
MainInplaceReplaceSupport
,
ReplaceSupport
,
IBracketElectricCharacterContribution
}
from
'
vs/editor/common/modes/supports
'
;
import
{
IBracketElectricCharacterContribution
}
from
'
vs/editor/common/modes/supports
'
;
import
{
score
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
score
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
...
@@ -24,12 +24,9 @@ import {ExtHostLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFe
...
@@ -24,12 +24,9 @@ import {ExtHostLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFe
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
*
as
extHostTypes
from
'
vs/workbench/api/common/extHostTypes
'
;
import
*
as
extHostTypes
from
'
vs/workbench/api/common/extHostTypes
'
;
import
'
vs/workbench/api/common/extHostTypes.marshalling
'
;
import
'
vs/workbench/api/common/extHostTypes.marshalling
'
;
import
*
as
TypeConverters
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
{
wrapAsWinJSPromise
}
from
'
vs/base/common/async
'
;
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
Modes
=
require
(
'
vs/editor/common/modes
'
);
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
I
DeclarationContribution
,
ISuggestContribution
,
IReferenceContribution
,
I
CommentsSupportContribution
,
ITokenTypeClassificationSupportContribution
}
from
'
vs/editor/common/modes/supports
'
;
import
{
ICommentsSupportContribution
,
ITokenTypeClassificationSupportContribution
}
from
'
vs/editor/common/modes/supports
'
;
import
{
IOnEnterSupportOptions
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
{
IOnEnterSupportOptions
}
from
'
vs/editor/common/modes/supports/onEnter
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
...
@@ -37,7 +34,6 @@ import {IDisposable} from 'vs/base/common/lifecycle';
...
@@ -37,7 +34,6 @@ import {IDisposable} from 'vs/base/common/lifecycle';
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
{
IPluginService
,
IPluginDescription
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
IPluginService
,
IPluginDescription
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
relative
}
from
'
path
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
...
@@ -337,7 +333,7 @@ export class ExtHostAPIImplementation {
...
@@ -337,7 +333,7 @@ export class ExtHostAPIImplementation {
get
all
():
Extension
<
any
>
[]
{
get
all
():
Extension
<
any
>
[]
{
return
PluginsRegistry
.
getAllPluginDescriptions
().
map
((
desc
)
=>
new
Extension
(
pluginService
,
desc
));
return
PluginsRegistry
.
getAllPluginDescriptions
().
map
((
desc
)
=>
new
Extension
(
pluginService
,
desc
));
}
}
}
}
;
// Intentionally calling a function for typechecking purposes
// Intentionally calling a function for typechecking purposes
defineAPI
(
this
);
defineAPI
(
this
);
...
@@ -354,8 +350,6 @@ export class ExtHostAPIImplementation {
...
@@ -354,8 +350,6 @@ export class ExtHostAPIImplementation {
// comment configuration
// comment configuration
if
(
comments
)
{
if
(
comments
)
{
let
lineCommentToken
=
comments
.
lineComment
;
let
contrib
:
ICommentsSupportContribution
=
{
commentsConfiguration
:
{}
};
let
contrib
:
ICommentsSupportContribution
=
{
commentsConfiguration
:
{}
};
if
(
comments
.
lineComment
)
{
if
(
comments
.
lineComment
)
{
contrib
.
commentsConfiguration
.
lineCommentTokens
=
[
comments
.
lineComment
];
contrib
.
commentsConfiguration
.
lineCommentTokens
=
[
comments
.
lineComment
];
...
@@ -482,8 +476,8 @@ class Extension<T> implements vscode.Extension<T> {
...
@@ -482,8 +476,8 @@ class Extension<T> implements vscode.Extension<T> {
}
}
function
defineAPI
(
impl
:
typeof
vscode
)
{
function
defineAPI
(
impl
:
typeof
vscode
)
{
var
node_module
=
<
any
>
require
.
__$__nodeRequire
(
'
module
'
);
let
node_module
=
<
any
>
require
.
__$__nodeRequire
(
'
module
'
);
var
original
=
node_module
.
_load
;
let
original
=
node_module
.
_load
;
node_module
.
_load
=
function
load
(
request
,
parent
,
isMain
)
{
node_module
.
_load
=
function
load
(
request
,
parent
,
isMain
)
{
if
(
request
===
'
vscode
'
)
{
if
(
request
===
'
vscode
'
)
{
return
impl
;
return
impl
;
...
...
src/vs/workbench/api/common/extHostApiCommands.ts
浏览文件 @
59062070
...
@@ -16,7 +16,7 @@ import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindi
...
@@ -16,7 +16,7 @@ import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindi
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
IQuickFix2
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
IQuickFix2
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
import
{
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
;
import
{
ICodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
import
{
ICodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
export
class
ExtHostApiCommands
{
export
class
ExtHostApiCommands
{
...
@@ -169,7 +169,7 @@ export class ExtHostApiCommands {
...
@@ -169,7 +169,7 @@ export class ExtHostApiCommands {
};
};
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDefinitionProvider
'
,
args
).
then
(
value
=>
{
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDefinitionProvider
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toLocation
)
return
value
.
map
(
typeConverters
.
toLocation
)
;
}
}
});
});
}
}
...
@@ -181,7 +181,7 @@ export class ExtHostApiCommands {
...
@@ -181,7 +181,7 @@ export class ExtHostApiCommands {
};
};
return
this
.
_commands
.
executeCommand
<
modes
.
IComputeExtraInfoResult
[]
>
(
'
_executeHoverProvider
'
,
args
).
then
(
value
=>
{
return
this
.
_commands
.
executeCommand
<
modes
.
IComputeExtraInfoResult
[]
>
(
'
_executeHoverProvider
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toHover
)
return
value
.
map
(
typeConverters
.
toHover
)
;
}
}
});
});
}
}
...
@@ -193,7 +193,7 @@ export class ExtHostApiCommands {
...
@@ -193,7 +193,7 @@ export class ExtHostApiCommands {
};
};
return
this
.
_commands
.
executeCommand
<
modes
.
IOccurence
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
value
=>
{
return
this
.
_commands
.
executeCommand
<
modes
.
IOccurence
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toDocumentHighlight
)
return
value
.
map
(
typeConverters
.
toDocumentHighlight
)
;
}
}
});
});
}
}
...
@@ -205,7 +205,7 @@ export class ExtHostApiCommands {
...
@@ -205,7 +205,7 @@ export class ExtHostApiCommands {
};
};
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
value
=>
{
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toLocation
)
return
value
.
map
(
typeConverters
.
toLocation
)
;
}
}
});
});
}
}
...
...
src/vs/workbench/api/common/extHostCommands.ts
浏览文件 @
59062070
...
@@ -5,18 +5,11 @@
...
@@ -5,18 +5,11 @@
'
use strict
'
;
'
use strict
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
TypeConstraint
,
validateConstraint
}
from
'
vs/base/common/types
'
;
import
{
validateConstraint
}
from
'
vs/base/common/types
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeybindingsUtils
}
from
'
vs/platform/keybinding/common/keybindingsUtils
'
;
import
{
IKeybindingService
,
ICommandHandlerDescription
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
IKeybindingService
,
ICommandHandlerDescription
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtHostEditors
}
from
'
vs/workbench/api/common/extHostEditors
'
;
import
{
ExtHostEditors
}
from
'
vs/workbench/api/common/extHostEditors
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
canSerialize
}
from
'
vs/base/common/marshalling
'
;
import
{
toErrorMessage
}
from
'
vs/base/common/errors
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
vscode
from
'
vscode
'
;
interface
CommandHandler
{
interface
CommandHandler
{
...
@@ -54,7 +47,7 @@ export class ExtHostCommands {
...
@@ -54,7 +47,7 @@ export class ExtHostCommands {
dispose
:
()
=>
{
dispose
:
()
=>
{
delete
this
.
_commands
[
id
];
delete
this
.
_commands
[
id
];
}
}
}
}
;
}
}
registerTextEditorCommand
(
id
:
string
,
callback
:
(
textEditor
:
vscode
.
TextEditor
,
edit
:
vscode
.
TextEditorEdit
)
=>
void
,
thisArg
?:
any
):
vscode
.
Disposable
{
registerTextEditorCommand
(
id
:
string
,
callback
:
(
textEditor
:
vscode
.
TextEditor
,
edit
:
vscode
.
TextEditorEdit
)
=>
void
,
thisArg
?:
any
):
vscode
.
Disposable
{
...
@@ -70,12 +63,12 @@ export class ExtHostCommands {
...
@@ -70,12 +63,12 @@ export class ExtHostCommands {
actualCallback
(
activeTextEditor
,
edit
);
actualCallback
(
activeTextEditor
,
edit
);
}).
then
((
result
)
=>
{
}).
then
((
result
)
=>
{
if
(
!
result
)
{
if
(
!
result
)
{
console
.
warn
(
'
Edits from command
'
+
id
+
'
were not applied.
'
)
console
.
warn
(
'
Edits from command
'
+
id
+
'
were not applied.
'
)
;
}
}
},
(
err
)
=>
{
},
(
err
)
=>
{
console
.
warn
(
'
An error occured while running command
'
+
id
,
err
);
console
.
warn
(
'
An error occured while running command
'
+
id
,
err
);
});
});
})
})
;
}
}
executeCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
{
executeCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
{
...
@@ -208,7 +201,7 @@ KeybindingsRegistry.registerCommandDesc({
...
@@ -208,7 +201,7 @@ KeybindingsRegistry.registerCommandDesc({
return
accessor
.
get
(
IThreadService
).
getRemotable
(
MainThreadCommands
).
$getCommandHandlerDescriptions
().
then
(
result
=>
{
return
accessor
.
get
(
IThreadService
).
getRemotable
(
MainThreadCommands
).
$getCommandHandlerDescriptions
().
then
(
result
=>
{
const
all
:
string
[]
=
[];
const
all
:
string
[]
=
[];
for
(
let
id
in
result
)
{
for
(
let
id
in
result
)
{
all
.
push
(
'
`
'
+
id
+
'
` -
'
+
_generateMarkdown
(
result
[
id
]))
all
.
push
(
'
`
'
+
id
+
'
` -
'
+
_generateMarkdown
(
result
[
id
]))
;
}
}
console
.
log
(
all
.
join
(
'
\n
'
));
console
.
log
(
all
.
join
(
'
\n
'
));
});
});
...
...
src/vs/workbench/api/common/extHostConfiguration.ts
浏览文件 @
59062070
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
clone
}
from
'
vs/base/common/objects
'
;
import
{
clone
}
from
'
vs/base/common/objects
'
;
import
{
IDisposable
,
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
import
{
IThreadService
,
Remotable
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IThreadService
,
Remotable
}
from
'
vs/platform/thread/common/thread
'
;
...
@@ -48,14 +47,14 @@ export class ExtHostConfiguration {
...
@@ -48,14 +47,14 @@ export class ExtHostConfiguration {
// result = Object.freeze(result);
// result = Object.freeze(result);
result
.
has
=
function
(
key
:
string
):
boolean
{
result
.
has
=
function
(
key
:
string
):
boolean
{
return
typeof
ExtHostConfiguration
.
_lookUp
(
key
,
config
)
!==
'
undefined
'
;
return
typeof
ExtHostConfiguration
.
_lookUp
(
key
,
config
)
!==
'
undefined
'
;
}
}
;
result
.
get
=
function
<
T
>
(
key
:
string
,
defaultValue
?:
T
):
T
{
result
.
get
=
function
<
T
>
(
key
:
string
,
defaultValue
?:
T
):
T
{
let
result
=
ExtHostConfiguration
.
_lookUp
(
key
,
config
);
let
result
=
ExtHostConfiguration
.
_lookUp
(
key
,
config
);
if
(
typeof
result
===
'
undefined
'
)
{
if
(
typeof
result
===
'
undefined
'
)
{
result
=
defaultValue
;
result
=
defaultValue
;
}
}
return
result
;
return
result
;
}
}
;
return
result
;
return
result
;
}
}
...
...
src/vs/workbench/api/common/extHostDiagnostics.ts
浏览文件 @
59062070
...
@@ -127,7 +127,7 @@ class DiagnosticCollection implements vscode.DiagnosticCollection {
...
@@ -127,7 +127,7 @@ class DiagnosticCollection implements vscode.DiagnosticCollection {
source
:
diagnostic
.
source
,
source
:
diagnostic
.
source
,
severity
:
DiagnosticCollection
.
_convertDiagnosticsSeverity
(
diagnostic
.
severity
),
severity
:
DiagnosticCollection
.
_convertDiagnosticsSeverity
(
diagnostic
.
severity
),
code
:
String
(
diagnostic
.
code
)
code
:
String
(
diagnostic
.
code
)
}
}
;
}
}
private
static
_convertDiagnosticsSeverity
(
severity
:
number
):
Severity
{
private
static
_convertDiagnosticsSeverity
(
severity
:
number
):
Severity
{
...
...
src/vs/workbench/api/common/extHostDocuments.ts
浏览文件 @
59062070
...
@@ -16,7 +16,7 @@ import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
...
@@ -16,7 +16,7 @@ import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
import
{
Range
,
Position
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
Range
,
Position
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IEditorService
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorService
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EventType
as
FileEventType
,
LocalFileChangeEvent
,
ITextFileService
,
ITextFileOperationResult
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
EventType
as
FileEventType
,
LocalFileChangeEvent
,
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
vscode
from
'
vscode
'
;
...
@@ -32,7 +32,7 @@ export interface IModelAddedData {
...
@@ -32,7 +32,7 @@ export interface IModelAddedData {
isDirty
:
boolean
;
isDirty
:
boolean
;
}
}
var
_modeId2WordDefinition
:
{
const
_modeId2WordDefinition
:
{
[
modeId
:
string
]:
RegExp
;
[
modeId
:
string
]:
RegExp
;
}
=
Object
.
create
(
null
);
}
=
Object
.
create
(
null
);
...
@@ -252,7 +252,7 @@ export class BaseTextDocument implements vscode.TextDocument {
...
@@ -252,7 +252,7 @@ export class BaseTextDocument implements vscode.TextDocument {
return
this
.
_lines
[
range
.
start
.
line
].
substring
(
range
.
start
.
character
,
range
.
end
.
character
);
return
this
.
_lines
[
range
.
start
.
line
].
substring
(
range
.
start
.
character
,
range
.
end
.
character
);
}
}
var
lineEnding
=
this
.
_eol
,
let
lineEnding
=
this
.
_eol
,
startLineIndex
=
range
.
start
.
line
,
startLineIndex
=
range
.
start
.
line
,
endLineIndex
=
range
.
end
.
line
,
endLineIndex
=
range
.
end
.
line
,
resultLines
:
string
[]
=
[];
resultLines
:
string
[]
=
[];
...
@@ -355,7 +355,7 @@ export class BaseTextDocument implements vscode.TextDocument {
...
@@ -355,7 +355,7 @@ export class BaseTextDocument implements vscode.TextDocument {
validatePosition
(
position
:
Position
):
Position
{
validatePosition
(
position
:
Position
):
Position
{
if
(
!
(
position
instanceof
Position
))
{
if
(
!
(
position
instanceof
Position
))
{
throw
new
Error
(
'
Invalid argument
'
)
throw
new
Error
(
'
Invalid argument
'
)
;
}
}
let
{
line
,
character
}
=
position
;
let
{
line
,
character
}
=
position
;
...
@@ -673,7 +673,7 @@ export class MainThreadDocuments {
...
@@ -673,7 +673,7 @@ export class MainThreadDocuments {
let
asFileUri
=
URI
.
file
(
uri
.
fsPath
);
let
asFileUri
=
URI
.
file
(
uri
.
fsPath
);
return
this
.
_fileService
.
resolveFile
(
asFileUri
).
then
(
stats
=>
{
return
this
.
_fileService
.
resolveFile
(
asFileUri
).
then
(
stats
=>
{
// don't create a new file ontop of an existing file
// don't create a new file ontop of an existing file
return
TPromise
.
wrapError
<
boolean
>
(
'
file already exists on disk
'
)
return
TPromise
.
wrapError
<
boolean
>
(
'
file already exists on disk
'
)
;
},
err
=>
{
},
err
=>
{
let
input
=
this
.
_untitledEditorService
.
createOrGet
(
asFileUri
);
// using file-uri makes it show in 'Working Files' section
let
input
=
this
.
_untitledEditorService
.
createOrGet
(
asFileUri
);
// using file-uri makes it show in 'Working Files' section
return
input
.
resolve
(
true
).
then
(
model
=>
{
return
input
.
resolve
(
true
).
then
(
model
=>
{
...
...
src/vs/workbench/api/common/extHostEditors.ts
浏览文件 @
59062070
...
@@ -14,7 +14,7 @@ import {Selection, Range, Position, EditorOptions} from './extHostTypes';
...
@@ -14,7 +14,7 @@ import {Selection, Range, Position, EditorOptions} from './extHostTypes';
import
{
ISingleEditOperation
,
ISelection
,
IRange
,
IInternalIndentationOptions
,
IEditor
,
EditorType
,
ICommonCodeEditor
,
ICommonDiffEditor
,
IDecorationRenderOptions
,
IRangeWithMessage
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ISingleEditOperation
,
ISelection
,
IRange
,
IInternalIndentationOptions
,
IEditor
,
EditorType
,
ICommonCodeEditor
,
ICommonDiffEditor
,
IDecorationRenderOptions
,
IRangeWithMessage
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditor
as
IPlatformEditor
,
IResourceInput
,
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditor
as
IPlatformEditor
,
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
MainThreadEditorsTracker
,
TextEditorRevealType
,
MainThreadTextEditor
,
ITextEditorConfiguration
}
from
'
vs/workbench/api/common/mainThreadEditors
'
;
import
{
MainThreadEditorsTracker
,
TextEditorRevealType
,
MainThreadTextEditor
,
ITextEditorConfiguration
}
from
'
vs/workbench/api/common/mainThreadEditors
'
;
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
...
@@ -130,7 +130,7 @@ export class ExtHostEditors {
...
@@ -130,7 +130,7 @@ export class ExtHostEditors {
_acceptTextEditorRemove
(
id
:
string
):
void
{
_acceptTextEditorRemove
(
id
:
string
):
void
{
// make sure the removed editor is not visible
// make sure the removed editor is not visible
var
newVisibleEditors
=
this
.
_visibleEditorIds
.
filter
(
visibleEditorId
=>
visibleEditorId
!==
id
);
let
newVisibleEditors
=
this
.
_visibleEditorIds
.
filter
(
visibleEditorId
=>
visibleEditorId
!==
id
);
if
(
this
.
_activeEditorId
===
id
)
{
if
(
this
.
_activeEditorId
===
id
)
{
// removing the current active editor
// removing the current active editor
...
@@ -241,7 +241,7 @@ export class TextEditorEdit {
...
@@ -241,7 +241,7 @@ export class TextEditorEdit {
function
readonly
(
name
:
string
,
alt
?:
string
)
{
function
readonly
(
name
:
string
,
alt
?:
string
)
{
let
message
=
`The property '
${
name
}
' is readonly.`
;
let
message
=
`The property '
${
name
}
' is readonly.`
;
if
(
alt
)
{
if
(
alt
)
{
message
+=
` Use '
${
alt
}
' instead.`
message
+=
` Use '
${
alt
}
' instead.`
;
}
}
return
new
Error
(
message
);
return
new
Error
(
message
);
}
}
...
@@ -256,10 +256,10 @@ function deprecated(name:string, message:string = 'Refer to the documentation fo
...
@@ -256,10 +256,10 @@ function deprecated(name:string, message:string = 'Refer to the documentation fo
descriptor
.
value
=
function
(...
args
:
any
[])
{
descriptor
.
value
=
function
(...
args
:
any
[])
{
console
.
warn
(
`[Deprecation Warning] method '
${
name
}
' is deprecated and should no longer be used.
${
message
}
`
);
console
.
warn
(
`[Deprecation Warning] method '
${
name
}
' is deprecated and should no longer be used.
${
message
}
`
);
return
originalMethod
.
apply
(
this
,
args
);
return
originalMethod
.
apply
(
this
,
args
);
}
}
;
return
descriptor
;
return
descriptor
;
}
}
;
}
}
class
ExtHostTextEditor
implements
vscode
.
TextEditor
{
class
ExtHostTextEditor
implements
vscode
.
TextEditor
{
...
@@ -315,7 +315,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
...
@@ -315,7 +315,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
}
}
_acceptOptions
(
options
:
EditorOptions
):
void
{
_acceptOptions
(
options
:
EditorOptions
):
void
{
this
.
_options
=
options
this
.
_options
=
options
;
}
}
// ---- selections
// ---- selections
...
@@ -384,10 +384,10 @@ class ExtHostTextEditor implements vscode.TextEditor {
...
@@ -384,10 +384,10 @@ class ExtHostTextEditor implements vscode.TextEditor {
}
}
_applyEdit
(
edit
:
TextEditorEdit
):
TPromise
<
boolean
>
{
_applyEdit
(
edit
:
TextEditorEdit
):
TPromise
<
boolean
>
{
var
editData
=
edit
.
finalize
();
let
editData
=
edit
.
finalize
();
// prepare data for serialization
// prepare data for serialization
var
edits
:
ISingleEditOperation
[]
=
editData
.
edits
.
map
((
edit
)
=>
{
let
edits
:
ISingleEditOperation
[]
=
editData
.
edits
.
map
((
edit
)
=>
{
return
{
return
{
range
:
TypeConverters
.
fromRange
(
edit
.
range
),
range
:
TypeConverters
.
fromRange
(
edit
.
range
),
text
:
edit
.
text
,
text
:
edit
.
text
,
...
...
src/vs/workbench/api/common/extHostFileSystemEventService.ts
浏览文件 @
59062070
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
import
{
FileChangesEvent
,
FileChangeType
}
from
'
vs/platform/files/common/files
'
;
import
{
FileChangesEvent
,
FileChangeType
}
from
'
vs/platform/files/common/files
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
./extHostTypes
'
;
import
{
Disposable
}
from
'
./extHostTypes
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
...
...
src/vs/workbench/api/common/extHostLanguageFeatures.ts
浏览文件 @
59062070
...
@@ -25,7 +25,7 @@ import {OccurrencesRegistry} from 'vs/editor/contrib/wordHighlighter/common/word
...
@@ -25,7 +25,7 @@ import {OccurrencesRegistry} from 'vs/editor/contrib/wordHighlighter/common/word
import
{
ReferenceRegistry
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
ReferenceRegistry
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
QuickFixRegistry
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
QuickFixRegistry
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
OutlineRegistry
,
IOutlineEntry
,
IOutlineSupport
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
OutlineRegistry
,
IOutlineEntry
,
IOutlineSupport
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
NavigateTypesSupportRegistry
,
INavigateTypesSupport
,
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
import
{
NavigateTypesSupportRegistry
,
INavigateTypesSupport
,
ITypeBearing
}
from
'
vs/workbench/parts/search/common/search
'
;
import
{
RenameRegistry
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
RenameRegistry
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
FormatRegistry
,
FormatOnTypeRegistry
}
from
'
vs/editor/contrib/format/common/format
'
;
import
{
FormatRegistry
,
FormatOnTypeRegistry
}
from
'
vs/editor/contrib/format/common/format
'
;
import
{
CodeLensRegistry
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
import
{
CodeLensRegistry
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
...
@@ -102,7 +102,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
...
@@ -102,7 +102,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
id
:
String
(
i
),
id
:
String
(
i
),
range
:
TypeConverters
.
fromRange
(
lens
.
range
),
range
:
TypeConverters
.
fromRange
(
lens
.
range
),
command
:
TypeConverters
.
Command
.
from
(
lens
.
command
)
command
:
TypeConverters
.
Command
.
from
(
lens
.
command
)
}
}
;
});
});
});
});
}
}
...
@@ -133,7 +133,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
...
@@ -133,7 +133,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
command
=
{
command
=
{
title
:
'
<<MISSING COMMAND>>
'
,
title
:
'
<<MISSING COMMAND>>
'
,
command
:
'
missing
'
,
command
:
'
missing
'
,
}
}
;
}
}
symbol
.
command
=
TypeConverters
.
Command
.
from
(
command
);
symbol
.
command
=
TypeConverters
.
Command
.
from
(
command
);
...
@@ -236,7 +236,7 @@ class OccurrencesAdapter implements modes.IOccurrencesSupport {
...
@@ -236,7 +236,7 @@ class OccurrencesAdapter implements modes.IOccurrencesSupport {
return
{
return
{
range
:
TypeConverters
.
fromRange
(
documentHighlight
.
range
),
range
:
TypeConverters
.
fromRange
(
documentHighlight
.
range
),
kind
:
DocumentHighlightKind
[
documentHighlight
.
kind
].
toString
().
toLowerCase
()
kind
:
DocumentHighlightKind
[
documentHighlight
.
kind
].
toString
().
toLowerCase
()
}
}
;
}
}
}
}
...
@@ -251,7 +251,7 @@ class ReferenceAdapter implements modes.IReferenceSupport {
...
@@ -251,7 +251,7 @@ class ReferenceAdapter implements modes.IReferenceSupport {
}
}
canFindReferences
():
boolean
{
canFindReferences
():
boolean
{
return
true
return
true
;
}
}
findReferences
(
resource
:
URI
,
position
:
IPosition
,
includeDeclaration
:
boolean
):
TPromise
<
modes
.
IReference
[]
>
{
findReferences
(
resource
:
URI
,
position
:
IPosition
,
includeDeclaration
:
boolean
):
TPromise
<
modes
.
IReference
[]
>
{
...
@@ -502,8 +502,8 @@ class SuggestAdapter implements modes.ISuggestSupport {
...
@@ -502,8 +502,8 @@ class SuggestAdapter implements modes.ISuggestSupport {
// insert the text of the edit and create a dedicated
// insert the text of the edit and create a dedicated
// suggestion-container with overwrite[Before|After]
// suggestion-container with overwrite[Before|After]
suggestion
.
codeSnippet
=
item
.
textEdit
.
newText
;
suggestion
.
codeSnippet
=
item
.
textEdit
.
newText
;
suggestion
.
overwriteBefore
=
pos
.
character
-
editRange
.
start
.
character
,
suggestion
.
overwriteBefore
=
pos
.
character
-
editRange
.
start
.
character
;
suggestion
.
overwriteAfter
=
editRange
.
end
.
character
-
pos
.
character
suggestion
.
overwriteAfter
=
editRange
.
end
.
character
-
pos
.
character
;
allSuggestions
.
push
({
allSuggestions
.
push
({
currentWord
:
doc
.
getText
(
<
any
>
editRange
),
currentWord
:
doc
.
getText
(
<
any
>
editRange
),
...
...
src/vs/workbench/api/common/extHostMessageService.ts
浏览文件 @
59062070
...
@@ -10,7 +10,6 @@ import {IMessageService} from 'vs/platform/message/common/message';
...
@@ -10,7 +10,6 @@ import {IMessageService} from 'vs/platform/message/common/message';
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
vscode
=
require
(
'
vscode
'
);
import
vscode
=
require
(
'
vscode
'
);
export
class
ExtHostMessageService
{
export
class
ExtHostMessageService
{
...
...
src/vs/workbench/api/common/extHostTelemetry.ts
浏览文件 @
59062070
...
@@ -4,18 +4,12 @@
...
@@ -4,18 +4,12 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
'
use strict
'
;
import
{
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
AbstractRemoteTelemetryService
}
from
'
vs/platform/telemetry/common/abstractRemoteTelemetryService
'
;
import
{
AbstractRemoteTelemetryService
}
from
'
vs/platform/telemetry/common/abstractRemoteTelemetryService
'
;
import
vscode
=
require
(
'
vscode
'
);
export
class
ExtHostTelemetryService
extends
AbstractRemoteTelemetryService
{
export
class
ExtHostTelemetryService
extends
AbstractRemoteTelemetryService
{
protected
handleEvent
(
eventName
:
string
,
data
?:
any
):
void
{
protected
handleEvent
(
eventName
:
string
,
data
?:
any
):
void
{
var
data
=
data
||
{};
data
=
data
||
{};
data
[
'
pluginHostTelemetry
'
]
=
true
;
data
[
'
pluginHostTelemetry
'
]
=
true
;
super
.
handleEvent
(
eventName
,
data
);
super
.
handleEvent
(
eventName
,
data
);
}
}
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
59062070
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
'
use strict
'
;
'
use strict
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
...
@@ -163,7 +162,7 @@ export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.Decorat
...
@@ -163,7 +162,7 @@ export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.Decorat
return
ranges
.
map
((
r
):
IRangeWithMessage
=>
{
return
ranges
.
map
((
r
):
IRangeWithMessage
=>
{
return
{
return
{
range
:
fromRange
(
r
)
range
:
fromRange
(
r
)
}
}
;
});
});
}
}
}
}
...
@@ -173,12 +172,12 @@ export const TextEdit = {
...
@@ -173,12 +172,12 @@ export const TextEdit = {
return
<
ISingleEditOperation
>
{
return
<
ISingleEditOperation
>
{
text
:
edit
.
newText
,
text
:
edit
.
newText
,
range
:
fromRange
(
edit
.
range
)
range
:
fromRange
(
edit
.
range
)
}
}
;
},
},
to
(
edit
:
ISingleEditOperation
):
vscode
.
TextEdit
{
to
(
edit
:
ISingleEditOperation
):
vscode
.
TextEdit
{
return
new
types
.
TextEdit
(
toRange
(
edit
.
range
),
edit
.
text
);
return
new
types
.
TextEdit
(
toRange
(
edit
.
range
),
edit
.
text
);
}
}
}
}
;
export
namespace
SymbolKind
{
export
namespace
SymbolKind
{
...
@@ -251,7 +250,7 @@ export namespace SymbolKind {
...
@@ -251,7 +250,7 @@ export namespace SymbolKind {
case
'
boolean
'
:
case
'
boolean
'
:
return
types
.
SymbolKind
.
Boolean
;
return
types
.
SymbolKind
.
Boolean
;
}
}
return
types
.
SymbolKind
.
Property
return
types
.
SymbolKind
.
Property
;
}
}
}
}
...
@@ -262,7 +261,7 @@ export namespace SymbolInformation {
...
@@ -262,7 +261,7 @@ export namespace SymbolInformation {
SymbolKind
.
to
(
entry
.
type
),
SymbolKind
.
to
(
entry
.
type
),
toRange
(
entry
.
range
),
toRange
(
entry
.
range
),
undefined
,
undefined
,
entry
.
containerLabel
)
entry
.
containerLabel
)
;
}
}
export
function
toOutlineEntry
(
symbol
:
vscode
.
SymbolInformation
):
modes
.
IOutlineEntry
{
export
function
toOutlineEntry
(
symbol
:
vscode
.
SymbolInformation
):
modes
.
IOutlineEntry
{
...
@@ -274,7 +273,6 @@ export namespace SymbolInformation {
...
@@ -274,7 +273,6 @@ export namespace SymbolInformation {
icon
:
undefined
,
icon
:
undefined
,
};
};
}
}
}
}
export
function
fromSymbolInformation
(
info
:
vscode
.
SymbolInformation
):
ITypeBearing
{
export
function
fromSymbolInformation
(
info
:
vscode
.
SymbolInformation
):
ITypeBearing
{
...
@@ -306,7 +304,7 @@ export function fromHover(hover: vscode.Hover): modes.IComputeExtraInfoResult {
...
@@ -306,7 +304,7 @@ export function fromHover(hover: vscode.Hover): modes.IComputeExtraInfoResult {
return
<
modes
.
IComputeExtraInfoResult
>
{
return
<
modes
.
IComputeExtraInfoResult
>
{
range
:
fromRange
(
hover
.
range
),
range
:
fromRange
(
hover
.
range
),
htmlContent
:
hover
.
contents
.
map
(
fromFormattedString
)
htmlContent
:
hover
.
contents
.
map
(
fromFormattedString
)
}
}
;
}
}
export
function
toHover
(
info
:
modes
.
IComputeExtraInfoResult
):
types
.
Hover
{
export
function
toHover
(
info
:
modes
.
IComputeExtraInfoResult
):
types
.
Hover
{
...
@@ -352,7 +350,7 @@ export const Suggest = {
...
@@ -352,7 +350,7 @@ export const Suggest = {
result
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
startPosition
,
endPosition
),
suggestion
.
codeSnippet
);
result
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
startPosition
,
endPosition
),
suggestion
.
codeSnippet
);
return
result
;
return
result
;
}
}
}
}
;
export
namespace
SignatureHelp
{
export
namespace
SignatureHelp
{
...
@@ -362,7 +360,7 @@ export namespace SignatureHelp {
...
@@ -362,7 +360,7 @@ export namespace SignatureHelp {
currentSignature
:
signatureHelp
.
activeSignature
,
currentSignature
:
signatureHelp
.
activeSignature
,
currentParameter
:
signatureHelp
.
activeParameter
,
currentParameter
:
signatureHelp
.
activeParameter
,
signatures
:
[]
signatures
:
[]
}
}
;
for
(
let
signature
of
signatureHelp
.
signatures
)
{
for
(
let
signature
of
signatureHelp
.
signatures
)
{
...
@@ -441,4 +439,4 @@ export const Command = {
...
@@ -441,4 +439,4 @@ export const Command = {
};
};
}
}
}
}
}
};
\ No newline at end of file
\ No newline at end of file
src/vs/workbench/api/common/extHostTypes.marshalling.ts
浏览文件 @
59062070
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
{
registerMarshallingContribution
,
IMarshallingContribution
}
from
'
vs/base/common/marshalling
'
;
import
{
registerMarshallingContribution
,
IMarshallingContribution
}
from
'
vs/base/common/marshalling
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
{
fromPosition
,
fromRange
}
from
'
./extHostTypeConverters
'
;
import
{
fromPosition
,
fromRange
}
from
'
./extHostTypeConverters
'
;
import
{
IRange
,
IPosition
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IReference
}
from
'
vs/editor/common/modes
'
;
import
{
IReference
}
from
'
vs/editor/common/modes
'
;
abstract
class
OneWayMarshalling
<
T
>
implements
IMarshallingContribution
{
abstract
class
OneWayMarshalling
<
T
>
implements
IMarshallingContribution
{
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
59062070
...
@@ -233,8 +233,8 @@ export class Range {
...
@@ -233,8 +233,8 @@ export class Range {
}
else
if
(
other
.
contains
(
this
))
{
}
else
if
(
other
.
contains
(
this
))
{
return
other
;
return
other
;
}
}
let
start
=
Position
.
Min
(
other
.
start
,
this
.
_start
)
let
start
=
Position
.
Min
(
other
.
start
,
this
.
_start
)
;
let
end
=
Position
.
Max
(
other
.
end
,
this
.
end
)
let
end
=
Position
.
Max
(
other
.
end
,
this
.
end
)
;
return
new
Range
(
start
,
end
);
return
new
Range
(
start
,
end
);
}
}
...
@@ -306,7 +306,7 @@ export class Selection extends Range {
...
@@ -306,7 +306,7 @@ export class Selection extends Range {
end
:
this
.
end
,
end
:
this
.
end
,
active
:
this
.
active
,
active
:
this
.
active
,
anchor
:
this
.
anchor
anchor
:
this
.
anchor
}
}
;
}
}
}
}
...
@@ -334,7 +334,7 @@ export class TextEdit {
...
@@ -334,7 +334,7 @@ export class TextEdit {
set
range
(
value
:
Range
)
{
set
range
(
value
:
Range
)
{
if
(
!
value
)
{
if
(
!
value
)
{
throw
illegalArgument
(
'
range
'
)
throw
illegalArgument
(
'
range
'
)
;
}
}
this
.
_range
=
value
;
this
.
_range
=
value
;
}
}
...
@@ -470,7 +470,7 @@ export class Diagnostic {
...
@@ -470,7 +470,7 @@ export class Diagnostic {
range
:
this
.
range
,
range
:
this
.
range
,
source
:
this
.
source
,
source
:
this
.
source
,
code
:
this
.
code
,
code
:
this
.
code
,
}
}
;
}
}
}
}
...
@@ -513,7 +513,7 @@ export class DocumentHighlight {
...
@@ -513,7 +513,7 @@ export class DocumentHighlight {
return
{
return
{
range
:
this
.
range
,
range
:
this
.
range
,
kind
:
DocumentHighlightKind
[
this
.
kind
]
kind
:
DocumentHighlightKind
[
this
.
kind
]
}
}
;
}
}
}
}
...
@@ -558,7 +558,7 @@ export class SymbolInformation {
...
@@ -558,7 +558,7 @@ export class SymbolInformation {
kind
:
SymbolKind
[
this
.
kind
],
kind
:
SymbolKind
[
this
.
kind
],
location
:
this
.
location
,
location
:
this
.
location
,
containerName
:
this
.
containerName
containerName
:
this
.
containerName
}
}
;
}
}
}
}
...
@@ -659,7 +659,7 @@ export class CompletionItem {
...
@@ -659,7 +659,7 @@ export class CompletionItem {
filterText
:
this
.
filterText
,
filterText
:
this
.
filterText
,
insertText
:
this
.
insertText
,
insertText
:
this
.
insertText
,
textEdit
:
this
.
textEdit
textEdit
:
this
.
textEdit
}
}
;
}
}
}
}
...
...
src/vs/workbench/api/common/extHostWorkspace.ts
浏览文件 @
59062070
...
@@ -8,11 +8,10 @@ import URI from 'vs/base/common/uri';
...
@@ -8,11 +8,10 @@ import URI from 'vs/base/common/uri';
import
{
ISearchService
,
QueryType
}
from
'
vs/platform/search/common/search
'
;
import
{
ISearchService
,
QueryType
}
from
'
vs/platform/search/common/search
'
;
import
{
IWorkspaceContextService
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ITextFileService
,
ITextFileOperationResult
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
Uri
,
FileSystemWatcher
}
from
'
vscode
'
;
import
{
Uri
}
from
'
vscode
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
bulkEdit
,
IResourceEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
bulkEdit
,
IResourceEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
@@ -46,7 +45,7 @@ export class ExtHostWorkspace {
...
@@ -46,7 +45,7 @@ export class ExtHostWorkspace {
return
path
.
substring
(
this
.
_workspacePath
.
length
);
return
path
.
substring
(
this
.
_workspacePath
.
length
);
}
}
return
path
return
path
;
}
}
findFiles
(
include
:
string
,
exclude
:
string
,
maxResults
?:
number
):
Thenable
<
Uri
[]
>
{
findFiles
(
include
:
string
,
exclude
:
string
,
maxResults
?:
number
):
Thenable
<
Uri
[]
>
{
...
@@ -120,7 +119,7 @@ export class MainThreadWorkspace {
...
@@ -120,7 +119,7 @@ export class MainThreadWorkspace {
saveAll
(
includeUntitled
?:
boolean
):
Thenable
<
boolean
>
{
saveAll
(
includeUntitled
?:
boolean
):
Thenable
<
boolean
>
{
return
this
.
_textFileService
.
saveAll
(
includeUntitled
).
then
(
result
=>
{
return
this
.
_textFileService
.
saveAll
(
includeUntitled
).
then
(
result
=>
{
return
result
.
results
.
every
(
each
=>
each
.
success
===
true
);
;
return
result
.
results
.
every
(
each
=>
each
.
success
===
true
);
});
});
}
}
...
...
src/vs/workbench/api/common/mainThreadEditors.ts
浏览文件 @
59062070
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IEditor
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditor
}
from
'
vs/platform/editor/common/editor
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
@@ -113,7 +112,7 @@ export class MainThreadTextEditor {
...
@@ -113,7 +112,7 @@ export class MainThreadTextEditor {
this
.
_codeEditor
=
codeEditor
;
this
.
_codeEditor
=
codeEditor
;
if
(
this
.
_codeEditor
)
{
if
(
this
.
_codeEditor
)
{
var
forwardSelection
=
()
=>
{
let
forwardSelection
=
()
=>
{
this
.
_lastSelection
=
this
.
_codeEditor
.
getSelections
();
this
.
_lastSelection
=
this
.
_codeEditor
.
getSelections
();
this
.
_onSelectionChanged
.
fire
(
this
.
_lastSelection
);
this
.
_onSelectionChanged
.
fire
(
this
.
_lastSelection
);
};
};
...
@@ -122,7 +121,7 @@ export class MainThreadTextEditor {
...
@@ -122,7 +121,7 @@ export class MainThreadTextEditor {
forwardSelection
();
forwardSelection
();
}
}
var
forwardConfiguration
=
()
=>
{
let
forwardConfiguration
=
()
=>
{
this
.
_lastConfiguration
=
MainThreadTextEditor
.
_readConfiguration
(
this
.
_codeEditor
);
this
.
_lastConfiguration
=
MainThreadTextEditor
.
_readConfiguration
(
this
.
_codeEditor
);
this
.
_onConfigurationChanged
.
fire
(
this
.
_lastConfiguration
);
this
.
_onConfigurationChanged
.
fire
(
this
.
_lastConfiguration
);
};
};
...
@@ -236,13 +235,13 @@ export class MainThreadTextEditor {
...
@@ -236,13 +235,13 @@ export class MainThreadTextEditor {
}
}
if
(
this
.
_codeEditor
)
{
if
(
this
.
_codeEditor
)
{
var
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
let
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
return
{
return
{
identifier
:
null
,
identifier
:
null
,
range
:
Range
.
lift
(
edit
.
range
),
range
:
Range
.
lift
(
edit
.
range
),
text
:
edit
.
text
,
text
:
edit
.
text
,
forceMoveMarkers
:
edit
.
forceMoveMarkers
forceMoveMarkers
:
edit
.
forceMoveMarkers
}
}
;
});
});
return
this
.
_codeEditor
.
executeEdits
(
'
MainThreadTextEditor
'
,
transformedEdits
)
||
true
;
return
this
.
_codeEditor
.
executeEdits
(
'
MainThreadTextEditor
'
,
transformedEdits
)
||
true
;
}
}
...
@@ -449,7 +448,7 @@ export class MainThreadEditorsTracker {
...
@@ -449,7 +448,7 @@ export class MainThreadEditorsTracker {
}
}
private
_findVisibleTextEditorIds
():
string
[]
{
private
_findVisibleTextEditorIds
():
string
[]
{
var
result
=
[];
let
result
=
[];
let
modelUris
=
Object
.
keys
(
this
.
_model2TextEditors
);
let
modelUris
=
Object
.
keys
(
this
.
_model2TextEditors
);
for
(
let
i
=
0
,
len
=
modelUris
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
modelUris
.
length
;
i
<
len
;
i
++
)
{
let
editors
=
this
.
_model2TextEditors
[
modelUris
[
i
]];
let
editors
=
this
.
_model2TextEditors
[
modelUris
[
i
]];
...
@@ -562,7 +561,7 @@ interface IVisibleModels {
...
@@ -562,7 +561,7 @@ interface IVisibleModels {
[
modelUri
:
string
]:
{
[
modelUri
:
string
]:
{
model
:
EditorCommon
.
IModel
;
model
:
EditorCommon
.
IModel
;
codeEditors
:
EditorCommon
.
ICommonCodeEditor
[];
codeEditors
:
EditorCommon
.
ICommonCodeEditor
[];
}
}
;
}
}
function
strcmp
(
a
:
string
,
b
:
string
):
number
{
function
strcmp
(
a
:
string
,
b
:
string
):
number
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录