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
This commit is contained in:
jeffy-g 2020-05-12 05:02:20 +09:00 committed by GitHub
parent 1b7b3eb0f7
commit fd71eb2c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -875,7 +875,7 @@ namespace ts.Completions {
// * |c|
// */
const lineStart = getLineStartPositionForPosition(position, sourceFile);
if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) {
if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {
return { kind: CompletionDataKind.JsDocTag };
}
}