Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3e9fe803
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,发现更多精彩内容 >>
提交
3e9fe803
编写于
1月 06, 2016
作者:
D
Dirk Baeumer
提交者:
Johannes Rieken
1月 06, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add feature flag to support using tsserver for JS files
上级
5e60ad0f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
7 deletion
+22
-7
extensions/typescript/package.json
extensions/typescript/package.json
+2
-0
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+7
-1
src/vs/languages/javascript/common/javascript.contribution.ts
...vs/languages/javascript/common/javascript.contribution.ts
+11
-4
src/vs/languages/typescript.workbench/common/contribution.ts
src/vs/languages/typescript.workbench/common/contribution.ts
+1
-1
src/vs/workbench/electron-browser/index.html
src/vs/workbench/electron-browser/index.html
+1
-1
未找到文件。
extensions/typescript/package.json
浏览文件 @
3e9fe803
...
...
@@ -15,6 +15,8 @@
"activationEvents"
:
[
"onLanguage:typescript"
,
"onLanguage:typescriptreact"
,
"onLanguage:javascript"
,
"onLanguage:javascriptreact"
,
"onCommand:typescript.reloadProjects"
],
"main"
:
"./out/typescriptMain"
,
...
...
extensions/typescript/src/typescriptMain.ts
浏览文件 @
3e9fe803
...
...
@@ -33,7 +33,8 @@ export function activate(context: ExtensionContext): void {
let
MODE_ID_TS
=
'
typescript
'
;
let
MODE_ID_TSX
=
'
typescriptreact
'
;
let
MY_PLUGIN_ID
=
'
vs.language.typescript
'
;
let
MODE_ID_JS
=
'
javascript
'
;
let
MODE_ID_JSX
=
'
javascriptreact
'
;
let
clientHost
=
new
TypeScriptServiceClientHost
();
let
client
=
clientHost
.
serviceClient
;
...
...
@@ -45,6 +46,11 @@ export function activate(context: ExtensionContext): void {
client
.
onReady
().
then
(()
=>
{
registerSupports
(
MODE_ID_TS
,
clientHost
,
client
);
registerSupports
(
MODE_ID_TSX
,
clientHost
,
client
);
let
useSalsa
=
!!
process
.
env
[
'
CODE_TSJS
'
]
||
!!
process
.
env
[
'
VSCODE_TSJS
'
]
if
(
useSalsa
)
{
registerSupports
(
MODE_ID_JS
,
clientHost
,
client
);
registerSupports
(
MODE_ID_JSX
,
clientHost
,
client
);
}
},
()
=>
{
// Nothing to do here. The client did show a message;
})
...
...
src/vs/languages/javascript/common/javascript.contribution.ts
浏览文件 @
3e9fe803
...
...
@@ -8,7 +8,7 @@ import nls = require('vs/nls');
import
env
=
require
(
'
vs/base/common/flags
'
);
import
platform
=
require
(
'
vs/platform/platform
'
);
import
ConfigurationRegistry
=
require
(
'
vs/platform/configuration/common/configurationRegistry
'
);
import
modesExtensions
=
require
(
'
vs/editor/common/modes/modesRegistry
'
)
;
import
{
LanguageExtensions
}
from
'
vs/editor/common/modes/languageExtensionPoint
'
;
import
typescript
=
require
(
'
vs/languages/typescript/common/typescript
'
);
import
extensions
=
require
(
'
vs/languages/javascript/common/javascript.extensions
'
);
import
Options
=
require
(
'
vs/languages/typescript/common/options
'
);
...
...
@@ -17,7 +17,7 @@ import Mime = require('vs/base/common/mime');
if
(
!
env
.
enableTypeScriptServiceModeForJS
)
{
modesExtensions
.
register
Mode
({
LanguageExtensions
.
registerCompat
Mode
({
id
:
'
javascript
'
,
extensions
:
[
'
.js
'
,
'
.es6
'
],
firstLine
:
'
^#!.*
\\
bnode
'
,
...
...
@@ -187,5 +187,12 @@ if (!env.enableTypeScriptServiceModeForJS) {
]
});
}
else
{
Mime
.
registerTextMimeByFilename
(
'
.js
'
,
'
text/typescript
'
);
}
LanguageExtensions
.
registerLanguage
({
id
:
'
javascript
'
,
extensions
:
[
'
.js
'
,
'
.es6
'
],
firstLine
:
'
^#!.*
\\
bnode
'
,
filenames
:
[
'
jakefile
'
],
aliases
:
[
'
JavaScript
'
,
'
javascript
'
,
'
js
'
],
mimetypes
:
[
'
text/javascript
'
]
});
}
\ No newline at end of file
src/vs/languages/typescript.workbench/common/contribution.ts
浏览文件 @
3e9fe803
...
...
@@ -13,7 +13,7 @@ import {AsyncDescriptor} from 'vs/platform/instantiation/common/descriptors';
// contributes the project resolver logic to TypeScript and JavaScript
// this guy is for the workbench, but not for the standalone editor
if
(
env
.
enableJavaScriptRewriting
)
{
if
(
env
.
enableJavaScriptRewriting
&&
!
env
.
enableTypeScriptServiceModeForJS
)
{
modesExt
.
registerWorkerParticipant
(
'
javascript
'
,
'
vs/languages/typescript/common/js/globalVariableRewriter
'
,
'
GlobalVariableCollector
'
);
modesExt
.
registerWorkerParticipant
(
'
javascript
'
,
'
vs/languages/typescript/common/js/angularServiceRewriter
'
,
'
AngularServiceRewriter
'
);
modesExt
.
registerWorkerParticipant
(
'
javascript
'
,
'
vs/languages/typescript/common/js/requireRewriter
'
);
...
...
src/vs/workbench/electron-browser/index.html
浏览文件 @
3e9fe803
...
...
@@ -148,7 +148,7 @@
'
enableJavaScriptRewriting
'
:
true
,
'
enableSendASmile
'
:
!!
configuration
.
sendASmile
,
'
enableTypeScriptServiceMode
'
:
true
||
!
process
.
env
[
'
VSCODE_TSWORKER
'
],
'
enableTypeScriptServiceModeForJS
'
:
!!
process
.
env
[
'
CODE_TSJS
'
]
'
enableTypeScriptServiceModeForJS
'
:
!!
process
.
env
[
'
CODE_TSJS
'
]
||
!!
process
.
env
[
'
VSCODE_TSJS
'
]
};
var
programStart
=
remote
.
getGlobal
(
'
programStart
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录