mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
parent
356622c8e9
commit
dbcb6dc01e
@ -490,6 +490,7 @@ module ts {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
case SyntaxKind.TemplateExpression:
|
||||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
case SyntaxKind.OmittedExpression:
|
||||
return true;
|
||||
case SyntaxKind.QualifiedName:
|
||||
@ -502,7 +503,6 @@ module ts {
|
||||
// fall through
|
||||
case SyntaxKind.NumericLiteral:
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
var parent = node.parent;
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
@ -531,6 +531,8 @@ module ts {
|
||||
(<ForInStatement>parent).expression === node;
|
||||
case SyntaxKind.TypeAssertion:
|
||||
return node === (<TypeAssertion>parent).operand;
|
||||
case SyntaxKind.TemplateSpan:
|
||||
return node === (<TemplateSpan>parent).expression;
|
||||
default:
|
||||
if (isExpression(parent)) {
|
||||
return true;
|
||||
|
||||
12
tests/cases/fourslash/findAllRefsInsideTemplates1.ts
Normal file
12
tests/cases/fourslash/findAllRefsInsideTemplates1.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////var [|x|] = 10;
|
||||
////var y = `${ [|x|] } ${ [|x|] }`
|
||||
|
||||
test.ranges().forEach(targetRange => {
|
||||
goTo.position(targetRange.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
12
tests/cases/fourslash/findAllRefsInsideTemplates2.ts
Normal file
12
tests/cases/fourslash/findAllRefsInsideTemplates2.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function [|f|](...rest: any[]) { }
|
||||
////[|f|] `${ [|f|] } ${ [|f|] }`
|
||||
|
||||
test.ranges().forEach(targetRange => {
|
||||
goTo.position(targetRange.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user