File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2021,7 +2021,7 @@ module ts {
20212021 var text = sourceFile . text ;
20222022 var width = comment . end - comment . pos ;
20232023 // is single line comment or just /*
2024- if ( width <= 2 || text . charCodeAt ( comment . pos + 1 ) === CharacterCodes . slash ) {
2024+ if ( width <= 2 || text . charCodeAt ( comment . pos + 1 ) === CharacterCodes . slash ) {
20252025 return true ;
20262026 }
20272027 else {
@@ -2484,9 +2484,6 @@ module ts {
24842484 }
24852485
24862486 function isInStringOrRegularExpressionLiteral ( previousToken : Node ) : boolean {
2487- //var token = getTouchingPropertyName(sourceFile, position);
2488-
2489- // || token.kind === SyntaxKind.RegularExpressionLiteral
24902487 if ( previousToken . kind === SyntaxKind . StringLiteral ) {
24912488 // The position has to be either: 1. entirely within the token text, or
24922489 // 2. at the end position, and the string literal is not terminated
@@ -2498,7 +2495,9 @@ module ts {
24982495 else if ( position === end ) {
24992496 var width = end - start ;
25002497 var text = previousToken . getSourceFile ( ) . text ;
2501- return width <= 1 || text . charCodeAt ( start ) !== text . charCodeAt ( end - 1 ) ;
2498+ return width <= 1 ||
2499+ text . charCodeAt ( start ) !== text . charCodeAt ( end - 1 ) ||
2500+ text . charCodeAt ( end - 2 ) === CharacterCodes . backslash ;
25022501 }
25032502 }
25042503 else if ( previousToken . kind === SyntaxKind . RegularExpressionLiteral ) {
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ ////// Outside the function expression
4+ ////declare var f1: (a: number) => void; /*1*/
5+ ////
6+ ////declare var f1: (b: number, b2: /*2*/) => void;
7+
8+ goTo . marker ( "1" ) ;
9+ verify . not . completionListContains ( "a" ) ;
10+
11+ goTo . marker ( "2" ) ;
12+ verify . completionListContains ( "b" ) ;
13+
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ ////// Outside the function expression
4+ ////var x1 = (a: number) => { }/*1*/;
5+ ////
6+ ////var x2 = (b: number) => {/*2*/ };
7+
8+ goTo . marker ( "1" ) ;
9+ verify . not . completionListContains ( "a" ) ;
10+
11+ goTo . marker ( "2" ) ;
12+ verify . completionListContains ( "b" ) ;
You can’t perform that action at this time.
0 commit comments