Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
813d3aa3
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,体验更适合开发者的 AI 搜索 >>
提交
813d3aa3
编写于
11月 14, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixing some more restrictive tslint errors
上级
bd314b04
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
60 addition
and
72 deletion
+60
-72
extensions/typescript-language-features/src/commands.ts
extensions/typescript-language-features/src/commands.ts
+3
-5
extensions/typescript-language-features/src/extension.ts
extensions/typescript-language-features/src/extension.ts
+0
-2
extensions/typescript-language-features/src/features/completions.ts
.../typescript-language-features/src/features/completions.ts
+1
-3
extensions/typescript-language-features/src/features/definitions.ts
.../typescript-language-features/src/features/definitions.ts
+2
-2
extensions/typescript-language-features/src/features/diagnostics.ts
.../typescript-language-features/src/features/diagnostics.ts
+2
-2
extensions/typescript-language-features/src/features/fileConfigurationManager.ts
...anguage-features/src/features/fileConfigurationManager.ts
+1
-1
extensions/typescript-language-features/src/features/languageConfiguration.ts
...t-language-features/src/features/languageConfiguration.ts
+5
-5
extensions/typescript-language-features/src/features/quickFix.ts
...ons/typescript-language-features/src/features/quickFix.ts
+1
-1
extensions/typescript-language-features/src/features/refactor.ts
...ons/typescript-language-features/src/features/refactor.ts
+4
-4
extensions/typescript-language-features/src/features/updatePathsOnRename.ts
...ipt-language-features/src/features/updatePathsOnRename.ts
+3
-3
extensions/typescript-language-features/src/test/jsdocSnippet.test.ts
...ypescript-language-features/src/test/jsdocSnippet.test.ts
+0
-1
extensions/typescript-language-features/src/tsServer/callbackMap.ts
.../typescript-language-features/src/tsServer/callbackMap.ts
+1
-2
extensions/typescript-language-features/src/tsServer/server.ts
...sions/typescript-language-features/src/tsServer/server.ts
+4
-4
extensions/typescript-language-features/src/typescriptService.ts
...ons/typescript-language-features/src/typescriptService.ts
+2
-3
extensions/typescript-language-features/src/typescriptServiceClient.ts
...pescript-language-features/src/typescriptServiceClient.ts
+2
-2
extensions/typescript-language-features/src/utils/electron.ts
...nsions/typescript-language-features/src/utils/electron.ts
+2
-2
extensions/typescript-language-features/src/utils/memoize.ts
extensions/typescript-language-features/src/utils/memoize.ts
+2
-2
extensions/typescript-language-features/src/utils/telemetry.ts
...sions/typescript-language-features/src/utils/telemetry.ts
+2
-2
extensions/typescript-language-features/src/utils/tracer.ts
extensions/typescript-language-features/src/utils/tracer.ts
+1
-1
extensions/typescript-language-features/src/utils/tsconfig.ts
...nsions/typescript-language-features/src/utils/tsconfig.ts
+0
-1
extensions/typescript-language-features/src/utils/typeConverters.ts
.../typescript-language-features/src/utils/typeConverters.ts
+1
-1
extensions/typescript-language-features/src/utils/versionPicker.ts
...s/typescript-language-features/src/utils/versionPicker.ts
+4
-5
extensions/typescript-language-features/src/utils/versionProvider.ts
...typescript-language-features/src/utils/versionProvider.ts
+0
-1
extensions/typescript-language-features/src/utils/versionStatus.ts
...s/typescript-language-features/src/utils/versionStatus.ts
+1
-1
extensions/typescript-language-features/src/utils/wireProtocol.ts
...ns/typescript-language-features/src/utils/wireProtocol.ts
+16
-16
未找到文件。
extensions/typescript-language-features/src/commands.ts
浏览文件 @
813d3aa3
...
...
@@ -12,10 +12,8 @@ import { isImplicitProjectConfigFile, openOrCreateConfigFile } from './utils/tsc
import
{
nulToken
}
from
'
./utils/cancellation
'
;
import
{
PluginConfigProvider
}
from
'
./typescriptServiceClient
'
;
const
localize
=
nls
.
loadMessageBundle
();
export
class
ReloadTypeScriptProjectsCommand
implements
Command
{
public
readonly
id
=
'
typescript.reloadProjects
'
;
...
...
@@ -143,7 +141,7 @@ async function goToProjectConfig(
return
;
}
let
res
:
protocol
.
ProjectInfoResponse
|
undefined
=
undefined
;
let
res
:
protocol
.
ProjectInfoResponse
|
undefined
;
try
{
res
=
await
client
.
execute
(
'
projectInfo
'
,
{
file
,
needFileNameList
:
false
},
nulToken
);
}
catch
{
...
...
@@ -164,7 +162,7 @@ async function goToProjectConfig(
enum
ProjectConfigAction
{
None
,
CreateConfig
,
LearnMore
LearnMore
,
}
interface
ProjectConfigMessageItem
extends
vscode
.
MessageItem
{
...
...
@@ -179,7 +177,7 @@ async function goToProjectConfig(
title
:
isTypeScriptProject
?
localize
(
'
typescript.configureTsconfigQuickPick
'
,
'
Configure tsconfig.json
'
)
:
localize
(
'
typescript.configureJsconfigQuickPick
'
,
'
Configure jsconfig.json
'
),
id
:
ProjectConfigAction
.
CreateConfig
id
:
ProjectConfigAction
.
CreateConfig
,
});
switch
(
selected
&&
selected
.
id
)
{
...
...
extensions/typescript-language-features/src/extension.ts
浏览文件 @
813d3aa3
...
...
@@ -116,8 +116,6 @@ function createLazyClientHost(
const
surveyor
=
new
Surveyor
(
context
.
globalState
);
context
.
subscriptions
.
push
(
clientHost
.
serviceClient
.
onSurveyReady
(
e
=>
surveyor
.
surveyReady
(
e
.
surveyId
)));
clientHost
.
serviceClient
.
onReady
(()
=>
{
context
.
subscriptions
.
push
(
ProjectStatus
.
create
(
...
...
extensions/typescript-language-features/src/features/completions.ts
浏览文件 @
813d3aa3
...
...
@@ -21,7 +21,6 @@ import FileConfigurationManager from './fileConfigurationManager';
const
localize
=
nls
.
loadMessageBundle
();
interface
CommitCharactersSettings
{
readonly
isNewIdentifierLocation
:
boolean
;
readonly
isInValidCommitCharacterContext
:
boolean
;
...
...
@@ -223,7 +222,6 @@ class CompositeCommand implements Command {
}
}
class
CompletionAcceptedCommand
implements
Command
{
public
static
readonly
ID
=
'
_typescript.onCompletionAccepted
'
;
public
readonly
id
=
CompletionAcceptedCommand
.
ID
;
...
...
@@ -359,7 +357,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
...
typeConverters
.
Position
.
toFileLocationRequestArgs
(
file
,
position
),
includeExternalModuleExports
:
completionConfiguration
.
autoImportSuggestions
,
includeInsertTextCompletions
:
true
,
triggerCharacter
:
this
.
getTsTriggerCharacter
(
context
)
triggerCharacter
:
this
.
getTsTriggerCharacter
(
context
)
,
};
let
isNewIdentifierLocation
=
true
;
...
...
extensions/typescript-language-features/src/features/definitions.ts
浏览文件 @
813d3aa3
...
...
@@ -37,11 +37,11 @@ export default class TypeScriptDefinitionProvider extends DefinitionProviderBase
return
response
.
body
.
definitions
.
map
(
location
=>
{
const
target
=
typeConverters
.
Location
.
fromTextSpan
(
this
.
client
.
toResource
(
location
.
file
),
location
);
return
<
vscode
.
DefinitionLink
>
{
return
{
originSelectionRange
:
span
,
targetRange
:
target
.
range
,
targetUri
:
target
.
uri
,
};
}
as
vscode
.
DefinitionLink
;
});
}
...
...
extensions/typescript-language-features/src/features/diagnostics.ts
浏览文件 @
813d3aa3
...
...
@@ -10,7 +10,7 @@ import { DiagnosticLanguage, allDiagnosticLangauges } from '../utils/languageDes
export
const
enum
DiagnosticKind
{
Syntax
,
Semantic
,
Suggestion
Suggestion
,
}
class
FileDiagnostics
{
...
...
@@ -97,7 +97,7 @@ class DiagnosticSettings {
public
setValidate
(
language
:
DiagnosticLanguage
,
value
:
boolean
):
boolean
{
return
this
.
update
(
language
,
settings
=>
({
validate
:
value
,
enableSuggestions
:
settings
.
enableSuggestions
enableSuggestions
:
settings
.
enableSuggestions
,
}));
}
...
...
extensions/typescript-language-features/src/features/fileConfigurationManager.ts
浏览文件 @
813d3aa3
...
...
@@ -41,7 +41,7 @@ export default class FileConfigurationManager {
public
constructor
(
private
readonly
client
:
ITypeScriptServiceClient
)
{
this
.
onDidCloseTextDocumentSub
=
vscode
.
workspace
.
onDidCloseTextDocument
(
(
textDocument
)
=>
{
this
.
onDidCloseTextDocumentSub
=
vscode
.
workspace
.
onDidCloseTextDocument
(
textDocument
=>
{
// When a document gets closed delete the cached formatting options.
// This is necessary since the tsserver now closed a project when its
// last file in it closes which drops the stored formatting options
...
...
extensions/typescript-language-features/src/features/languageConfiguration.ts
浏览文件 @
813d3aa3
...
...
@@ -23,25 +23,25 @@ const jsTsLanguageConfiguration: vscode.LanguageConfiguration = {
// e.g. /** | */
beforeText
:
/^
\s
*
\/\*\*(?!\/)([^\*]
|
\*(?!\/))
*$/
,
afterText
:
/^
\s
*
\*\/
$/
,
action
:
{
indentAction
:
vscode
.
IndentAction
.
IndentOutdent
,
appendText
:
'
*
'
}
action
:
{
indentAction
:
vscode
.
IndentAction
.
IndentOutdent
,
appendText
:
'
*
'
}
,
},
{
// e.g. /** ...|
beforeText
:
/^
\s
*
\/\*\*(?!\/)([^\*]
|
\*(?!\/))
*$/
,
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
appendText
:
'
*
'
}
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
appendText
:
'
*
'
}
,
},
{
// e.g. * ...|
beforeText
:
/^
(\t
|
[
])
*
[
]\*([
]([^\*]
|
\*(?!\/))
*
)?
$/
,
oneLineAboveText
:
/^
(\s
*
(\/\*\*
|
\*))
.*/
,
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
appendText
:
'
*
'
}
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
appendText
:
'
*
'
}
,
},
{
// e.g. */|
beforeText
:
/^
(\t
|
[
])
*
[
]\*\/\s
*$/
,
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
removeText
:
1
}
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
removeText
:
1
}
,
},
{
// e.g. *-----*/|
beforeText
:
/^
(\t
|
[
])
*
[
]\*[^/]
*
\*\/\s
*$/
,
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
removeText
:
1
}
action
:
{
indentAction
:
vscode
.
IndentAction
.
None
,
removeText
:
1
}
,
}
]
};
...
...
extensions/typescript-language-features/src/features/quickFix.ts
浏览文件 @
813d3aa3
...
...
@@ -82,7 +82,7 @@ class ApplyFixAllCodeAction implements Command {
type
:
'
file
'
,
args
:
{
file
}
},
fixId
:
tsAction
.
fixId
fixId
:
tsAction
.
fixId
,
};
const
response
=
await
this
.
client
.
execute
(
'
getCombinedCodeFix
'
,
args
,
nulToken
);
...
...
extensions/typescript-language-features/src/features/refactor.ts
浏览文件 @
813d3aa3
...
...
@@ -40,13 +40,13 @@ class ApplyRefactoringCommand implements Command {
}
*/
this
.
telemetryReporter
.
logTelemetry
(
'
refactor.execute
'
,
{
action
:
action
action
:
action
,
});
const
args
:
Proto
.
GetEditsForRefactorRequestArgs
=
{
...
typeConverters
.
Range
.
toFileRangeRequestArgs
(
file
,
range
),
refactor
,
action
action
,
};
const
response
=
await
this
.
client
.
execute
(
'
getEditsForRefactor
'
,
args
,
nulToken
);
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
||
!
response
.
body
.
edits
.
length
)
{
...
...
@@ -94,7 +94,7 @@ class SelectRefactorCommand implements Command {
):
Promise
<
boolean
>
{
const
selected
=
await
vscode
.
window
.
showQuickPick
(
info
.
actions
.
map
((
action
):
vscode
.
QuickPickItem
=>
({
label
:
action
.
name
,
description
:
action
.
description
description
:
action
.
description
,
})));
if
(
!
selected
)
{
return
false
;
...
...
@@ -119,7 +119,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
}
public
static
readonly
metadata
:
vscode
.
CodeActionProviderMetadata
=
{
providedCodeActionKinds
:
[
vscode
.
CodeActionKind
.
Refactor
]
providedCodeActionKinds
:
[
vscode
.
CodeActionKind
.
Refactor
]
,
};
public
async
provideCodeActions
(
...
...
extensions/typescript-language-features/src/features/updatePathsOnRename.ts
浏览文件 @
813d3aa3
...
...
@@ -296,14 +296,14 @@ class UpdateImportsOnFileRenameHandler {
start
:
change
.
start
,
end
:
{
line
:
change
.
end
.
line
,
offset
:
change
.
end
.
offset
-
match
[
1
].
length
}
offset
:
change
.
end
.
offset
-
match
[
1
].
length
,
}
,
};
});
return
{
fileName
:
edit
.
fileName
,
textChanges
textChanges
,
};
}
}
...
...
extensions/typescript-language-features/src/test/jsdocSnippet.test.ts
浏览文件 @
813d3aa3
...
...
@@ -75,4 +75,3 @@ suite('typescript.jsDocSnippet', () => {
].
join
(
'
\n
'
));
});
});
extensions/typescript-language-features/src/tsServer/callbackMap.ts
浏览文件 @
813d3aa3
...
...
@@ -32,8 +32,7 @@ export class CallbackMap<R extends Proto.Response> {
public
add
(
seq
:
number
,
callback
:
CallbackItem
<
ServerResponse
<
R
>
|
undefined
>
,
isAsync
:
boolean
)
{
if
(
isAsync
)
{
this
.
_asyncCallbacks
.
set
(
seq
,
callback
);
}
else
{
}
else
{
this
.
_callbacks
.
set
(
seq
,
callback
);
}
}
...
...
extensions/typescript-language-features/src/tsServer/server.ts
浏览文件 @
813d3aa3
...
...
@@ -60,7 +60,7 @@ export class TypeScriptServerSpawner {
private
getForkOptions
()
{
const
debugPort
=
TypeScriptServerSpawner
.
getDebugPort
();
const
tsServerForkOptions
:
electron
.
I
ForkOptions
=
{
const
tsServerForkOptions
:
electron
.
ForkOptions
=
{
execArgv
:
debugPort
?
[
`--inspect=
${
debugPort
}
`
]
:
[],
};
return
tsServerForkOptions
;
...
...
@@ -72,8 +72,8 @@ export class TypeScriptServerSpawner {
plugins
:
ReadonlyArray
<
TypeScriptServerPlugin
>
,
):
{
args
:
string
[],
cancellationPipeName
:
string
|
undefined
,
tsServerLogFile
:
string
|
undefined
}
{
const
args
:
string
[]
=
[];
let
cancellationPipeName
:
string
|
undefined
=
undefined
;
let
tsServerLogFile
:
string
|
undefined
=
undefined
;
let
cancellationPipeName
:
string
|
undefined
;
let
tsServerLogFile
:
string
|
undefined
;
const
apiVersion
=
currentVersion
.
version
||
API
.
defaultVersion
;
...
...
@@ -298,7 +298,7 @@ export class TypeScriptServer extends Disposable {
public
executeImpl
(
command
:
string
,
args
:
any
,
executeInfo
:
{
isAsync
:
boolean
,
token
?:
vscode
.
CancellationToken
,
expectsResult
:
boolean
,
lowPriority
?:
boolean
}):
Promise
<
any
>
{
const
request
=
this
.
_requestQueue
.
createRequest
(
command
,
args
);
const
requestInfo
:
RequestItem
=
{
request
:
request
,
request
,
expectsResponse
:
executeInfo
.
expectsResult
,
isAsync
:
executeInfo
.
isAsync
,
queueingType
:
getQueueingType
(
command
,
executeInfo
.
lowPriority
)
...
...
extensions/typescript-language-features/src/typescriptService.ts
浏览文件 @
813d3aa3
...
...
@@ -12,7 +12,7 @@ import Logger from './utils/logger';
import
{
TypeScriptServerPlugin
}
from
'
./utils/plugins
'
;
export
class
CancelledResponse
{
readonly
type
:
'
cancelled
'
=
'
cancelled
'
;
public
readonly
type
:
'
cancelled
'
=
'
cancelled
'
;
constructor
(
public
readonly
reason
:
string
...
...
@@ -20,7 +20,7 @@ export class CancelledResponse {
}
export
class
NoContentResponse
{
readonly
type
:
'
noContent
'
=
'
noContent
'
;
public
readonly
type
:
'
noContent
'
=
'
noContent
'
;
}
export
type
ServerResponse
<
T
extends
Proto
.
Response
>
=
T
|
CancelledResponse
|
NoContentResponse
;
...
...
@@ -57,7 +57,6 @@ interface TypeScriptRequestTypes {
'
typeDefinition
'
:
[
Proto
.
FileLocationRequestArgs
,
Proto
.
TypeDefinitionResponse
];
}
export
interface
ITypeScriptServiceClient
{
/**
* Convert a resource (VS Code) to a normalized path (TypeScript).
...
...
extensions/typescript-language-features/src/typescriptServiceClient.ts
浏览文件 @
813d3aa3
...
...
@@ -420,7 +420,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
private
serviceStarted
(
resendModels
:
boolean
):
void
{
const
configureOptions
:
Proto
.
ConfigureRequestArguments
=
{
hostInfo
:
'
vscode
'
hostInfo
:
'
vscode
'
,
};
this
.
executeWithoutWaitingForResponse
(
'
configure
'
,
configureOptions
);
this
.
setCompilerOptionsForInferredProjects
(
this
.
_configuration
);
...
...
@@ -485,7 +485,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
localize
(
'
serverDiedAfterStart
'
,
'
The TypeScript language service died 5 times right after it got started. The service will not be restarted.
'
),
{
title
:
localize
(
'
serverDiedReportIssue
'
,
'
Report Issue
'
),
id
:
MessageAction
.
reportIssue
id
:
MessageAction
.
reportIssue
,
});
/* __GDPR__
"serviceExited" : {
...
...
extensions/typescript-language-features/src/utils/electron.ts
浏览文件 @
813d3aa3
...
...
@@ -38,7 +38,7 @@ function generatePatchedEnv(env: any, modulePath: string): any {
return
newEnv
;
}
export
interface
I
ForkOptions
{
export
interface
ForkOptions
{
readonly
cwd
?:
string
;
readonly
execArgv
?:
string
[];
}
...
...
@@ -46,7 +46,7 @@ export interface IForkOptions {
export
function
fork
(
modulePath
:
string
,
args
:
string
[],
options
:
I
ForkOptions
,
options
:
ForkOptions
,
):
cp
.
ChildProcess
{
const
newEnv
=
generatePatchedEnv
(
process
.
env
,
modulePath
);
return
cp
.
fork
(
modulePath
,
args
,
{
...
...
extensions/typescript-language-features/src/utils/memoize.ts
浏览文件 @
813d3aa3
...
...
@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
export
function
memoize
(
_target
:
any
,
key
:
string
,
descriptor
:
any
)
{
let
fnKey
:
string
|
undefined
=
undefined
;
let
fn
:
Function
|
undefined
=
undefined
;
let
fnKey
:
string
|
undefined
;
let
fn
:
Function
|
undefined
;
if
(
typeof
descriptor
.
value
===
'
function
'
)
{
fnKey
=
'
value
'
;
...
...
extensions/typescript-language-features/src/utils/telemetry.ts
浏览文件 @
813d3aa3
...
...
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
import
VsCodeTelemetryReporter
from
'
vscode-extension-telemetry
'
;
import
{
memoize
}
from
'
./memoize
'
;
interface
I
PackageInfo
{
interface
PackageInfo
{
readonly
name
:
string
;
readonly
version
:
string
;
readonly
aiKey
:
string
;
...
...
@@ -58,7 +58,7 @@ export default class TelemetryReporter {
}
@
memoize
private
get
packageInfo
():
I
PackageInfo
|
null
{
private
get
packageInfo
():
PackageInfo
|
null
{
const
{
packageJSON
}
=
vscode
.
extensions
.
getExtension
(
'
vscode.typescript-language-features
'
)
!
;
if
(
packageJSON
)
{
return
{
...
...
extensions/typescript-language-features/src/utils/tracer.ts
浏览文件 @
813d3aa3
...
...
@@ -10,7 +10,7 @@ import Logger from './logger';
enum
Trace
{
Off
,
Messages
,
Verbose
Verbose
,
}
namespace
Trace
{
...
...
extensions/typescript-language-features/src/utils/tsconfig.ts
浏览文件 @
813d3aa3
...
...
@@ -8,7 +8,6 @@ import * as vscode from 'vscode';
import
*
as
Proto
from
'
../protocol
'
;
import
{
TypeScriptServiceConfiguration
}
from
'
./configuration
'
;
export
function
isImplicitProjectConfigFile
(
configFileName
:
string
)
{
return
configFileName
.
indexOf
(
'
/dev/null/
'
)
===
0
;
}
...
...
extensions/typescript-language-features/src/utils/typeConverters.ts
浏览文件 @
813d3aa3
...
...
@@ -41,7 +41,7 @@ export namespace Position {
export
const
toFileLocationRequestArgs
=
(
file
:
string
,
position
:
vscode
.
Position
):
Proto
.
FileLocationRequestArgs
=>
({
file
,
line
:
position
.
line
+
1
,
offset
:
position
.
character
+
1
offset
:
position
.
character
+
1
,
});
}
...
...
extensions/typescript-language-features/src/utils/versionPicker.ts
浏览文件 @
813d3aa3
...
...
@@ -19,7 +19,7 @@ interface MyQuickPickItem extends vscode.QuickPickItem {
enum
MessageAction
{
useLocal
,
useBundled
,
learnMore
learnMore
,
}
export
class
TypeScriptVersionPicker
{
...
...
@@ -61,7 +61,7 @@ export class TypeScriptVersionPicker {
:
''
)
+
localize
(
'
useVSCodeVersionOption
'
,
'
Use VS Code
\'
s Version
'
),
description
:
shippedVersion
.
versionString
,
detail
:
shippedVersion
.
pathLabel
,
id
:
MessageAction
.
useBundled
id
:
MessageAction
.
useBundled
,
});
for
(
const
version
of
this
.
versionProvider
.
localVersions
)
{
...
...
@@ -72,7 +72,7 @@ export class TypeScriptVersionPicker {
description
:
version
.
versionString
,
detail
:
version
.
pathLabel
,
id
:
MessageAction
.
useLocal
,
version
:
version
version
});
}
...
...
@@ -86,7 +86,7 @@ export class TypeScriptVersionPicker {
placeHolder
:
localize
(
'
selectTsVersion
'
,
'
Select the TypeScript version used for JavaScript and TypeScript language features
'
),
ignoreFocusOut
:
firstRun
ignoreFocusOut
:
firstRun
,
});
if
(
!
selected
)
{
...
...
@@ -112,7 +112,6 @@ export class TypeScriptVersionPicker {
this
.
_currentVersion
=
shippedVersion
;
return
{
oldVersion
:
previousVersion
,
newVersion
:
shippedVersion
};
case
MessageAction
.
learnMore
:
vscode
.
commands
.
executeCommand
(
'
vscode.open
'
,
vscode
.
Uri
.
parse
(
'
https://go.microsoft.com/fwlink/?linkid=839919
'
));
return
{
oldVersion
:
this
.
currentVersion
};
...
...
extensions/typescript-language-features/src/utils/versionProvider.ts
浏览文件 @
813d3aa3
...
...
@@ -87,7 +87,6 @@ export class TypeScriptVersion {
}
}
export
class
TypeScriptVersionProvider
{
private
readonly
relativePathResolver
:
RelativeWorkspacePathResolver
=
new
RelativeWorkspacePathResolver
();
...
...
extensions/typescript-language-features/src/utils/versionStatus.ts
浏览文件 @
813d3aa3
...
...
@@ -18,7 +18,7 @@ export default class VersionStatus {
this
.
_onChangeEditorSub
=
vscode
.
window
.
onDidChangeActiveTextEditor
(
this
.
showHideStatus
,
this
);
}
dispose
()
{
public
dispose
()
{
this
.
_versionBarEntry
.
dispose
();
this
.
_onChangeEditorSub
.
dispose
();
}
...
...
extensions/typescript-language-features/src/utils/wireProtocol.ts
浏览文件 @
813d3aa3
...
...
@@ -7,29 +7,29 @@ import * as stream from 'stream';
import
*
as
vscode
from
'
vscode
'
;
import
{
Disposable
}
from
'
./dispose
'
;
const
D
efaultSize
:
number
=
8192
;
const
C
ontentLength
:
string
=
'
Content-Length:
'
;
const
ContentLengthSize
:
number
=
Buffer
.
byteLength
(
C
ontentLength
,
'
utf8
'
);
const
B
lank
:
number
=
Buffer
.
from
(
'
'
,
'
utf8
'
)[
0
];
const
B
ackslashR
:
number
=
Buffer
.
from
(
'
\r
'
,
'
utf8
'
)[
0
];
const
B
ackslashN
:
number
=
Buffer
.
from
(
'
\n
'
,
'
utf8
'
)[
0
];
const
d
efaultSize
:
number
=
8192
;
const
c
ontentLength
:
string
=
'
Content-Length:
'
;
const
contentLengthSize
:
number
=
Buffer
.
byteLength
(
c
ontentLength
,
'
utf8
'
);
const
b
lank
:
number
=
Buffer
.
from
(
'
'
,
'
utf8
'
)[
0
];
const
b
ackslashR
:
number
=
Buffer
.
from
(
'
\r
'
,
'
utf8
'
)[
0
];
const
b
ackslashN
:
number
=
Buffer
.
from
(
'
\n
'
,
'
utf8
'
)[
0
];
class
ProtocolBuffer
{
private
index
:
number
=
0
;
private
buffer
:
Buffer
=
Buffer
.
allocUnsafe
(
D
efaultSize
);
private
buffer
:
Buffer
=
Buffer
.
allocUnsafe
(
d
efaultSize
);
public
append
(
data
:
string
|
Buffer
):
void
{
let
toAppend
:
Buffer
|
null
=
null
;
if
(
Buffer
.
isBuffer
(
data
))
{
toAppend
=
<
Buffer
>
data
;
toAppend
=
data
;
}
else
{
toAppend
=
Buffer
.
from
(
<
string
>
data
,
'
utf8
'
);
toAppend
=
Buffer
.
from
(
data
,
'
utf8
'
);
}
if
(
this
.
buffer
.
length
-
this
.
index
>=
toAppend
.
length
)
{
toAppend
.
copy
(
this
.
buffer
,
this
.
index
,
0
,
toAppend
.
length
);
}
else
{
let
newSize
=
(
Math
.
ceil
((
this
.
index
+
toAppend
.
length
)
/
DefaultSize
)
+
1
)
*
D
efaultSize
;
let
newSize
=
(
Math
.
ceil
((
this
.
index
+
toAppend
.
length
)
/
defaultSize
)
+
1
)
*
d
efaultSize
;
if
(
this
.
index
===
0
)
{
this
.
buffer
=
Buffer
.
allocUnsafe
(
newSize
);
toAppend
.
copy
(
this
.
buffer
,
0
,
0
,
toAppend
.
length
);
...
...
@@ -44,18 +44,18 @@ class ProtocolBuffer {
let
result
=
-
1
;
let
current
=
0
;
// we are utf8 encoding...
while
(
current
<
this
.
index
&&
(
this
.
buffer
[
current
]
===
Blank
||
this
.
buffer
[
current
]
===
BackslashR
||
this
.
buffer
[
current
]
===
B
ackslashN
))
{
while
(
current
<
this
.
index
&&
(
this
.
buffer
[
current
]
===
blank
||
this
.
buffer
[
current
]
===
backslashR
||
this
.
buffer
[
current
]
===
b
ackslashN
))
{
current
++
;
}
if
(
this
.
index
<
current
+
C
ontentLengthSize
)
{
if
(
this
.
index
<
current
+
c
ontentLengthSize
)
{
return
result
;
}
current
+=
C
ontentLengthSize
;
current
+=
c
ontentLengthSize
;
let
start
=
current
;
while
(
current
<
this
.
index
&&
this
.
buffer
[
current
]
!==
B
ackslashR
)
{
while
(
current
<
this
.
index
&&
this
.
buffer
[
current
]
!==
b
ackslashR
)
{
current
++
;
}
if
(
current
+
3
>=
this
.
index
||
this
.
buffer
[
current
+
1
]
!==
BackslashN
||
this
.
buffer
[
current
+
2
]
!==
BackslashR
||
this
.
buffer
[
current
+
3
]
!==
B
ackslashN
)
{
if
(
current
+
3
>=
this
.
index
||
this
.
buffer
[
current
+
1
]
!==
backslashN
||
this
.
buffer
[
current
+
2
]
!==
backslashR
||
this
.
buffer
[
current
+
3
]
!==
b
ackslashN
)
{
return
result
;
}
let
data
=
this
.
buffer
.
toString
(
'
utf8
'
,
start
,
current
);
...
...
@@ -71,7 +71,7 @@ class ProtocolBuffer {
}
let
result
=
this
.
buffer
.
toString
(
'
utf8
'
,
0
,
length
);
let
sourceStart
=
length
;
while
(
sourceStart
<
this
.
index
&&
(
this
.
buffer
[
sourceStart
]
===
BackslashR
||
this
.
buffer
[
sourceStart
]
===
B
ackslashN
))
{
while
(
sourceStart
<
this
.
index
&&
(
this
.
buffer
[
sourceStart
]
===
backslashR
||
this
.
buffer
[
sourceStart
]
===
b
ackslashN
))
{
sourceStart
++
;
}
this
.
buffer
.
copy
(
this
.
buffer
,
0
,
sourceStart
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录