Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
4807f833
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,发现更多精彩内容 >>
提交
4807f833
编写于
4月 18, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move ISelection out of editorCommon
上级
4390b8f2
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
85 addition
and
84 deletion
+85
-84
build/monaco/monaco.d.ts.recipe
build/monaco/monaco.d.ts.recipe
+2
-2
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+3
-3
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+6
-6
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+3
-3
src/vs/editor/common/controller/cursorCollection.ts
src/vs/editor/common/controller/cursorCollection.ts
+1
-2
src/vs/editor/common/controller/oneCursor.ts
src/vs/editor/common/controller/oneCursor.ts
+2
-2
src/vs/editor/common/core/selection.ts
src/vs/editor/common/core/selection.ts
+23
-1
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+1
-23
src/vs/editor/common/services/bulkEdit.ts
src/vs/editor/common/services/bulkEdit.ts
+2
-2
src/vs/editor/contrib/snippet/common/snippetController.ts
src/vs/editor/contrib/snippet/common/snippetController.ts
+7
-9
src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
...s/editor/test/common/controller/cursorMoveCommand.test.ts
+3
-2
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+23
-23
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-2
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+2
-1
src/vs/workbench/api/node/mainThreadEditor.ts
src/vs/workbench/api/node/mainThreadEditor.ts
+2
-2
src/vs/workbench/api/node/mainThreadEditors.ts
src/vs/workbench/api/node/mainThreadEditors.ts
+2
-1
未找到文件。
build/monaco/monaco.d.ts.recipe
浏览文件 @
4807f833
...
...
@@ -43,10 +43,10 @@ declare module monaco {
#include(vs/base/common/htmlContent): MarkedString
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
#include(vs/base/browser/mouseEvent): IMouseEvent
#include(vs/editor/common/editorCommon): IScrollEvent
, ISelection
#include(vs/editor/common/editorCommon): IScrollEvent
#include(vs/editor/common/core/position): IPosition, Position
#include(vs/editor/common/core/range): IRange, Range
#include(vs/editor/common/core/selection): Selection, SelectionDirection
#include(vs/editor/common/core/selection):
ISelection,
Selection, SelectionDirection
#include(vs/editor/common/core/token): Token
}
...
...
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
4807f833
...
...
@@ -26,7 +26,7 @@ import { CodeEditor } from 'vs/editor/browser/codeEditor';
import
{
ViewLineToken
}
from
'
vs/editor/common/core/viewLineToken
'
;
import
{
Configuration
}
from
'
vs/editor/browser/config/configuration
'
;
import
{
Position
,
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
InlineDecoration
}
from
'
vs/editor/common/viewModel/viewModel
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
ColorId
,
MetadataConsts
,
FontStyle
}
from
'
vs/editor/common/modes
'
;
...
...
@@ -624,13 +624,13 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
public
setSelection
(
range
:
IRange
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
editorRange
:
Range
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
selection
:
editorCommon
.
ISelection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
selection
:
ISelection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
editorSelection
:
Selection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
something
:
any
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
{
this
.
modifiedEditor
.
setSelection
(
something
,
reveal
,
revealVerticalInCenter
,
revealHorizontal
);
}
public
setSelections
(
ranges
:
editorCommon
.
ISelection
[]):
void
{
public
setSelections
(
ranges
:
ISelection
[]):
void
{
this
.
modifiedEditor
.
setSelections
(
ranges
);
}
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
4807f833
...
...
@@ -19,7 +19,7 @@ import { IViewModelHelper } from 'vs/editor/common/controller/oneCursor';
import
{
EditorState
}
from
'
vs/editor/common/core/editorState
'
;
import
{
Position
,
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
,
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
CharacterHardWrappingLineMapperFactory
}
from
'
vs/editor/common/viewModel/characterHardWrappingLineMapper
'
;
import
{
SplitLinesCollection
}
from
'
vs/editor/common/viewModel/splitLinesCollection
'
;
...
...
@@ -399,7 +399,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
public
setSelection
(
range
:
IRange
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
editorRange
:
Range
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
selection
:
editorCommon
.
ISelection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
selection
:
ISelection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
editorSelection
:
Selection
,
reveal
?:
boolean
,
revealVerticalInCenter
?:
boolean
,
revealHorizontal
?:
boolean
):
void
;
public
setSelection
(
something
:
any
,
reveal
:
boolean
=
false
,
revealVerticalInCenter
:
boolean
=
false
,
revealHorizontal
:
boolean
=
false
):
void
{
let
isSelection
=
Selection
.
isISelection
(
something
);
...
...
@@ -410,10 +410,10 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
}
if
(
isSelection
)
{
this
.
_setSelectionImpl
(
<
editorCommon
.
ISelection
>
something
,
reveal
,
revealVerticalInCenter
,
revealHorizontal
);
this
.
_setSelectionImpl
(
<
ISelection
>
something
,
reveal
,
revealVerticalInCenter
,
revealHorizontal
);
}
else
if
(
isRange
)
{
// act as if it was an IRange
let
selection
:
editorCommon
.
ISelection
=
{
let
selection
:
ISelection
=
{
selectionStartLineNumber
:
something
.
startLineNumber
,
selectionStartColumn
:
something
.
startColumn
,
positionLineNumber
:
something
.
endLineNumber
,
...
...
@@ -423,7 +423,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
}
}
private
_setSelectionImpl
(
sel
:
editorCommon
.
ISelection
,
reveal
:
boolean
,
revealVerticalInCenter
:
boolean
,
revealHorizontal
:
boolean
):
void
{
private
_setSelectionImpl
(
sel
:
ISelection
,
reveal
:
boolean
,
revealVerticalInCenter
:
boolean
,
revealHorizontal
:
boolean
):
void
{
if
(
!
this
.
cursor
)
{
return
;
}
...
...
@@ -514,7 +514,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
);
}
public
setSelections
(
ranges
:
editorCommon
.
ISelection
[]):
void
{
public
setSelections
(
ranges
:
ISelection
[]):
void
{
if
(
!
this
.
cursor
)
{
return
;
}
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
4807f833
...
...
@@ -14,7 +14,7 @@ import { CursorCollection, ICursorCollectionState } from 'vs/editor/common/contr
import
{
IViewModelHelper
,
OneCursor
,
OneCursorOp
,
CursorContext
}
from
'
vs/editor/common/controller/oneCursor
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
,
SelectionDirection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
SelectionDirection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
CursorColumns
,
EditOperationResult
,
CursorConfiguration
}
from
'
vs/editor/common/controller/cursorCommon
'
;
import
{
LanguageConfigurationRegistry
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
...
...
@@ -226,7 +226,7 @@ export class Cursor extends EventEmitter {
public
restoreState
(
states
:
editorCommon
.
ICursorState
[]):
void
{
var
desiredSelections
:
editorCommon
.
ISelection
[]
=
[],
var
desiredSelections
:
ISelection
[]
=
[],
state
:
editorCommon
.
ICursorState
;
for
(
var
i
=
0
;
i
<
states
.
length
;
i
++
)
{
...
...
@@ -316,7 +316,7 @@ export class Cursor extends EventEmitter {
return
this
.
cursors
.
getPosition
(
0
);
}
public
setSelections
(
source
:
string
,
selections
:
editorCommon
.
ISelection
[]):
void
{
public
setSelections
(
source
:
string
,
selections
:
ISelection
[]):
void
{
this
.
_onHandler
(
'
setSelections
'
,
(
ctx
:
IMultipleCursorOperationContext
)
=>
{
ctx
.
shouldReveal
=
false
;
this
.
cursors
.
setSelections
(
selections
);
...
...
src/vs/editor/common/controller/cursorCollection.ts
浏览文件 @
4807f833
...
...
@@ -5,8 +5,7 @@
'
use strict
'
;
import
{
IOneCursorState
,
OneCursor
,
CursorContext
}
from
'
vs/editor/common/controller/oneCursor
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
ISelection
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
CursorState
}
from
'
vs/editor/common/controller/cursorCommon
'
;
...
...
src/vs/editor/common/controller/oneCursor.ts
浏览文件 @
4807f833
...
...
@@ -7,7 +7,7 @@
import
{
SingleCursorState
,
CursorConfiguration
,
ICursorSimpleModel
,
CursorState
}
from
'
vs/editor/common/controller/cursorCommon
'
;
import
{
Position
,
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
,
SelectionDirection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
SelectionDirection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
MoveOperations
}
from
'
vs/editor/common/controller/cursorMoveOperations
'
;
import
{
WordOperations
}
from
'
vs/editor/common/controller/cursorWordOperations
'
;
...
...
@@ -245,7 +245,7 @@ export class OneCursor {
context
.
model
.
_removeMarker
(
this
.
_selEndMarker
);
}
public
setSelection
(
context
:
CursorContext
,
selection
:
editorCommon
.
ISelection
,
viewSelection
:
editorCommon
.
ISelection
=
null
):
void
{
public
setSelection
(
context
:
CursorContext
,
selection
:
ISelection
,
viewSelection
:
ISelection
=
null
):
void
{
let
position
=
context
.
model
.
validatePosition
({
lineNumber
:
selection
.
positionLineNumber
,
column
:
selection
.
positionColumn
...
...
src/vs/editor/common/core/selection.ts
浏览文件 @
4807f833
...
...
@@ -5,7 +5,29 @@
'
use strict
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ISelection
}
from
'
vs/editor/common/editorCommon
'
;
/**
* A selection in the editor.
* The selection is a range that has an orientation.
*/
export
interface
ISelection
{
/**
* The line number on which the selection has started.
*/
readonly
selectionStartLineNumber
:
number
;
/**
* The column on `selectionStartLineNumber` where the selection has started.
*/
readonly
selectionStartColumn
:
number
;
/**
* The line number on which the selection has ended.
*/
readonly
positionLineNumber
:
number
;
/**
* The column on `positionLineNumber` where the selection has ended.
*/
readonly
positionColumn
:
number
;
}
/**
* The direction of a selection.
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
4807f833
...
...
@@ -15,7 +15,7 @@ import { LineTokens } from 'vs/editor/common/core/lineTokens';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Position
,
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
,
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IndentRange
}
from
'
vs/editor/common/model/indentRanges
'
;
import
{
ICommandHandlerDescription
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -35,28 +35,6 @@ export interface Event<T> {
// --- position & range
/**
* A selection in the editor.
* The selection is a range that has an orientation.
*/
export
interface
ISelection
{
/**
* The line number on which the selection has started.
*/
readonly
selectionStartLineNumber
:
number
;
/**
* The column on `selectionStartLineNumber` where the selection has started.
*/
readonly
selectionStartColumn
:
number
;
/**
* The line number on which the selection has ended.
*/
readonly
positionLineNumber
:
number
;
/**
* The column on `positionLineNumber` where the selection has ended.
*/
readonly
positionColumn
:
number
;
}
/**
* Vertical Lane in the overview ruler of the editor.
...
...
src/vs/editor/common/services/bulkEdit.ts
浏览文件 @
4807f833
...
...
@@ -14,8 +14,8 @@ import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/se
import
{
IFileService
,
IFileChange
}
from
'
vs/platform/files/common/files
'
;
import
{
EditOperation
}
from
'
vs/editor/common/core/editOperation
'
;
import
{
Range
,
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IIdentifiedSingleEditOperation
,
IModel
,
ISelection
,
EndOfLineSequence
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IIdentifiedSingleEditOperation
,
IModel
,
EndOfLineSequence
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IProgressRunner
}
from
'
vs/platform/progress/common/progress
'
;
export
interface
IResourceEdit
{
...
...
src/vs/editor/contrib/snippet/common/snippetController.ts
浏览文件 @
4807f833
...
...
@@ -16,11 +16,9 @@ import { CommonEditorRegistry, commonEditorContribution, EditorCommand } from 'v
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISnippetVariableResolver
,
ICodeSnippet
,
CodeSnippet
}
from
'
./snippet
'
;
import
{
SnippetVariablesResolver
}
from
'
./snippetVariables
'
;
import
EditorContextKeys
=
editorCommon
.
EditorContextKeys
;
import
{
IPosition
}
from
"
vs/editor/common/core/position
"
;
export
class
InsertSnippetController
{
private
editor
:
editorCommon
.
ICommonCodeEditor
;
...
...
@@ -336,15 +334,15 @@ export class InsertSnippetController {
}
private
doLinkEditing
():
void
{
const
selections
:
editorCommon
.
I
Selection
[]
=
[];
const
selections
:
Selection
[]
=
[];
for
(
let
i
=
0
,
len
=
this
.
trackedPlaceHolders
[
this
.
currentPlaceHolderIndex
].
ranges
.
length
;
i
<
len
;
i
++
)
{
const
range
=
this
.
model
.
getDecorationRange
(
this
.
trackedPlaceHolders
[
this
.
currentPlaceHolderIndex
].
ranges
[
i
]);
selections
.
push
(
{
selectionStartLineNumber
:
range
.
startLineNumber
,
selectionStartColumn
:
range
.
startColumn
,
positionLineNumber
:
range
.
endLineNumber
,
positionColumn
:
range
.
endColumn
}
);
selections
.
push
(
new
Selection
(
range
.
startLineNumber
,
range
.
startColumn
,
range
.
endLineNumber
,
range
.
endColumn
)
);
}
this
.
editor
.
setSelections
(
selections
);
this
.
editor
.
revealRangeInCenterIfOutsideViewport
(
this
.
editor
.
getSelection
());
...
...
src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
浏览文件 @
4807f833
...
...
@@ -7,13 +7,14 @@
import
*
as
assert
from
'
assert
'
;
import
{
Cursor
}
from
'
vs/editor/common/controller/cursor
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Handler
,
ITextModelCreationOptions
,
CursorMovePosition
,
CursorMoveByUnit
,
ISelection
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Handler
,
ITextModelCreationOptions
,
CursorMovePosition
,
CursorMoveByUnit
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Model
}
from
'
vs/editor/common/model/model
'
;
import
{
IMode
}
from
'
vs/editor/common/modes
'
;
import
{
TestConfiguration
}
from
'
vs/editor/test/common/mocks/testConfiguration
'
;
import
{
viewModelHelper
as
aViewModelHelper
}
from
'
vs/editor/test/common/editorTestUtils
'
;
import
{
IViewModelHelper
}
from
'
vs/editor/common/controller/oneCursor
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IEditorOptions
}
from
"
vs/editor/common/config/editorOptions
"
;
let
H
=
Handler
;
...
...
@@ -544,7 +545,7 @@ function positionEqual(position: Position, lineNumber: number, column: number) {
assert
.
deepEqual
(
position
,
new
Position
(
lineNumber
,
column
),
'
position equal
'
);
}
function
selectionEqual
(
selection
:
I
Selection
,
posLineNumber
:
number
,
posColumn
:
number
,
selLineNumber
:
number
,
selColumn
:
number
)
{
function
selectionEqual
(
selection
:
Selection
,
posLineNumber
:
number
,
posColumn
:
number
,
selLineNumber
:
number
,
selColumn
:
number
)
{
assert
.
deepEqual
({
selectionStartLineNumber
:
selection
.
selectionStartLineNumber
,
selectionStartColumn
:
selection
.
selectionStartColumn
,
...
...
src/vs/monaco.d.ts
浏览文件 @
4807f833
...
...
@@ -413,29 +413,6 @@ declare module monaco {
readonly
scrollWidthChanged
:
boolean
;
readonly
scrollHeightChanged
:
boolean
;
}
/**
* A selection in the editor.
* The selection is a range that has an orientation.
*/
export
interface
ISelection
{
/**
* The line number on which the selection has started.
*/
readonly
selectionStartLineNumber
:
number
;
/**
* The column on `selectionStartLineNumber` where the selection has started.
*/
readonly
selectionStartColumn
:
number
;
/**
* The line number on which the selection has ended.
*/
readonly
positionLineNumber
:
number
;
/**
* The column on `positionLineNumber` where the selection has ended.
*/
readonly
positionColumn
:
number
;
}
/**
* A position in the editor. This interface is suitable for serialization.
*/
...
...
@@ -666,6 +643,29 @@ declare module monaco {
static
spansMultipleLines
(
range
:
IRange
):
boolean
;
}
/**
* A selection in the editor.
* The selection is a range that has an orientation.
*/
export
interface
ISelection
{
/**
* The line number on which the selection has started.
*/
readonly
selectionStartLineNumber
:
number
;
/**
* The column on `selectionStartLineNumber` where the selection has started.
*/
readonly
selectionStartColumn
:
number
;
/**
* The line number on which the selection has ended.
*/
readonly
positionLineNumber
:
number
;
/**
* The column on `positionLineNumber` where the selection has ended.
*/
readonly
positionColumn
:
number
;
}
/**
* A selection in the editor.
* The selection is a range that has an orientation.
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
4807f833
...
...
@@ -41,6 +41,7 @@ import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks';
import
{
IModelChangedEvent
}
from
'
vs/editor/common/model/mirrorModel2
'
;
import
{
IPosition
}
from
"
vs/editor/common/core/position
"
;
import
{
IRange
}
from
"
vs/editor/common/core/range
"
;
import
{
ISelection
}
from
"
vs/editor/common/core/selection
"
;
export
interface
IEnvironment
{
enableProposedApi
:
boolean
;
...
...
@@ -140,7 +141,7 @@ export abstract class MainThreadEditorsShape {
$trySetOptions
(
id
:
string
,
options
:
ITextEditorConfigurationUpdate
):
TPromise
<
any
>
{
throw
ni
();
}
$trySetDecorations
(
id
:
string
,
key
:
string
,
ranges
:
editorCommon
.
IDecorationOptions
[]):
TPromise
<
any
>
{
throw
ni
();
}
$tryRevealRange
(
id
:
string
,
range
:
IRange
,
revealType
:
TextEditorRevealType
):
TPromise
<
any
>
{
throw
ni
();
}
$trySetSelections
(
id
:
string
,
selections
:
editorCommon
.
ISelection
[]):
TPromise
<
any
>
{
throw
ni
();
}
$trySetSelections
(
id
:
string
,
selections
:
ISelection
[]):
TPromise
<
any
>
{
throw
ni
();
}
$tryApplyEdits
(
id
:
string
,
modelVersionId
:
number
,
edits
:
editorCommon
.
ISingleEditOperation
[],
opts
:
IApplyEditsOptions
):
TPromise
<
boolean
>
{
throw
ni
();
}
$tryInsertSnippet
(
id
:
string
,
template
:
string
,
selections
:
IRange
[],
opts
:
IUndoStopOptions
):
TPromise
<
any
>
{
throw
ni
();
}
$getDiffInformation
(
id
:
string
):
TPromise
<
editorCommon
.
ILineChange
[]
>
{
throw
ni
();
}
...
...
@@ -326,7 +327,7 @@ export interface ITextEditorAddData {
id
:
string
;
document
:
URI
;
options
:
IResolvedTextEditorConfiguration
;
selections
:
editorCommon
.
ISelection
[];
selections
:
ISelection
[];
editorPosition
:
EditorPosition
;
}
export
interface
ITextEditorPositionData
{
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
4807f833
...
...
@@ -8,12 +8,13 @@ import Severity from 'vs/base/common/severity';
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
I
Selection
,
I
DecorationOptions
,
EndOfLineSequence
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IDecorationOptions
,
EndOfLineSequence
}
from
'
vs/editor/common/editorCommon
'
;
import
*
as
vscode
from
'
vscode
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
SaveReason
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IPosition
}
from
"
vs/editor/common/core/position
"
;
import
{
IRange
}
from
"
vs/editor/common/core/range
"
;
import
{
ISelection
}
from
"
vs/editor/common/core/selection
"
;
export
interface
PositionLike
{
line
:
number
;
...
...
src/vs/workbench/api/node/mainThreadEditor.ts
浏览文件 @
4807f833
...
...
@@ -10,7 +10,7 @@ import { IEditor } from 'vs/platform/editor/common/editor';
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
Range
,
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
Selection
,
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
SnippetController
}
from
'
vs/editor/contrib/snippet/common/snippetController
'
;
import
{
EndOfLine
,
TextEditorLineNumbersStyle
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
TextEditorCursorStyle
,
cursorStyleToString
}
from
"
vs/editor/common/config/editorOptions
"
;
...
...
@@ -195,7 +195,7 @@ export class MainThreadTextEditor {
return
this
.
_lastSelection
;
}
public
setSelections
(
selections
:
EditorCommon
.
ISelection
[]):
void
{
public
setSelections
(
selections
:
ISelection
[]):
void
{
if
(
this
.
_codeEditor
)
{
this
.
_codeEditor
.
setSelections
(
selections
);
return
;
...
...
src/vs/workbench/api/node/mainThreadEditors.ts
浏览文件 @
4807f833
...
...
@@ -8,7 +8,7 @@ import URI from 'vs/base/common/uri';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
ISingleEditOperation
,
I
Selection
,
I
DecorationRenderOptions
,
IDecorationOptions
,
ILineChange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ISingleEditOperation
,
IDecorationRenderOptions
,
IDecorationOptions
,
ILineChange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
...
...
@@ -19,6 +19,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
equals
as
objectEquals
}
from
'
vs/base/common/objects
'
;
import
{
ExtHostContext
,
MainThreadEditorsShape
,
ExtHostEditorsShape
,
ITextEditorPositionData
}
from
'
./extHost.protocol
'
;
import
{
IRange
}
from
"
vs/editor/common/core/range
"
;
import
{
ISelection
}
from
"
vs/editor/common/core/selection
"
;
export
class
MainThreadEditors
extends
MainThreadEditorsShape
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录