mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
fix(45687): allow selection to next token (#45695)
This commit is contained in:
@@ -55,7 +55,10 @@ namespace ts.refactor {
|
||||
const token = getTokenAtPosition(file, span.start);
|
||||
const importDecl = considerPartialSpans ? findAncestor(token, isImportDeclaration) : getParentNodeInSpan(token, file, span);
|
||||
if (!importDecl || !isImportDeclaration(importDecl)) return { error: "Selection is not an import declaration." };
|
||||
if (importDecl.getEnd() < span.start + span.length) return undefined;
|
||||
|
||||
const end = span.start + span.length;
|
||||
const nextToken = findNextToken(importDecl, importDecl.parent, file);
|
||||
if (nextToken && end > nextToken.getStart()) return undefined;
|
||||
|
||||
const { importClause } = importDecl;
|
||||
if (!importClause) {
|
||||
|
||||
Reference in New Issue
Block a user