Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7c66baa9
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,发现更多精彩内容 >>
提交
7c66baa9
编写于
1月 09, 2017
作者:
J
Johannes Rieken
提交者:
GitHub
1月 09, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18251 from Ikuyadeu/re_use_readonly
Re use readonly #12732 #13863
上级
e664ba62
96c178dd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
103 deletion
+33
-103
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+33
-91
src/vs/workbench/test/node/api/extHostConfiguration.test.ts
src/vs/workbench/test/node/api/extHostConfiguration.test.ts
+0
-1
src/vs/workbench/test/node/api/extHostDocuments.test.ts
src/vs/workbench/test/node/api/extHostDocuments.test.ts
+0
-11
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
7c66baa9
...
...
@@ -45,47 +45,35 @@ declare module 'vscode' {
/**
* The zero-based line number.
*
* @readonly
*/
lineNumber
:
number
;
readonly
lineNumber
:
number
;
/**
* The text of this line without the line separator characters.
*
* @readonly
*/
text
:
string
;
readonly
text
:
string
;
/**
* The range this line covers without the line separator characters.
*
* @readonly
*/
range
:
Range
;
r
eadonly
r
ange
:
Range
;
/**
* The range this line covers with the line separator characters.
*
* @readonly
*/
rangeIncludingLineBreak
:
Range
;
r
eadonly
r
angeIncludingLineBreak
:
Range
;
/**
* The offset of the first character which is not a whitespace character as defined
* by `/\s/`. **Note** that if a line is all whitespaces the length of the line is returned.
*
* @readonly
*/
firstNonWhitespaceCharacterIndex
:
number
;
readonly
firstNonWhitespaceCharacterIndex
:
number
;
/**
* Whether this line is whitespace only, shorthand
* for [TextLine.firstNonWhitespaceCharacterIndex](#TextLine.firstNonWhitespaceCharacterIndex) === [TextLine.text.length](#TextLine.text).
*
* @readonly
*/
isEmptyOrWhitespace
:
boolean
;
readonly
isEmptyOrWhitespace
:
boolean
;
}
/**
...
...
@@ -98,47 +86,35 @@ declare module 'vscode' {
* The associated URI for this document. Most documents have the __file__-scheme, indicating that they
* represent files on disk. However, some documents may have other schemes indicating that they are not
* available on disk.
*
* @readonly
*/
uri
:
Uri
;
readonly
uri
:
Uri
;
/**
* The file system path of the associated resource. Shorthand
* notation for [TextDocument.uri.fsPath](#TextDocument.uri). Independent of the uri scheme.
*
* @readonly
*/
fileName
:
string
;
readonly
fileName
:
string
;
/**
* Is this document representing an untitled file.
*
* @readonly
*/
isUntitled
:
boolean
;
readonly
isUntitled
:
boolean
;
/**
* The identifier of the language associated with this document.
*
* @readonly
*/
languageId
:
string
;
readonly
languageId
:
string
;
/**
* The version number of this document (it will strictly increase after each
* change, including undo/redo).
*
* @readonly
*/
version
:
number
;
readonly
version
:
number
;
/**
* true if there are unpersisted changes.
*
* @readonly
*/
isDirty
:
boolean
;
readonly
isDirty
:
boolean
;
/**
* Save the underlying file.
...
...
@@ -151,10 +127,8 @@ declare module 'vscode' {
/**
* The number of lines in this document.
*
* @readonly
*/
lineCount
:
number
;
readonly
lineCount
:
number
;
/**
* Returns a text line denoted by the line number. Note
...
...
@@ -249,15 +223,13 @@ declare module 'vscode' {
/**
* The zero-based line value.
* @readonly
*/
line
:
number
;
readonly
line
:
number
;
/**
* The zero-based character value.
* @readonly
*/
character
:
number
;
readonly
character
:
number
;
/**
* @param line A zero-based line value.
...
...
@@ -370,15 +342,13 @@ declare module 'vscode' {
/**
* The start position. It is before or equal to [end](#Range.end).
* @readonly
*/
start
:
Position
;
readonly
start
:
Position
;
/**
* The end position. It is after or equal to [start](#Range.start).
* @readonly
*/
end
:
Position
;
readonly
end
:
Position
;
/**
* Create a new range from two positions. If `start` is not
...
...
@@ -656,9 +626,8 @@ declare module 'vscode' {
/**
* Internal representation of the handle.
* @readonly
*/
key
:
string
;
readonly
key
:
string
;
/**
* Remove this decoration type and all decorations on all text editors using it.
...
...
@@ -1542,10 +1511,8 @@ declare module 'vscode' {
/**
* An array of diagnostics.
*
* @readonly
*/
diagnostics
:
Diagnostic
[];
readonly
diagnostics
:
Diagnostic
[];
}
/**
...
...
@@ -1593,10 +1560,8 @@ declare module 'vscode' {
/**
* `true` when there is a command associated.
*
* @readonly
*/
isResolved
:
boolean
;
readonly
isResolved
:
boolean
;
/**
* Creates a new code lens object.
...
...
@@ -2004,10 +1969,8 @@ declare module 'vscode' {
/**
* The number of affected resources.
*
* @readonly
*/
size
:
number
;
readonly
size
:
number
;
/**
* Replace the given range with given text for the given resource.
...
...
@@ -2850,9 +2813,8 @@ declare module 'vscode' {
/**
* Readable dictionary that backs this configuration.
* @readonly
*/
[
key
:
string
]:
any
;
readonly
[
key
:
string
]:
any
;
}
/**
...
...
@@ -2965,9 +2927,8 @@ declare module 'vscode' {
* The name of this diagnostic collection, for instance `typescript`. Every diagnostic
* from this collection will be associated with this name. Also, the task framework uses this
* name when defining [problem matchers](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher).
* @readonly
*/
name
:
string
;
readonly
name
:
string
;
/**
* Assign diagnostics for given resource. Will replace
...
...
@@ -3057,9 +3018,8 @@ declare module 'vscode' {
/**
* The human-readable name of this output channel.
* @readonly
*/
name
:
string
;
readonly
name
:
string
;
/**
* Append the given value to the channel.
...
...
@@ -3134,18 +3094,14 @@ declare module 'vscode' {
/**
* The alignment of this item.
*
* @readonly
*/
alignment
:
StatusBarAlignment
;
readonly
alignment
:
StatusBarAlignment
;
/**
* The priority of this item. Higher value means the item should
* be shown more to the left.
*
* @readonly
*/
priority
:
number
;
readonly
priority
:
number
;
/**
* The text to show for the entry. You can embed icons in the text by leveraging the syntax:
...
...
@@ -3197,17 +3153,13 @@ declare module 'vscode' {
/**
* The name of the terminal.
*
* @readonly
*/
name
:
string
;
readonly
name
:
string
;
/**
* The process ID of the shell process.
*
* @readonly
*/
processId
:
Thenable
<
number
>
;
readonly
processId
:
Thenable
<
number
>
;
/**
* Send text to the terminal. The text is written to the stdin of the underlying pty process
...
...
@@ -3247,39 +3199,29 @@ declare module 'vscode' {
/**
* The canonical extension identifier in the form of: `publisher.name`.
*
* @readonly
*/
id
:
string
;
readonly
id
:
string
;
/**
* The absolute file path of the directory containing this extension.
*
* @readonly
*/
extensionPath
:
string
;
readonly
extensionPath
:
string
;
/**
* `true` if the extension has been activated.
*
* @readonly
*/
isActive
:
boolean
;
readonly
isActive
:
boolean
;
/**
* The parsed contents of the extension's package.json.
*
* @readonly
*/
packageJSON
:
any
;
readonly
packageJSON
:
any
;
/**
* The public API exported by this extension. It is an invalid action
* to access this field before this extension has been activated.
*
* @readonly
*/
exports
:
T
;
readonly
exports
:
T
;
/**
* Activates this extension and returns its public API.
...
...
src/vs/workbench/test/node/api/extHostConfiguration.test.ts
浏览文件 @
7c66baa9
...
...
@@ -67,7 +67,6 @@ suite('ExtHostConfiguration', function () {
assert
.
equal
(
config
.
get
(
'
config4
'
),
''
);
assert
.
equal
(
config
[
'
config0
'
],
true
);
assert
.
equal
(
config
[
'
config4
'
],
''
);
assert
.
throws
(()
=>
config
[
'
config4
'
]
=
'
valuevalue
'
);
assert
.
ok
(
config
.
has
(
'
nested.config1
'
));
assert
.
equal
(
config
.
get
(
'
nested.config1
'
),
42
);
...
...
src/vs/workbench/test/node/api/extHostDocuments.test.ts
浏览文件 @
7c66baa9
...
...
@@ -38,20 +38,9 @@ suite('ExtHostDocument', () => {
],
'
\n
'
,
'
text
'
,
1
,
false
);
});
test
(
'
readonly-ness
'
,
function
()
{
assert
.
throws
(()
=>
data
.
document
.
uri
=
null
);
assert
.
throws
(()
=>
data
.
document
.
fileName
=
'
foofile
'
);
assert
.
throws
(()
=>
data
.
document
.
isDirty
=
false
);
assert
.
throws
(()
=>
data
.
document
.
isUntitled
=
false
);
assert
.
throws
(()
=>
data
.
document
.
languageId
=
'
dddd
'
);
assert
.
throws
(()
=>
data
.
document
.
lineCount
=
9
);
});
test
(
'
lines
'
,
function
()
{
assert
.
equal
(
data
.
document
.
lineCount
,
4
);
assert
.
throws
(()
=>
data
.
document
.
lineCount
=
9
);
assert
.
throws
(()
=>
data
.
lineAt
(
-
1
));
assert
.
throws
(()
=>
data
.
lineAt
(
data
.
document
.
lineCount
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录