Skip to content

Commit af833aa

Browse files
author
Arthur Ozga
committed
provide completions only in the correct bounds
1 parent 4a497fb commit af833aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/services/completions.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,9 +1698,15 @@ namespace ts.Completions {
16981698
* Matches a triple slash reference directive with an incomplete string literal for its path. Used
16991699
* to determine if the caret is currently within the string literal and capture the literal fragment
17001700
* for completions.
1701-
* For example, this matches /// <reference path="fragment
1701+
* For example, this matches
1702+
*
1703+
* /// <reference path="fragment
1704+
*
1705+
* but not
1706+
*
1707+
* /// <reference path="fragment"
17021708
*/
1703-
const tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3]*)$/;
1709+
const tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
17041710

17051711
interface VisibleModuleInfo {
17061712
moduleName: string;

0 commit comments

Comments
 (0)