mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
create vfs project
This commit is contained in:
@@ -15,15 +15,12 @@
|
||||
{ "path": "../services" },
|
||||
{ "path": "../jsTyping" },
|
||||
{ "path": "../server" },
|
||||
{ "path": "../typingsInstallerCore" }
|
||||
{ "path": "../typingsInstallerCore" },
|
||||
{ "path": "../vfs" }
|
||||
],
|
||||
|
||||
"files": [
|
||||
"collectionsImpl.ts",
|
||||
"util.ts",
|
||||
"documentsUtil.ts",
|
||||
"vpathUtil.ts",
|
||||
"vfsUtil.ts",
|
||||
"compilerImpl.ts",
|
||||
"evaluatorImpl.ts",
|
||||
"fakesHosts.ts",
|
||||
|
||||
@@ -2,13 +2,19 @@
|
||||
// support the eventual conversion of harness into a modular system.
|
||||
|
||||
namespace documents {
|
||||
export interface HarnessCompilerTestFile {
|
||||
unitName: string;
|
||||
content: string;
|
||||
fileOptions?: any;
|
||||
}
|
||||
|
||||
export class TextDocument {
|
||||
public readonly meta: Map<string, string>;
|
||||
public readonly file: string;
|
||||
public readonly text: string;
|
||||
|
||||
private _lineStarts: readonly number[] | undefined;
|
||||
private _testFile: Harness.Compiler.TestFile | undefined;
|
||||
private _testFile: HarnessCompilerTestFile | undefined;
|
||||
|
||||
constructor(file: string, text: string, meta?: Map<string, string>) {
|
||||
this.file = file;
|
||||
@@ -20,7 +26,7 @@ namespace documents {
|
||||
return this._lineStarts || (this._lineStarts = ts.computeLineStarts(this.text));
|
||||
}
|
||||
|
||||
public static fromTestFile(file: Harness.Compiler.TestFile) {
|
||||
public static fromTestFile(file: HarnessCompilerTestFile) {
|
||||
return new TextDocument(
|
||||
file.unitName,
|
||||
file.content,
|
||||
@@ -184,4 +190,4 @@ namespace documents {
|
||||
return vlq;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"extends": "../tsconfig-base",
|
||||
"compilerOptions": {
|
||||
"outFile": "../../built/local/vfs.js",
|
||||
"types": [
|
||||
"node", "mocha", "chai"
|
||||
],
|
||||
"lib": [
|
||||
"es6",
|
||||
"scripthost"
|
||||
]
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../compiler" },
|
||||
{ "path": "../jsTyping" },
|
||||
{ "path": "../services" }
|
||||
],
|
||||
|
||||
"files": [
|
||||
"collectionsImpl.ts",
|
||||
"documentsUtil.ts",
|
||||
"vpathUtil.ts",
|
||||
"vfsUtil.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user