Skip to content

Commit

Permalink
Added in directory for Dyllon's convenience. (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaymaker1907 authored and Sheyne committed Mar 29, 2017
1 parent a726e53 commit 7650339
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/plugin-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function nullPromise<T>(obj: T, name: string): Promise<T> {
}

class InterpreterInfo {
constructor(readonly interp: File, readonly pluginKind: string[], readonly description: string) {
constructor(readonly interp: File, readonly pluginKind: string[], readonly description: string, readonly directory: Directory) {
}
}

Expand All @@ -45,7 +45,7 @@ function getInterpreterInfo(directory: Directory): Promise<InterpreterInfo> {
})
.then(([pluginName, pluginKind, description]) => {
return nullPromise(fileMap.get(pluginName), pluginName)
.then((pluginFile: File) => new InterpreterInfo(pluginFile, pluginKind, description));
.then((pluginFile: File) => new InterpreterInfo(pluginFile, pluginKind, description, directory));
});
});
});
Expand Down Expand Up @@ -82,7 +82,7 @@ function loadPlugin(pluginInfo: InterpreterInfo, fileService: FileService): Prom
throw Error("failed to emit");
}
const compInfo = new CompilationResult(script, results);
return new Plugin(program, compInfo, pluginInfo.pluginKind, pluginInfo.description);
return new Plugin(program, compInfo, pluginInfo.pluginKind, pluginInfo.description, pluginInfo.directory);
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference path="../typings/modules/uuid/index.d.ts" />
import * as ts from "typescript";
import { Directory } from "./files";
import {
Type,
CoreElementKind,
Expand Down Expand Up @@ -144,7 +145,7 @@ export class CompilationResult {
export class Plugin {
public typeEnvironment: PluginTypeEnvironment;

constructor(program: ts.Program, readonly results: CompilationResult, readonly pluginKind: string[], readonly description: string) {
constructor(program: ts.Program, readonly results: CompilationResult, readonly pluginKind: string[], readonly description: string, readonly directory: Directory) {
this.typeEnvironment = new PluginTypeEnvironment(program);
}

Expand Down

0 comments on commit 7650339

Please sign in to comment.