ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это 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 * as ts from 'typescript';
import { type RawSourceMap, type Mapping, SourceMapConsumer, SourceMapGenerator } from 'source-map';
/**
* Converts native ES private fields (`#foo`) into regular JavaScript properties with short,
* globally unique names (e.g., `$a`, `$b`). This achieves two goals:
*
* 1. **Performance**: Native private fields are slower than regular properties in V8.
* 2. **Mangling**: Short replacement names reduce bundle size.
*
* ## Why not simply strip `#`?
*
* - **Inheritance collision**: If `class B extends A` and both declare `#x`, stripping `#`
* yields `x` on both - collision on child instances.
* - **Public property shadowing**: `class Foo extends Error { static #name = ... }` - stripping
* `#` produces `name` which shadows `Error.name`.
*
* ## Strategy: Globally unique names with `$` prefix
*
* Each (class, privateFieldName) pair gets a unique name from a global counter: `$a`, `$b`, ...
* This guarantees no inheritance collision and no shadowing of public properties.
*
* ## Why this is safe with syntax-only analysis
*
* Native `#` fields are **lexically scoped** to their declaring class body. Every declaration
* and every usage site is syntactically inside the class body. A single AST walk is sufficient
* to find all sites - no cross-file analysis or type checker needed.
*/
// Short name generator: $a, $b, ..., $z, $A, ..., $Z, $aa, $ab, ...
const CHARS =
index
name
name index length name
index Mathindex length
index
name
start
end
newText
Map
start
end
newText
code
classCount
fieldCount
editCount
elapsed
edits TextEdit
code filename ConvertPrivateFieldsResult
t1 Date
code
code classCount fieldCount editCount elapsed Date t1 edits
sourceFile tsfilename code tsScriptTargetESNext tsScriptKind
nameCounter
fieldCount
classCount
edits Edit
classStack ClassScope
sourceFile
editslength
code classCount fieldCount editCount elapsed Date t1 edits
editsa b astart bstart
parts
lastEnd
edit edits
partscodelastEnd editstart
partseditnewText
lastEnd editend
partscodelastEnd
code parts classCount fieldCount fieldCount editCount editslength elapsed Date t1 edits
node tsNode
tsnode tsnode
node
tsnode visit
node tsClassDeclaration tsClassExpression
publicNames
member nodemembers
membername
tsmembername tsmembername
publicNamesmembernametext
tsmembername tsmembernameexpression
publicNamesmembernameexpressiontext
scope ClassScope
member nodemembers
membername tsmembername
name membernametext
scopename
shortName
shortName nameCounter
publicNamesshortName
scopename shortName
fieldCount
scopesize
classCount
walkInClass node
clause nodeheritageClauses
tsclause walkInClass
classStackscope
member nodemembers
tsmember walkInClass
classStack
classNode tsClassDeclaration tsClassExpression
child tsNode
tschild tschild child classNode
child
tschild
childoperatorTokenkind tsSyntaxKindInKeyword
tschildleft
resolved childlefttext
resolved
edits
start childleftsourceFile
end childleft
newText
tschildright walkInClass
tschild
resolved childtext
resolved
start childsourceFile
edits
start
end child
newText start codestart resolved resolved
tschild walkInClass
name
i classStacklength i i
resolved classStackiname
resolved
resolved
ch
ch ch ch ch ch ch ch ch
sourceMapJson RawSourceMap
originalCode
edits TextEdit
RawSourceMap
editslength
sourceMapJson
oldLineStarts originalCode
newLineStarts originalCode edits
n editslength
editStarts n
editEnds n
cumShifts n
cumShift
i i n i
editStartsi editsistart
editEndsi editsiend
cumShift editsinewTextlength editsiend editsistart
cumShiftsi cumShift
oldOff
lo hi n
lo hi
mid lo hi
editStartsmid oldOff
lo mid
hi mid
hi
oldOff
oldOff editEndshi
prevShift hi cumShiftshi
editStartshi prevShift
oldOff cumShiftshi
lineStarts offset line col
lo hi lineStartslength
lo hi
mid lo hi
lineStartsmid offset
lo mid
hi mid
line lo col offset lineStartslo
consumer sourceMapJson
generator file sourceMapJsonfile sourceRoot sourceMapJsonsourceRoot
i i sourceMapJsonsourceslength i
content sourceMapJsonsourcesContenti
content content
generatorsourceMapJsonsourcesi content
consumermapping
oldLine0 mappinggeneratedLine
oldOff oldLine0 oldLineStartslength
oldLineStartsoldLine0
oldLineStartsoldLineStartslength mappinggeneratedColumn
newOff oldOff
newPos newLineStarts newOff
mappingsource mappingoriginalLine mappingoriginalColumn
newMapping Mapping
generated line newPosline column newPoscol
original line mappingoriginalLine column mappingoriginalColumn
source mappingsource
mappingname
newMappingname mappingname
generatornewMapping
generator
generated line newPosline column newPoscol
Mapping
generator
text
starts
pos
nl text pos
nl
startsnl
pos nl
starts
originalCode edits TextEdit
starts
oldPos
newPos
edit edits
from oldPos
nl originalCode from
nl nl editstart
startsnewPos nl oldPos
from nl
newPos editstart oldPos
replFrom
nl editnewText replFrom
nl
startsnewPos nl
replFrom nl
newPos editnewTextlength
oldPos editend
from oldPos
nl originalCode from
nl
startsnewPos nl oldPos
from nl
starts