Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feat#Provide a quickfix for non-exported types #37980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat#Provide a quickfix for non-exported types #37980
Changes from all commits
acba122
3f17337
2b39b01
3a0b235
7f7ab7e
4a0b533
75cc909
83d07eb
223d896
e4f120b
b683617
afb48c9
983b0bf
2b4cbd5
e03ee01
3ee7a66
9f7dcd9
ed01bbf
09db982
2289ea0
5a68eb2
85d5b4a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to get the last
export { }
and add the missing export there, so I can't return immediately.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're suing
pos
, that means you're including leading trivia.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is with the
start + 1
? I don't understand.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to add an
export
identifier in front of non-exported type, you can see thecodeFixImportNonExportedMember1.ts
, an export added beforefunction bar()
, the start there is the position of line break, so need to +1 for start.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem you are running into is more about using the
pos
(a.k.a. the "full start") instead of the start after the trivia (what you'd get when you callgetStart(sourceFile)
).As far as I can tell, a test like
will likely end up with the export inside of the comment..
What happens when you just use
insertExportModifier
instead ofinsertExportModifierAt
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just don't quite know if you need this, but I don't understand the
start + 1
thing yet.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to add an export identifier in front of non-exported type, you can see the codeFixImportNonExportedMember1.ts, an export added before function bar(), the start there is the position of line break, so need to +1 for start.