mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-11 16:38:46 -05:00
PR comments
I plan to fix the missing comment issue when I add the convert-jsdoc-types-to-typescript-types refactoring. Or at least work around it.
This commit is contained in:
@@ -152,7 +152,9 @@ namespace ts.textChanges {
|
||||
return position === Position.Start ? start : fullStart;
|
||||
}
|
||||
// get start position of the line following the line that contains fullstart position
|
||||
let adjustedStartPosition = getStartPositionOfLine(getLineOfLocalPosition(sourceFile, fullStartLine) + (fullStart > 0 ? 1 : 0), sourceFile);
|
||||
// (but only if the fullstart isn't the very beginning of the file)
|
||||
const nextLineStart = fullStart > 0 ? 1 : 0;
|
||||
let adjustedStartPosition = getStartPositionOfLine(getLineOfLocalPosition(sourceFile, fullStartLine) + nextLineStart, sourceFile);
|
||||
// skip whitespaces/newlines
|
||||
adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition);
|
||||
return getStartPositionOfLine(getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
////// newFunction
|
||||
/////*start*/1 + 1/*end*/;
|
||||
|
||||
// NOTE: '// newFunction' should be included, but due to incorrect handling of trivia,
|
||||
// it's omitted right now.
|
||||
goTo.select('start', 'end')
|
||||
edit.applyRefactor({
|
||||
refactorName: "Extract Method",
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
//// }
|
||||
|
||||
verify.applicableRefactorAvailableAtMarker('1');
|
||||
// NOTE: '// Comment' should be included, but due to incorrect handling of trivia,
|
||||
// it's omitted right now.
|
||||
verify.fileAfterApplyingRefactorAtMarker('1',
|
||||
`class fn {
|
||||
constructor() {
|
||||
|
||||
Reference in New Issue
Block a user