Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e6a76e4b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6a76e4b
编写于
10月 26, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move js/ts language mode ids to own file
上级
abcdfe2c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
14 deletion
+24
-14
extensions/typescript/src/features/bufferSyncSupport.ts
extensions/typescript/src/features/bufferSyncSupport.ts
+5
-4
extensions/typescript/src/features/completionItemProvider.ts
extensions/typescript/src/features/completionItemProvider.ts
+3
-1
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+3
-7
extensions/typescript/src/utils/languageModeIds.ts
extensions/typescript/src/utils/languageModeIds.ts
+9
-0
extensions/typescript/src/utils/projectStatus.ts
extensions/typescript/src/utils/projectStatus.ts
+2
-1
extensions/typescript/src/utils/versionStatus.ts
extensions/typescript/src/utils/versionStatus.ts
+2
-1
未找到文件。
extensions/typescript/src/features/bufferSyncSupport.ts
浏览文件 @
e6a76e4b
...
...
@@ -9,6 +9,7 @@ import { workspace, TextDocument, TextDocumentChangeEvent, TextDocumentContentCh
import
*
as
Proto
from
'
../protocol
'
;
import
{
ITypescriptServiceClient
}
from
'
../typescriptService
'
;
import
{
Delayer
}
from
'
../utils/async
'
;
import
*
as
languageModeIds
from
'
../utils/languageModeIds
'
;
interface
IDiagnosticRequestor
{
requestDiagnostic
(
filepath
:
string
):
void
;
...
...
@@ -16,10 +17,10 @@ interface IDiagnosticRequestor {
function
mode2ScriptKind
(
mode
:
string
):
'
TS
'
|
'
TSX
'
|
'
JS
'
|
'
JSX
'
|
undefined
{
switch
(
mode
)
{
case
'
typescript
'
:
return
'
TS
'
;
case
'
typescriptreact
'
:
return
'
TSX
'
;
case
'
javascript
'
:
return
'
JS
'
;
case
'
javascriptreact
'
:
return
'
JSX
'
;
case
languageModeIds
.
typescript
:
return
'
TS
'
;
case
languageModeIds
.
typescriptreact
:
return
'
TSX
'
;
case
languageModeIds
.
javascript
:
return
'
JS
'
;
case
languageModeIds
.
javascriptreact
:
return
'
JSX
'
;
}
return
undefined
;
}
...
...
extensions/typescript/src/features/completionItemProvider.ts
浏览文件 @
e6a76e4b
...
...
@@ -15,6 +15,8 @@ import { tsTextSpanToVsRange, vsPositionToTsFileLocation } from '../utils/conver
import
*
as
nls
from
'
vscode-nls
'
;
import
{
applyCodeAction
}
from
'
../utils/codeAction
'
;
import
*
as
languageModeIds
from
'
../utils/languageModeIds
'
;
let
localize
=
nls
.
loadMessageBundle
();
class
MyCompletionItem
extends
CompletionItem
{
...
...
@@ -236,7 +238,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
const
body
=
msg
.
body
;
if
(
body
)
{
// Only enable dot completions in TS files for now
let
enableDotCompletions
=
document
&&
(
document
.
languageId
===
'
typescript
'
||
document
.
languageId
===
'
typescriptreact
'
);
let
enableDotCompletions
=
document
&&
(
document
.
languageId
===
languageModeIds
.
typescript
||
document
.
languageId
===
languageModeIds
.
typescriptreact
);
// TODO: Workaround for https://github.com/Microsoft/TypeScript/issues/13456
// Only enable dot completions when previous character is an identifier.
...
...
extensions/typescript/src/typescriptMain.ts
浏览文件 @
e6a76e4b
...
...
@@ -35,6 +35,7 @@ import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin } from '.
import
{
openOrCreateConfigFile
,
isImplicitProjectConfigFile
}
from
'
./utils/tsconfig
'
;
import
{
tsLocationToVsPosition
}
from
'
./utils/convert
'
;
import
FormattingConfigurationManager
from
'
./features/formattingConfigurationManager
'
;
import
*
as
languageModeIds
from
'
./utils/languageModeIds
'
;
interface
LanguageDescription
{
id
:
string
;
...
...
@@ -54,21 +55,16 @@ interface ProjectConfigMessageItem extends MessageItem {
id
:
ProjectConfigAction
;
}
const
MODE_ID_TS
=
'
typescript
'
;
const
MODE_ID_TSX
=
'
typescriptreact
'
;
const
MODE_ID_JS
=
'
javascript
'
;
const
MODE_ID_JSX
=
'
javascriptreact
'
;
const
standardLanguageDescriptions
:
LanguageDescription
[]
=
[
{
id
:
'
typescript
'
,
diagnosticSource
:
'
ts
'
,
modeIds
:
[
MODE_ID_TS
,
MODE_ID_TSX
],
modeIds
:
[
languageModeIds
.
typescript
,
languageModeIds
.
typescriptreact
],
configFile
:
'
tsconfig.json
'
},
{
id
:
'
javascript
'
,
diagnosticSource
:
'
js
'
,
modeIds
:
[
MODE_ID_JS
,
MODE_ID_JSX
],
modeIds
:
[
languageModeIds
.
javascript
,
languageModeIds
.
javascriptreact
],
configFile
:
'
jsconfig.json
'
}
];
...
...
extensions/typescript/src/utils/languageModeIds.ts
0 → 100644
浏览文件 @
e6a76e4b
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export
const
typescript
=
'
typescript
'
;
export
const
typescriptreact
=
'
typescriptreact
'
;
export
const
javascript
=
'
javascript
'
;
export
const
javascriptreact
=
'
javascriptreact
'
;
\ No newline at end of file
extensions/typescript/src/utils/projectStatus.ts
浏览文件 @
e6a76e4b
...
...
@@ -8,9 +8,10 @@ import { ITypescriptServiceClient } from '../typescriptService';
import
{
loadMessageBundle
}
from
'
vscode-nls
'
;
import
{
dirname
}
from
'
path
'
;
import
{
openOrCreateConfigFile
,
isImplicitProjectConfigFile
}
from
'
./tsconfig
'
;
import
*
as
languageModeIds
from
'
../utils/languageModeIds
'
;
const
localize
=
loadMessageBundle
();
const
selector
=
[
'
javascript
'
,
'
javascriptreact
'
];
const
selector
=
[
languageModeIds
.
javascript
,
languageModeIds
.
javascriptreact
];
interface
Hint
{
...
...
extensions/typescript/src/utils/versionStatus.ts
浏览文件 @
e6a76e4b
...
...
@@ -5,6 +5,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
{
TypeScriptVersion
}
from
'
./versionProvider
'
;
import
*
as
languageModeIds
from
'
./languageModeIds
'
;
export
default
class
VersionStatus
{
private
onChangeEditorSub
:
vscode
.
Disposable
;
...
...
@@ -37,7 +38,7 @@ export default class VersionStatus {
}
const
doc
=
vscode
.
window
.
activeTextEditor
.
document
;
if
(
vscode
.
languages
.
match
(
'
typescript
'
,
doc
)
||
vscode
.
languages
.
match
(
'
typescriptreact
'
,
doc
))
{
if
(
vscode
.
languages
.
match
(
[
languageModeIds
.
typescript
,
languageModeIds
.
typescriptreact
]
,
doc
))
{
this
.
versionBarEntry
.
show
();
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录