mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Address code review comments
This commit is contained in:
parent
b6f4aa9da9
commit
962c4de875
@ -2021,7 +2021,7 @@ module ts {
|
||||
var text = sourceFile.text;
|
||||
var width = comment.end - comment.pos;
|
||||
// is single line comment or just /*
|
||||
if (width <=2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) {
|
||||
if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@ -2484,9 +2484,6 @@ module ts {
|
||||
}
|
||||
|
||||
function isInStringOrRegularExpressionLiteral(previousToken: Node): boolean {
|
||||
//var token = getTouchingPropertyName(sourceFile, position);
|
||||
|
||||
// || token.kind === SyntaxKind.RegularExpressionLiteral
|
||||
if (previousToken.kind === SyntaxKind.StringLiteral) {
|
||||
// The position has to be either: 1. entirely within the token text, or
|
||||
// 2. at the end position, and the string literal is not terminated
|
||||
@ -2498,7 +2495,9 @@ module ts {
|
||||
else if (position === end) {
|
||||
var width = end - start;
|
||||
var text = previousToken.getSourceFile().text;
|
||||
return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1);
|
||||
return width <= 1 ||
|
||||
text.charCodeAt(start) !== text.charCodeAt(end - 1) ||
|
||||
text.charCodeAt(end - 2) === CharacterCodes.backslash;
|
||||
}
|
||||
}
|
||||
else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) {
|
||||
|
||||
13
tests/cases/fourslash/completionListAfterFunction2.ts
Normal file
13
tests/cases/fourslash/completionListAfterFunction2.ts
Normal file
@ -0,0 +1,13 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////// Outside the function expression
|
||||
////declare var f1: (a: number) => void; /*1*/
|
||||
////
|
||||
////declare var f1: (b: number, b2: /*2*/) => void;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.not.completionListContains("a");
|
||||
|
||||
goTo.marker("2");
|
||||
verify.completionListContains("b");
|
||||
|
||||
12
tests/cases/fourslash/completionListAfterFunction3.ts
Normal file
12
tests/cases/fourslash/completionListAfterFunction3.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////// Outside the function expression
|
||||
////var x1 = (a: number) => { }/*1*/;
|
||||
////
|
||||
////var x2 = (b: number) => {/*2*/ };
|
||||
|
||||
goTo.marker("1");
|
||||
verify.not.completionListContains("a");
|
||||
|
||||
goTo.marker("2");
|
||||
verify.completionListContains("b");
|
||||
Loading…
x
Reference in New Issue
Block a user