dsherret / dsherret/ts-morph

enum addMember | insertMember

Open
#1,480 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

Version: 21.0.1

while i want to add [insertA,insertB] in EnumA,
the result to be inserted appears in the wrong line

EnumDeclaration.insertMember() and EnumDeclaration.addMember() is same results

before:
```ts
export enum EnumA {
//
a,
//
b,
//
c,
d,
e,
f,
}
```

after:
```ts
export enum EnumA {
//
a,
//
b,
//
c,
insertA,
insertB,
d,
e,
f,
}
```
i guess the problem is three line comments

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the EnumDeclaration.insertMember() and addMember() behavior with the enum shown in the issue, including the three line comments. Read the enum member insertion implementation and its related tests, then verify that inserting insertA and insertB places them between c and d without disturbing the comments.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.