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 @@
*--------------------------------------------------------------------------------------------*/
'
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
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
...
...
@@ -24,12 +24,9 @@ import {ExtHostLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFe
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
*
as
extHostTypes
from
'
vs/workbench/api/common/extHostTypes
'
;
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
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
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
URI
from
'
vs/base/common/uri
'
;
import
Severity
from
'
vs/base/common/severity
'
;
...
...
@@ -37,7 +34,6 @@ import {IDisposable} from 'vs/base/common/lifecycle';
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
import
{
IPluginService
,
IPluginDescription
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
PluginsRegistry
}
from
'
vs/platform/plugins/common/pluginsRegistry
'
;
import
{
relative
}
from
'
path
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
...
...
@@ -337,7 +333,7 @@ export class ExtHostAPIImplementation {
get
all
():
Extension
<
any
>
[]
{
return
PluginsRegistry
.
getAllPluginDescriptions
().
map
((
desc
)
=>
new
Extension
(
pluginService
,
desc
));
}
}
}
;
// Intentionally calling a function for typechecking purposes
defineAPI
(
this
);
...
...
@@ -354,8 +350,6 @@ export class ExtHostAPIImplementation {
// comment configuration
if
(
comments
)
{
let
lineCommentToken
=
comments
.
lineComment
;
let
contrib
:
ICommentsSupportContribution
=
{
commentsConfiguration
:
{}
};
if
(
comments
.
lineComment
)
{
contrib
.
commentsConfiguration
.
lineCommentTokens
=
[
comments
.
lineComment
];
...
...
@@ -482,8 +476,8 @@ class Extension<T> implements vscode.Extension<T> {
}
function
defineAPI
(
impl
:
typeof
vscode
)
{
var
node_module
=
<
any
>
require
.
__$__nodeRequire
(
'
module
'
);
var
original
=
node_module
.
_load
;
let
node_module
=
<
any
>
require
.
__$__nodeRequire
(
'
module
'
);
let
original
=
node_module
.
_load
;
node_module
.
_load
=
function
load
(
request
,
parent
,
isMain
)
{
if
(
request
===
'
vscode
'
)
{
return
impl
;
...
...
src/vs/workbench/api/common/extHostApiCommands.ts
浏览文件 @
59062070
...
...
@@ -16,7 +16,7 @@ import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindi
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
IQuickFix2
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
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
'
;
export
class
ExtHostApiCommands
{
...
...
@@ -169,7 +169,7 @@ export class ExtHostApiCommands {
};
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDefinitionProvider
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toLocation
)
return
value
.
map
(
typeConverters
.
toLocation
)
;
}
});
}
...
...
@@ -181,7 +181,7 @@ export class ExtHostApiCommands {
};
return
this
.
_commands
.
executeCommand
<
modes
.
IComputeExtraInfoResult
[]
>
(
'
_executeHoverProvider
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toHover
)
return
value
.
map
(
typeConverters
.
toHover
)
;
}
});
}
...
...
@@ -193,7 +193,7 @@ export class ExtHostApiCommands {
};
return
this
.
_commands
.
executeCommand
<
modes
.
IOccurence
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
value
=>
{
if
(
Array
.
isArray
(
value
))
{
return
value
.
map
(
typeConverters
.
toDocumentHighlight
)
return
value
.
map
(
typeConverters
.
toDocumentHighlight
)
;
}
});
}
...
...
@@ -205,7 +205,7 @@ export class ExtHostApiCommands {
};
return
this
.
_commands
.
executeCommand
<
modes
.
IReference
[]
>
(
'
_executeDocumentHighlights
'
,
args
).
then
(
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 @@
'
use strict
'
;
import
{
Remotable
,
IThreadService
}
from
'
vs/platform/thread/common/thread
'
;
import
{
TypeConstraint
,
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
{
validateConstraint
}
from
'
vs/base/common/types
'
;
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
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
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
'
;
interface
CommandHandler
{
...
...
@@ -54,7 +47,7 @@ export class ExtHostCommands {
dispose
:
()
=>
{
delete
this
.
_commands
[
id
];
}
}
}
;
}
registerTextEditorCommand
(
id
:
string
,
callback
:
(
textEditor
:
vscode
.
TextEditor
,
edit
:
vscode
.
TextEditorEdit
)
=>
void
,
thisArg
?:
any
):
vscode
.
Disposable
{
...
...
@@ -70,12 +63,12 @@ export class ExtHostCommands {
actualCallback
(
activeTextEditor
,
edit
);
}).
then
((
result
)
=>
{
if
(
!
result
)
{
console
.
warn
(
'
Edits from command
'
+
id
+
'
were not applied.
'
)
console
.
warn
(
'
Edits from command
'
+
id
+
'
were not applied.
'
)
;
}
},
(
err
)
=>
{
console
.
warn
(
'
An error occured while running command
'
+
id
,
err
);
});
})
})
;
}
executeCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
{
...
...
@@ -208,7 +201,7 @@ KeybindingsRegistry.registerCommandDesc({
return
accessor
.
get
(
IThreadService
).
getRemotable
(
MainThreadCommands
).
$getCommandHandlerDescriptions
().
then
(
result
=>
{
const
all
:
string
[]
=
[];
for
(
let
id
in
result
)
{
all
.
push
(
'
`
'
+
id
+
'
` -
'
+
_generateMarkdown
(
result
[
id
]))
all
.
push
(
'
`
'
+
id
+
'
` -
'
+
_generateMarkdown
(
result
[
id
]))
;
}
console
.
log
(
all
.
join
(
'
\n
'
));
});
...
...
src/vs/workbench/api/common/extHostConfiguration.ts
浏览文件 @
59062070
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
clone
}
from
'
vs/base/common/objects
'
;
import
{
IDisposable
,
disposeAll
}
from
'
vs/base/common/lifecycle
'
;
import
{
IThreadService
,
Remotable
}
from
'
vs/platform/thread/common/thread
'
;
...
...
@@ -48,14 +47,14 @@ export class ExtHostConfiguration {
// result = Object.freeze(result);
result
.
has
=
function
(
key
:
string
):
boolean
{
return
typeof
ExtHostConfiguration
.
_lookUp
(
key
,
config
)
!==
'
undefined
'
;
}
}
;
result
.
get
=
function
<
T
>
(
key
:
string
,
defaultValue
?:
T
):
T
{
let
result
=
ExtHostConfiguration
.
_lookUp
(
key
,
config
);
if
(
typeof
result
===
'
undefined
'
)
{
result
=
defaultValue
;
}
return
result
;
}
}
;
return
result
;
}
...
...
src/vs/workbench/api/common/extHostDiagnostics.ts
浏览文件 @
59062070
...
...
@@ -127,7 +127,7 @@ class DiagnosticCollection implements vscode.DiagnosticCollection {
source
:
diagnostic
.
source
,
severity
:
DiagnosticCollection
.
_convertDiagnosticsSeverity
(
diagnostic
.
severity
),
code
:
String
(
diagnostic
.
code
)
}
}
;
}
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';
import
{
Range
,
Position
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
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
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -32,7 +32,7 @@ export interface IModelAddedData {
isDirty
:
boolean
;
}
var
_modeId2WordDefinition
:
{
const
_modeId2WordDefinition
:
{
[
modeId
:
string
]:
RegExp
;
}
=
Object
.
create
(
null
);
...
...
@@ -252,7 +252,7 @@ export class BaseTextDocument implements vscode.TextDocument {
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
,
endLineIndex
=
range
.
end
.
line
,
resultLines
:
string
[]
=
[];
...
...
@@ -355,7 +355,7 @@ export class BaseTextDocument implements vscode.TextDocument {
validatePosition
(
position
:
Position
):
Position
{
if
(
!
(
position
instanceof
Position
))
{
throw
new
Error
(
'
Invalid argument
'
)
throw
new
Error
(
'
Invalid argument
'
)
;
}
let
{
line
,
character
}
=
position
;
...
...
@@ -673,7 +673,7 @@ export class MainThreadDocuments {
let
asFileUri
=
URI
.
file
(
uri
.
fsPath
);
return
this
.
_fileService
.
resolveFile
(
asFileUri
).
then
(
stats
=>
{
// 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
=>
{
let
input
=
this
.
_untitledEditorService
.
createOrGet
(
asFileUri
);
// using file-uri makes it show in 'Working Files' section
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';
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
{
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
{
MainThreadEditorsTracker
,
TextEditorRevealType
,
MainThreadTextEditor
,
ITextEditorConfiguration
}
from
'
vs/workbench/api/common/mainThreadEditors
'
;
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
...
...
@@ -130,7 +130,7 @@ export class ExtHostEditors {
_acceptTextEditorRemove
(
id
:
string
):
void
{
// 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
)
{
// removing the current active editor
...
...
@@ -241,7 +241,7 @@ export class TextEditorEdit {
function
readonly
(
name
:
string
,
alt
?:
string
)
{
let
message
=
`The property '
${
name
}
' is readonly.`
;
if
(
alt
)
{
message
+=
` Use '
${
alt
}
' instead.`
message
+=
` Use '
${
alt
}
' instead.`
;
}
return
new
Error
(
message
);
}
...
...
@@ -256,10 +256,10 @@ function deprecated(name:string, message:string = 'Refer to the documentation fo
descriptor
.
value
=
function
(...
args
:
any
[])
{
console
.
warn
(
`[Deprecation Warning] method '
${
name
}
' is deprecated and should no longer be used.
${
message
}
`
);
return
originalMethod
.
apply
(
this
,
args
);
}
}
;
return
descriptor
;
}
}
;
}
class
ExtHostTextEditor
implements
vscode
.
TextEditor
{
...
...
@@ -315,7 +315,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
}
_acceptOptions
(
options
:
EditorOptions
):
void
{
this
.
_options
=
options
this
.
_options
=
options
;
}
// ---- selections
...
...
@@ -384,10 +384,10 @@ class ExtHostTextEditor implements vscode.TextEditor {
}
_applyEdit
(
edit
:
TextEditorEdit
):
TPromise
<
boolean
>
{
var
editData
=
edit
.
finalize
();
let
editData
=
edit
.
finalize
();
// prepare data for serialization
var
edits
:
ISingleEditOperation
[]
=
editData
.
edits
.
map
((
edit
)
=>
{
let
edits
:
ISingleEditOperation
[]
=
editData
.
edits
.
map
((
edit
)
=>
{
return
{
range
:
TypeConverters
.
fromRange
(
edit
.
range
),
text
:
edit
.
text
,
...
...
src/vs/workbench/api/common/extHostFileSystemEventService.ts
浏览文件 @
59062070
...
...
@@ -6,7 +6,6 @@
import
{
FileChangesEvent
,
FileChangeType
}
from
'
vs/platform/files/common/files
'
;
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
{
Disposable
}
from
'
./extHostTypes
'
;
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
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
{
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
{
FormatRegistry
,
FormatOnTypeRegistry
}
from
'
vs/editor/contrib/format/common/format
'
;
import
{
CodeLensRegistry
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
...
...
@@ -102,7 +102,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
id
:
String
(
i
),
range
:
TypeConverters
.
fromRange
(
lens
.
range
),
command
:
TypeConverters
.
Command
.
from
(
lens
.
command
)
}
}
;
});
});
}
...
...
@@ -133,7 +133,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
command
=
{
title
:
'
<<MISSING COMMAND>>
'
,
command
:
'
missing
'
,
}
}
;
}
symbol
.
command
=
TypeConverters
.
Command
.
from
(
command
);
...
...
@@ -236,7 +236,7 @@ class OccurrencesAdapter implements modes.IOccurrencesSupport {
return
{
range
:
TypeConverters
.
fromRange
(
documentHighlight
.
range
),
kind
:
DocumentHighlightKind
[
documentHighlight
.
kind
].
toString
().
toLowerCase
()
}
}
;
}
}
...
...
@@ -251,7 +251,7 @@ class ReferenceAdapter implements modes.IReferenceSupport {
}
canFindReferences
():
boolean
{
return
true
return
true
;
}
findReferences
(
resource
:
URI
,
position
:
IPosition
,
includeDeclaration
:
boolean
):
TPromise
<
modes
.
IReference
[]
>
{
...
...
@@ -502,8 +502,8 @@ class SuggestAdapter implements modes.ISuggestSupport {
// insert the text of the edit and create a dedicated
// suggestion-container with overwrite[Before|After]
suggestion
.
codeSnippet
=
item
.
textEdit
.
newText
;
suggestion
.
overwriteBefore
=
pos
.
character
-
editRange
.
start
.
character
,
suggestion
.
overwriteAfter
=
editRange
.
end
.
character
-
pos
.
character
suggestion
.
overwriteBefore
=
pos
.
character
-
editRange
.
start
.
character
;
suggestion
.
overwriteAfter
=
editRange
.
end
.
character
-
pos
.
character
;
allSuggestions
.
push
({
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';
import
Severity
from
'
vs/base/common/severity
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
TPromise
as
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
vscode
=
require
(
'
vscode
'
);
export
class
ExtHostMessageService
{
...
...
src/vs/workbench/api/common/extHostTelemetry.ts
浏览文件 @
59062070
...
...
@@ -4,18 +4,12 @@
*--------------------------------------------------------------------------------------------*/
'
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
vscode
=
require
(
'
vscode
'
);
export
class
ExtHostTelemetryService
extends
AbstractRemoteTelemetryService
{
protected
handleEvent
(
eventName
:
string
,
data
?:
any
):
void
{
var
data
=
data
||
{};
protected
handleEvent
(
eventName
:
string
,
data
?:
any
):
void
{
data
=
data
||
{};
data
[
'
pluginHostTelemetry
'
]
=
true
;
super
.
handleEvent
(
eventName
,
data
);
}
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
59062070
...
...
@@ -5,7 +5,6 @@
'
use strict
'
;
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
types
from
'
./extHostTypes
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
...
...
@@ -163,7 +162,7 @@ export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.Decorat
return
ranges
.
map
((
r
):
IRangeWithMessage
=>
{
return
{
range
:
fromRange
(
r
)
}
}
;
});
}
}
...
...
@@ -173,12 +172,12 @@ export const TextEdit = {
return
<
ISingleEditOperation
>
{
text
:
edit
.
newText
,
range
:
fromRange
(
edit
.
range
)
}
}
;
},
to
(
edit
:
ISingleEditOperation
):
vscode
.
TextEdit
{
return
new
types
.
TextEdit
(
toRange
(
edit
.
range
),
edit
.
text
);
}
}
}
;
export
namespace
SymbolKind
{
...
...
@@ -251,7 +250,7 @@ export namespace SymbolKind {
case
'
boolean
'
:
return
types
.
SymbolKind
.
Boolean
;
}
return
types
.
SymbolKind
.
Property
return
types
.
SymbolKind
.
Property
;
}
}
...
...
@@ -262,7 +261,7 @@ export namespace SymbolInformation {
SymbolKind
.
to
(
entry
.
type
),
toRange
(
entry
.
range
),
undefined
,
entry
.
containerLabel
)
entry
.
containerLabel
)
;
}
export
function
toOutlineEntry
(
symbol
:
vscode
.
SymbolInformation
):
modes
.
IOutlineEntry
{
...
...
@@ -274,7 +273,6 @@ export namespace SymbolInformation {
icon
:
undefined
,
};
}
}
export
function
fromSymbolInformation
(
info
:
vscode
.
SymbolInformation
):
ITypeBearing
{
...
...
@@ -306,7 +304,7 @@ export function fromHover(hover: vscode.Hover): modes.IComputeExtraInfoResult {
return
<
modes
.
IComputeExtraInfoResult
>
{
range
:
fromRange
(
hover
.
range
),
htmlContent
:
hover
.
contents
.
map
(
fromFormattedString
)
}
}
;
}
export
function
toHover
(
info
:
modes
.
IComputeExtraInfoResult
):
types
.
Hover
{
...
...
@@ -352,7 +350,7 @@ export const Suggest = {
result
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
startPosition
,
endPosition
),
suggestion
.
codeSnippet
);
return
result
;
}
}
}
;
export
namespace
SignatureHelp
{
...
...
@@ -362,7 +360,7 @@ export namespace SignatureHelp {
currentSignature
:
signatureHelp
.
activeSignature
,
currentParameter
:
signatureHelp
.
activeParameter
,
signatures
:
[]
}
}
;
for
(
let
signature
of
signatureHelp
.
signatures
)
{
...
...
@@ -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 @@
import
{
registerMarshallingContribution
,
IMarshallingContribution
}
from
'
vs/base/common/marshalling
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
{
fromPosition
,
fromRange
}
from
'
./extHostTypeConverters
'
;
import
{
IRange
,
IPosition
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IReference
}
from
'
vs/editor/common/modes
'
;
abstract
class
OneWayMarshalling
<
T
>
implements
IMarshallingContribution
{
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
59062070
...
...
@@ -233,8 +233,8 @@ export class Range {
}
else
if
(
other
.
contains
(
this
))
{
return
other
;
}
let
start
=
Position
.
Min
(
other
.
start
,
this
.
_start
)
let
end
=
Position
.
Max
(
other
.
end
,
this
.
end
)
let
start
=
Position
.
Min
(
other
.
start
,
this
.
_start
)
;
let
end
=
Position
.
Max
(
other
.
end
,
this
.
end
)
;
return
new
Range
(
start
,
end
);
}
...
...
@@ -306,7 +306,7 @@ export class Selection extends Range {
end
:
this
.
end
,
active
:
this
.
active
,
anchor
:
this
.
anchor
}
}
;
}
}
...
...
@@ -334,7 +334,7 @@ export class TextEdit {
set
range
(
value
:
Range
)
{
if
(
!
value
)
{
throw
illegalArgument
(
'
range
'
)
throw
illegalArgument
(
'
range
'
)
;
}
this
.
_range
=
value
;
}
...
...
@@ -470,7 +470,7 @@ export class Diagnostic {
range
:
this
.
range
,
source
:
this
.
source
,
code
:
this
.
code
,
}
}
;
}
}
...
...
@@ -513,7 +513,7 @@ export class DocumentHighlight {
return
{
range
:
this
.
range
,
kind
:
DocumentHighlightKind
[
this
.
kind
]
}
}
;
}
}
...
...
@@ -558,7 +558,7 @@ export class SymbolInformation {
kind
:
SymbolKind
[
this
.
kind
],
location
:
this
.
location
,
containerName
:
this
.
containerName
}
}
;
}
}
...
...
@@ -659,7 +659,7 @@ export class CompletionItem {
filterText
:
this
.
filterText
,
insertText
:
this
.
insertText
,
textEdit
:
this
.
textEdit
}
}
;
}
}
...
...
src/vs/workbench/api/common/extHostWorkspace.ts
浏览文件 @
59062070
...
...
@@ -8,11 +8,10 @@ import URI from 'vs/base/common/uri';
import
{
ISearchService
,
QueryType
}
from
'
vs/platform/search/common/search
'
;
import
{
IWorkspaceContextService
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
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
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ITextFileService
,
ITextFileOperationResult
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
Uri
,
FileSystemWatcher
}
from
'
vscode
'
;
import
{
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
Uri
}
from
'
vscode
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
bulkEdit
,
IResourceEdit
}
from
'
vs/editor/common/services/bulkEdit
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -46,7 +45,7 @@ export class ExtHostWorkspace {
return
path
.
substring
(
this
.
_workspacePath
.
length
);
}
return
path
return
path
;
}
findFiles
(
include
:
string
,
exclude
:
string
,
maxResults
?:
number
):
Thenable
<
Uri
[]
>
{
...
...
@@ -120,7 +119,7 @@ export class MainThreadWorkspace {
saveAll
(
includeUntitled
?:
boolean
):
Thenable
<
boolean
>
{
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 @@
import
EditorCommon
=
require
(
'
vs/editor/common/editorCommon
'
);
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
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
...
@@ -113,7 +112,7 @@ export class MainThreadTextEditor {
this
.
_codeEditor
=
codeEditor
;
if
(
this
.
_codeEditor
)
{
var
forwardSelection
=
()
=>
{
let
forwardSelection
=
()
=>
{
this
.
_lastSelection
=
this
.
_codeEditor
.
getSelections
();
this
.
_onSelectionChanged
.
fire
(
this
.
_lastSelection
);
};
...
...
@@ -122,7 +121,7 @@ export class MainThreadTextEditor {
forwardSelection
();
}
var
forwardConfiguration
=
()
=>
{
let
forwardConfiguration
=
()
=>
{
this
.
_lastConfiguration
=
MainThreadTextEditor
.
_readConfiguration
(
this
.
_codeEditor
);
this
.
_onConfigurationChanged
.
fire
(
this
.
_lastConfiguration
);
};
...
...
@@ -236,13 +235,13 @@ export class MainThreadTextEditor {
}
if
(
this
.
_codeEditor
)
{
var
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
let
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
return
{
identifier
:
null
,
range
:
Range
.
lift
(
edit
.
range
),
text
:
edit
.
text
,
forceMoveMarkers
:
edit
.
forceMoveMarkers
}
}
;
});
return
this
.
_codeEditor
.
executeEdits
(
'
MainThreadTextEditor
'
,
transformedEdits
)
||
true
;
}
...
...
@@ -449,7 +448,7 @@ export class MainThreadEditorsTracker {
}
private
_findVisibleTextEditorIds
():
string
[]
{
var
result
=
[];
let
result
=
[];
let
modelUris
=
Object
.
keys
(
this
.
_model2TextEditors
);
for
(
let
i
=
0
,
len
=
modelUris
.
length
;
i
<
len
;
i
++
)
{
let
editors
=
this
.
_model2TextEditors
[
modelUris
[
i
]];
...
...
@@ -562,7 +561,7 @@ interface IVisibleModels {
[
modelUri
:
string
]:
{
model
:
EditorCommon
.
IModel
;
codeEditors
:
EditorCommon
.
ICommonCodeEditor
[];
}
}
;
}
function
strcmp
(
a
:
string
,
b
:
string
):
number
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录