Ensure range for string literal references are within the quotes to ensure rename is successful

This commit is contained in:
Mohamed Hegazy
2014-08-22 22:07:45 -07:00
parent c741e26031
commit 8fcc8b26ba
4 changed files with 37 additions and 2 deletions

View File

@@ -2466,8 +2466,8 @@ module ts {
function getReferenceEntry(node: Node): ReferenceEntry {
return {
fileName: node.getSourceFile().filename,
minChar: node.getStart(),
limChar: node.getEnd(),
minChar: node.kind === SyntaxKind.StringLiteral ? node.getStart() + 1 : node.getStart(),
limChar: node.kind === SyntaxKind.StringLiteral ? node.getEnd() - 1 : node.getEnd(),
isWriteAccess: isWriteAccess(node)
};
}