Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f694b078
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,发现更多精彩内容 >>
提交
f694b078
编写于
8月 18, 2020
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make sure we do not enable JS/TS language features on live share clients
For #104180
上级
c709fd3a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
6 deletion
+20
-6
extensions/typescript-language-features/src/lazyClientHost.ts
...nsions/typescript-language-features/src/lazyClientHost.ts
+3
-1
extensions/typescript-language-features/src/typescriptServiceClient.ts
...pescript-language-features/src/typescriptServiceClient.ts
+7
-5
extensions/typescript-language-features/src/utils/fileSchemes.ts
...ons/typescript-language-features/src/utils/fileSchemes.ts
+10
-0
未找到文件。
extensions/typescript-language-features/src/lazyClientHost.ts
浏览文件 @
f694b078
...
@@ -11,6 +11,7 @@ import { TsServerProcessFactory } from './tsServer/server';
...
@@ -11,6 +11,7 @@ import { TsServerProcessFactory } from './tsServer/server';
import
{
ITypeScriptVersionProvider
}
from
'
./tsServer/versionProvider
'
;
import
{
ITypeScriptVersionProvider
}
from
'
./tsServer/versionProvider
'
;
import
TypeScriptServiceClientHost
from
'
./typeScriptServiceClientHost
'
;
import
TypeScriptServiceClientHost
from
'
./typeScriptServiceClientHost
'
;
import
{
flatten
}
from
'
./utils/arrays
'
;
import
{
flatten
}
from
'
./utils/arrays
'
;
import
*
as
fileSchemes
from
'
./utils/fileSchemes
'
;
import
{
standardLanguageDescriptions
}
from
'
./utils/languageDescription
'
;
import
{
standardLanguageDescriptions
}
from
'
./utils/languageDescription
'
;
import
{
lazy
,
Lazy
}
from
'
./utils/lazy
'
;
import
{
lazy
,
Lazy
}
from
'
./utils/lazy
'
;
import
ManagedFileContextManager
from
'
./utils/managedFileContext
'
;
import
ManagedFileContextManager
from
'
./utils/managedFileContext
'
;
...
@@ -85,5 +86,6 @@ function isSupportedDocument(
...
@@ -85,5 +86,6 @@ function isSupportedDocument(
supportedLanguage
:
readonly
string
[],
supportedLanguage
:
readonly
string
[],
document
:
vscode
.
TextDocument
document
:
vscode
.
TextDocument
):
boolean
{
):
boolean
{
return
supportedLanguage
.
indexOf
(
document
.
languageId
)
>=
0
;
return
supportedLanguage
.
indexOf
(
document
.
languageId
)
>=
0
&&
!
fileSchemes
.
disabledSchemes
.
has
(
document
.
uri
.
scheme
);
}
}
extensions/typescript-language-features/src/typescriptServiceClient.ts
浏览文件 @
f694b078
...
@@ -636,6 +636,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
...
@@ -636,6 +636,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
}
}
public
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
{
public
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
{
if
(
fileSchemes
.
disabledSchemes
.
has
(
resource
.
scheme
))
{
return
undefined
;
}
switch
(
resource
.
scheme
)
{
switch
(
resource
.
scheme
)
{
case
fileSchemes
.
file
:
case
fileSchemes
.
file
:
{
{
...
@@ -648,10 +652,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType
...
@@ -648,10 +652,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType
// Both \ and / must be escaped in regular expressions
// Both \ and / must be escaped in regular expressions
return
result
.
replace
(
new
RegExp
(
'
\\
'
+
this
.
pathSeparator
,
'
g
'
),
'
/
'
);
return
result
.
replace
(
new
RegExp
(
'
\\
'
+
this
.
pathSeparator
,
'
g
'
),
'
/
'
);
}
}
case
fileSchemes
.
git
:
{
return
undefined
;
}
default
:
default
:
{
{
return
this
.
inMemoryResourcePrefix
+
resource
.
toString
(
true
);
return
this
.
inMemoryResourcePrefix
+
resource
.
toString
(
true
);
...
@@ -665,7 +665,9 @@ export default class TypeScriptServiceClient extends Disposable implements IType
...
@@ -665,7 +665,9 @@ export default class TypeScriptServiceClient extends Disposable implements IType
public
toOpenedFilePath
(
document
:
vscode
.
TextDocument
):
string
|
undefined
{
public
toOpenedFilePath
(
document
:
vscode
.
TextDocument
):
string
|
undefined
{
if
(
!
this
.
bufferSyncSupport
.
ensureHasBuffer
(
document
.
uri
))
{
if
(
!
this
.
bufferSyncSupport
.
ensureHasBuffer
(
document
.
uri
))
{
console
.
error
(
`Unexpected resource
${
document
.
uri
}
`
);
if
(
!
fileSchemes
.
disabledSchemes
.
has
(
document
.
uri
.
scheme
))
{
console
.
error
(
`Unexpected resource
${
document
.
uri
}
`
);
}
return
undefined
;
return
undefined
;
}
}
return
this
.
toPath
(
document
.
uri
)
||
undefined
;
return
this
.
toPath
(
document
.
uri
)
||
undefined
;
...
...
extensions/typescript-language-features/src/utils/fileSchemes.ts
浏览文件 @
f694b078
...
@@ -6,9 +6,19 @@
...
@@ -6,9 +6,19 @@
export
const
file
=
'
file
'
;
export
const
file
=
'
file
'
;
export
const
untitled
=
'
untitled
'
;
export
const
untitled
=
'
untitled
'
;
export
const
git
=
'
git
'
;
export
const
git
=
'
git
'
;
/** Live share scheme */
export
const
vsls
=
'
vsls
'
;
export
const
walkThroughSnippet
=
'
walkThroughSnippet
'
;
export
const
walkThroughSnippet
=
'
walkThroughSnippet
'
;
export
const
semanticSupportedSchemes
=
[
export
const
semanticSupportedSchemes
=
[
file
,
file
,
untitled
,
untitled
,
];
];
/**
* File scheme for which JS/TS language feature should be disabled
*/
export
const
disabledSchemes
=
new
Set
([
git
,
vsls
]);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录