Skip to content

Commit 2a106bf

Browse files
committed
Merge pull request #427 from sparecycles/fix/reference-static-regex
fix: /// <reference path="..." static='true' />
2 parents bc61807 + 785b80f commit 2a106bf

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
lines changed

src/services/compiler/precompile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module TypeScript {
4949
return isNoDefaultLibRegex.exec(comment);
5050
}
5151

52-
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\2\s*)*\/>/;
52+
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\5\s*)*\/>/;
5353

5454
function getFileReferenceFromReferencePath(fileName: string, text: ISimpleText, position: number, comment: string, diagnostics: Diagnostic[]): IFileReference {
5555
// First, just see if they've written: /// <reference\s+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"scenario": "Reference-path-static",
3+
"projectRoot": "tests/cases/projects/reference-path-static",
4+
"inputFiles": [
5+
"test.ts"
6+
],
7+
"resolvedInputFiles": [
8+
"test.ts",
9+
"lib.ts",
10+
"lib.d.ts"
11+
],
12+
"emittedFiles": [
13+
"lib.js",
14+
"test.js"
15+
]
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"scenario": "Reference-path-static",
3+
"projectRoot": "tests/cases/projects/reference-path-static",
4+
"inputFiles": [
5+
"test.ts"
6+
],
7+
"resolvedInputFiles": [
8+
"test.ts",
9+
"lib.ts",
10+
"lib.d.ts"
11+
],
12+
"emittedFiles": [
13+
"lib.js",
14+
"test.js"
15+
]
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"scenario": "Reference-path-static",
3+
"projectRoot": "tests/cases/projects/reference-path-static",
4+
"inputFiles": [
5+
"test.ts"
6+
]
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Lib {
2+
export class LibType {}
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="lib.ts" static='true' />
2+
3+
var libType: Lib.LibType;

0 commit comments

Comments
 (0)