Skip to content

Commit fd71eb2

Browse files
authored
fix broken regex on "src/services/completions.ts#getCompletionData" (#37546)
* fix broken regex on src/services/completions.ts#840 * update forslash test breaking changes fourslash test Temporarily retain the before fix code for easy comparison * regex * fourslash test (Temporary code * regex: more restrictive in terms of jsdoc format fourslash test * regex: max indent restriction * achieved goal by partial match strategy (probably * cleanup * apply requested changes * Change to a version with minimal modifications
1 parent 1b7b3eb commit fd71eb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/completions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ namespace ts.Completions {
875875
// * |c|
876876
// */
877877
const lineStart = getLineStartPositionForPosition(position, sourceFile);
878-
if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) {
878+
if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
879879
return { kind: CompletionDataKind.JsDocTag };
880880
}
881881
}

0 commit comments

Comments
 (0)