Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/import{PromptElement,PromptElementProps,PromptPiece,PromptSizing,SystemMessage,UserMessage}from'@vscode/prompt-tsx';importtype*as vscode from'vscode';import{TextDocumentSnapshot}from'../../../platform/editing/common/textDocumentSnapshot';import{IEndpointProvider}from'../../../platform/endpoint/common/endpointProvider';import{ getLanguage }from'../../../util/common/languages'
range vscode
defAtPositionState
defAroundCursorState
_defAtPos
_defAroundCursor
props
@ instaService
@ endpointProvider
props
range
instaService position range
override sizing progress vscodevscode vscode token vscode
range
defState
isDefinitionBeingRenamed defState defStatedef def
isDefinitionBeingRenamed
endpointInfo
documentContext
fileIndentInfo
language
wholeRange range
selection range range
documentContext endpointInfo
state
defAtPositionState defState
defAroundCursorState sizing
state
override state sizing
range
symbolName range
prefix symbolName
instructionToKeepPrefix prefix
renderedDef state sizing
renderedDefAroundCursor state state sizing
instructionToKeepPrefixrenderedDefAroundCursorrenderedDef renderedDefinstructionToKeepPrefix
identifier
prefix identifier
prefix
/** Range corresponding to the symbol that's being renamed */
:
.
Range
;
}
>
;
type
State
=
{
:
DefinitionAtPositionState
;
:
DefinitionAroundCursorState
|
undefined
;
}
;
export
class
RenameSuggestionsPrompt
extends
PromptElement<Props, State>
{
private
readonly
:
DefinitionAtPosition
;
private
:
DefinitionAroundCursor
|
undefined
;
constructor
(
:
Props
,
IInstantiationService
private
readonly
:
IInstantiationService
,
IEndpointProvider
private
readonly
:
IEndpointProvider
,
)
{
super
(
)
;
const
{
document
,
}
=
this
.
props
;
this
.
_defAtPos
=
.
createInstance
(
new
SyncDescriptor
(
DefinitionAtPosition
,
[
{
document
,
:
.
start
}
]
)
)
;
}
async
prepare
(
:
PromptSizing
,
?
:
.
Progress
<
.
ChatResponseProgressPart
|
.
ChatResponseReferencePart
>
|
undefined
,
?
:
.
CancellationToken
|
undefined
)
:
Promise
<
State
>
{
const
{
document
,
}
=
this
.
props
;
const
=
await
this
.
_defAtPos
.
prepare
(
)
;
const
=
.
k
===
'found'
&&
.
definitions
.
some
(
=>
.
excerptRange
.
contains
(
this
.
props
.
range
)
)
;
if
(
!
)
{
const
=
await
this
.
endpointProvider
.
getChatEndpoint
(
'copilot-utility-small'
)
;
const
:
IDocumentContext
=
{
document
,
:
undefined
,
:
getLanguage
(
document
.
languageId
)
,
:
,
:
new
Selection
(
.
start
,
.
end
)
,
}
;
this
.
_defAroundCursor
=
this
.
instaService
.
createInstance
(
DefinitionAroundCursor
,
{
,
}
)
;
}
const
:
State
=
{
:
,
:
this
.
_defAroundCursor
?
await
this
.
_defAroundCursor
.
prepare
(
)
:
undefined
,
}
;
return
;
}
render
(
:
State
,
:
PromptSizing
)
:
PromptPiece
<
any
,
any
>
|
undefined
{
const
{
document
,
}
=
this
.
props
;
const
=
document
.
getText
(
)
;
const
=
extractIdentifierPrefix
(
)
;
const
=
?
` keeping prefix '${prefix}'`
:
''
;
const
=
this
.
_defAtPos
.
render
(
.
defAtPositionState
,
)
;
const
=
.
defAroundCursorState
!==
undefined
&&
this
.
_defAroundCursor
?.
render
(
.
defAroundCursorState
,
)
;
return
(
<>
<SystemMessage>
You are a distinguished software engineer.
<br/>
<LegacySafetyRules/>
You must reply with a JSON array of strings of at least four new names, e.g., `["first", "second", "third", "fourth"]`.
<br/>
You must respect existing naming conventions
{
}
.
</SystemMessage>
{
}
<UserMessage>
{
!==
undefined
&&
<>
{
}
<br/>
</>
}
Think of the purpose of `{symbolName}` in the given code. Think of several names that reflect what `{symbolName}` is and what it does
{
}
. Follow existing naming conventions. Reply with a JSON array of strings of at least four new names for `{symbolName}`.
</UserMessage>
</>
)
;
}
}
/**
* Extracts the prefix of an identifier. The prefix is defined as the leading sequence of dots, dollar signs, and underscores.
*
* @param identifier - The identifier to extract the prefix from.
* @returns The prefix of the identifier, or undefined if no prefix is found.
*/