Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c6d9e8ea
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,发现更多精彩内容 >>
提交
c6d9e8ea
编写于
6月 14, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
status - push proposed API for statusbar id/name and adopt
上级
96913ae4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
87 addition
and
7 deletion
+87
-7
extensions/json-language-features/client/src/jsonMain.ts
extensions/json-language-features/client/src/jsonMain.ts
+6
-1
extensions/typescript-language-features/src/utils/projectStatus.ts
...s/typescript-language-features/src/utils/projectStatus.ts
+6
-1
extensions/typescript-language-features/src/utils/versionStatus.ts
...s/typescript-language-features/src/utils/versionStatus.ts
+9
-1
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+49
-0
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+17
-4
未找到文件。
extensions/json-language-features/client/src/jsonMain.ts
浏览文件 @
c6d9e8ea
...
...
@@ -83,7 +83,12 @@ export function activate(context: ExtensionContext) {
let
documentSelector
=
[
'
json
'
,
'
jsonc
'
];
let
schemaResolutionErrorStatusBarItem
=
window
.
createStatusBarItem
(
StatusBarAlignment
.
Right
,
0
);
let
schemaResolutionErrorStatusBarItem
=
window
.
createStatusBarItem
({
id
:
'
status.json.resolveError
'
,
name
:
localize
(
'
json.resolveError
'
,
"
JSON: Schema Resolution Error
"
),
alignment
:
StatusBarAlignment
.
Right
,
priority
:
0
});
schemaResolutionErrorStatusBarItem
.
command
=
'
_json.retryResolveSchema
'
;
schemaResolutionErrorStatusBarItem
.
tooltip
=
localize
(
'
json.schemaResolutionErrorMessage
'
,
'
Unable to resolve schema.
'
)
+
'
'
+
localize
(
'
json.clickToRetry
'
,
'
Click to retry.
'
);
schemaResolutionErrorStatusBarItem
.
text
=
'
$(alert)
'
;
...
...
extensions/typescript-language-features/src/utils/projectStatus.ts
浏览文件 @
c6d9e8ea
...
...
@@ -23,7 +23,12 @@ class ExcludeHintItem {
constructor
(
private
readonly
telemetryReporter
:
TelemetryReporter
)
{
this
.
_item
=
vscode
.
window
.
createStatusBarItem
(
vscode
.
StatusBarAlignment
.
Right
,
98
/* to the right of typescript version status (99) */
);
this
.
_item
=
vscode
.
window
.
createStatusBarItem
({
id
:
'
status.typescript.exclude
'
,
name
:
localize
(
'
statusExclude
'
,
"
TypeScript: Configure Excludes
"
),
alignment
:
vscode
.
StatusBarAlignment
.
Right
,
priority
:
98
/* to the right of typescript version status (99) */
});
this
.
_item
.
command
=
'
js.projectStatus.command
'
;
}
...
...
extensions/typescript-language-features/src/utils/versionStatus.ts
浏览文件 @
c6d9e8ea
...
...
@@ -7,6 +7,9 @@ import * as vscode from 'vscode';
import
*
as
languageModeIds
from
'
./languageModeIds
'
;
import
{
TypeScriptVersion
}
from
'
./versionProvider
'
;
import
{
Disposable
}
from
'
./dispose
'
;
import
*
as
nls
from
'
vscode-nls
'
;
const
localize
=
nls
.
loadMessageBundle
();
export
default
class
VersionStatus
extends
Disposable
{
private
readonly
_versionBarEntry
:
vscode
.
StatusBarItem
;
...
...
@@ -15,7 +18,12 @@ export default class VersionStatus extends Disposable {
private
readonly
_normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
undefined
)
{
super
();
this
.
_versionBarEntry
=
this
.
_register
(
vscode
.
window
.
createStatusBarItem
(
vscode
.
StatusBarAlignment
.
Right
,
99
/* to the right of editor status (100) */
));
this
.
_versionBarEntry
=
this
.
_register
(
vscode
.
window
.
createStatusBarItem
({
id
:
'
status.typescript.version
'
,
name
:
localize
(
'
typescriptVersion
'
,
"
TypeScript: Version
"
),
alignment
:
vscode
.
StatusBarAlignment
.
Right
,
priority
:
99
/* to the right of editor status (100) */
}));
vscode
.
window
.
onDidChangeActiveTextEditor
(
this
.
showHideStatus
,
this
,
this
.
_disposables
);
}
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
c6d9e8ea
...
...
@@ -1436,4 +1436,53 @@ declare module 'vscode' {
}
// #endregion
// #region Ben - status bar item with ID and Name
export
namespace
window
{
/**
* Options to configure the status bar item.
*/
export
interface
StatusBarItemOptions
{
/**
* A unique identifier of the status bar item. The identifier
* is for example used to allow a user to show or hide the
* status bar item in the UI.
*/
id
:
string
;
/**
* A human readable name of the status bar item. The name is
* for example used as a label in the UI to show or hide the
* status bar item.
*/
name
:
string
;
/**
* The alignment of the status bar item.
*/
alignment
?:
StatusBarAlignment
;
/**
* The priority of the status bar item. Higher value means the item should
* be shown more to the left.
*/
priority
?:
number
;
}
/**
* Creates a status bar [item](#StatusBarItem).
*
* @param options The options of the item. If not provided, some default values
* will be assumed. For example, the `StatusBarItemOptions.id` will be the id
* of the extension and the `StatusBarItemOptions.name` will be the extension name.
* @return A new status bar item.
*/
export
function
createStatusBarItem
(
options
?:
StatusBarItemOptions
):
StatusBarItem
;
}
//#endregion
}
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
c6d9e8ea
...
...
@@ -465,11 +465,24 @@ export function createApiFactory(
showSaveDialog
(
options
)
{
return
extHostDialogs
.
showSaveDialog
(
options
);
},
createStatusBarItem
(
position
?:
vscode
.
StatusBarAlignment
,
priority
?:
number
):
vscode
.
StatusBarItem
{
const
id
=
extension
.
identifier
.
value
;
const
name
=
nls
.
localize
(
'
extensionLabel
'
,
"
{0} (Extension)
"
,
extension
.
displayName
||
extension
.
name
);
createStatusBarItem
(
alignmentOrOptions
?:
vscode
.
StatusBarAlignment
|
vscode
.
window
.
StatusBarItemOptions
,
priority
?:
number
):
vscode
.
StatusBarItem
{
let
id
:
string
;
let
name
:
string
;
let
alignment
:
number
|
undefined
;
if
(
alignmentOrOptions
&&
typeof
alignmentOrOptions
!==
'
number
'
)
{
id
=
alignmentOrOptions
.
id
;
name
=
alignmentOrOptions
.
name
;
alignment
=
alignmentOrOptions
.
alignment
;
priority
=
alignmentOrOptions
.
priority
;
}
else
{
id
=
extension
.
identifier
.
value
;
name
=
nls
.
localize
(
'
extensionLabel
'
,
"
{0} (Extension)
"
,
extension
.
displayName
||
extension
.
name
);
alignment
=
alignmentOrOptions
;
priority
=
priority
;
}
return
extHostStatusBar
.
createStatusBarEntry
(
id
,
name
,
<
number
>
position
,
priority
);
return
extHostStatusBar
.
createStatusBarEntry
(
id
,
name
,
alignment
,
priority
);
},
setStatusBarMessage
(
text
:
string
,
timeoutOrThenable
?:
number
|
Thenable
<
any
>
):
vscode
.
Disposable
{
return
extHostStatusBar
.
setStatusBarMessage
(
text
,
timeoutOrThenable
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录