mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Merge pull request #427 from sparecycles/fix/reference-static-regex
fix: /// <reference path="..." static='true' />
This commit is contained in:
commit
2a106bf923
@ -49,7 +49,7 @@ module TypeScript {
|
||||
return isNoDefaultLibRegex.exec(comment);
|
||||
}
|
||||
|
||||
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\2\s*)*\/>/;
|
||||
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\5\s*)*\/>/;
|
||||
|
||||
function getFileReferenceFromReferencePath(fileName: string, text: ISimpleText, position: number, comment: string, diagnostics: Diagnostic[]): IFileReference {
|
||||
// First, just see if they've written: /// <reference\s+
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"scenario": "Reference-path-static",
|
||||
"projectRoot": "tests/cases/projects/reference-path-static",
|
||||
"inputFiles": [
|
||||
"test.ts"
|
||||
],
|
||||
"resolvedInputFiles": [
|
||||
"test.ts",
|
||||
"lib.ts",
|
||||
"lib.d.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"lib.js",
|
||||
"test.js"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"scenario": "Reference-path-static",
|
||||
"projectRoot": "tests/cases/projects/reference-path-static",
|
||||
"inputFiles": [
|
||||
"test.ts"
|
||||
],
|
||||
"resolvedInputFiles": [
|
||||
"test.ts",
|
||||
"lib.ts",
|
||||
"lib.d.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"lib.js",
|
||||
"test.js"
|
||||
]
|
||||
}
|
||||
7
tests/cases/project/referencePathStatic.json
Normal file
7
tests/cases/project/referencePathStatic.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"scenario": "Reference-path-static",
|
||||
"projectRoot": "tests/cases/projects/reference-path-static",
|
||||
"inputFiles": [
|
||||
"test.ts"
|
||||
]
|
||||
}
|
||||
3
tests/cases/projects/reference-path-static/lib.ts
Normal file
3
tests/cases/projects/reference-path-static/lib.ts
Normal file
@ -0,0 +1,3 @@
|
||||
module Lib {
|
||||
export class LibType {}
|
||||
}
|
||||
3
tests/cases/projects/reference-path-static/test.ts
Normal file
3
tests/cases/projects/reference-path-static/test.ts
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference path="lib.ts" static='true' />
|
||||
|
||||
var libType: Lib.LibType;
|
||||
Loading…
x
Reference in New Issue
Block a user