Created
November 4, 2012 15:44
-
-
Save zakki/4012345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///<reference path='..\typescript\src\harness\harness.ts'/> | |
| ///<reference path='..\typescript\src\harness\baselining.ts'/> | |
| ///<reference path='..\typescript\src\harness\external\json2.ts'/> | |
| ///<reference path='..\typescript\src\compiler\optionsParser.ts'/> | |
| class Dumper { | |
| constructor (public ioHost: IIO) { | |
| } | |
| public dump() { | |
| var outputPath = '_info'; | |
| var opts = new OptionsParser(this.ioHost); | |
| opts.parse(this.ioHost.arguments); | |
| opts.option('out', { | |
| usage: 'Output dir', | |
| type: 'file', | |
| set: (str) => { | |
| outputPath = str; | |
| } | |
| }); | |
| var i; | |
| // Might need to create this | |
| IO.createDirectory(outputPath); | |
| // For each file, get data: | |
| // a) Completion | |
| // b) Type signature | |
| // c) etc... | |
| for (var i = 0; i < opts.unnamed.length; i++) { | |
| var file = opts.unnamed[i]; | |
| var filenameIndex = file.lastIndexOf('\\'); | |
| var filename = filenameIndex >= 0 ? file.substr(filenameIndex) : file; | |
| var scriptText = IO.readFile(file).trim(); | |
| var outputAndCheck = function(nameSuffix: string, process: any) { | |
| var data = process(scriptText); | |
| var stringified = JSON2.stringify(data).trim(); | |
| var baseFilename = filename + '-' + nameSuffix + '.json'; | |
| IO.writeFile(outputPath + '/' + baseFilename, stringified); | |
| } | |
| // Write that data out to a JSON file in the 'local' folder | |
| outputAndCheck('signatures', getIntellisenseSignatureRegions); | |
| outputAndCheck('completions', getIntellisenseCompletionListRegions); | |
| outputAndCheck('definitions', getIntellisenseDefinitionRegions); | |
| outputAndCheck('types', getIntellisenseTypeRegions); | |
| outputAndCheck('members', getIntellisenseMemberListRegions); | |
| } | |
| } | |
| } | |
| var batch = new Dumper(IO); | |
| batch.dump(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BASE=../typescript/ | |
| #compiler source location | |
| CSRC=$(BASE)src/compiler | |
| #compiler services source location | |
| SSRC=$(BASE)src/services | |
| #library source location | |
| LSRC=$(BASE)typings | |
| #test source location | |
| TSRC=$(BASE)test | |
| # harness source location | |
| HSRC=$(BASE)src/harness | |
| # STRC_LOCAL=$(HOST) $(BUILT_LOCAL)/tsc.js -cflowu | |
| # STRC_LKG=$(HOST) $(BIN)/tsc.js -cflowu | |
| STRC_LOCAL=tsc -cflowu | |
| COMPILER_SOURCES_BASE= \ | |
| $(CSRC)/diagnostics.ts \ | |
| $(CSRC)/flags.ts \ | |
| $(CSRC)/nodeTypes.ts \ | |
| $(CSRC)/hashTable.ts \ | |
| $(CSRC)/printContext.ts \ | |
| $(CSRC)/scopeWalk.ts \ | |
| $(CSRC)/typeCollection.ts \ | |
| $(CSRC)/scopeAssignment.ts \ | |
| $(CSRC)/binder.ts \ | |
| $(CSRC)/tokens.ts \ | |
| $(CSRC)/ast.ts \ | |
| $(CSRC)/astWalker.ts \ | |
| $(CSRC)/astPath.ts \ | |
| $(CSRC)/astLogger.ts \ | |
| $(CSRC)/scanner.ts \ | |
| $(CSRC)/parser.ts \ | |
| $(CSRC)/symbolScope.ts \ | |
| $(CSRC)/types.ts \ | |
| $(CSRC)/signatures.ts \ | |
| $(CSRC)/symbols.ts \ | |
| $(CSRC)/errorReporter.ts \ | |
| $(CSRC)/typeFlow.ts \ | |
| $(CSRC)/typeChecker.ts \ | |
| $(CSRC)/base64.ts \ | |
| $(CSRC)/sourceMapping.ts \ | |
| $(CSRC)/emitter.ts \ | |
| $(CSRC)/precompile.ts \ | |
| $(CSRC)/incrementalParser.ts \ | |
| $(CSRC)/pathUtils.ts \ | |
| $(CSRC)/referenceResolution.ts \ | |
| $(CSRC)/typescript.ts | |
| COMPILER_SOURCES=$(COMPILER_SOURCES_BASE) | |
| FRONTEND_SOURCES=$(COMPILER_SOURCES) $(CSRC)/io.ts $(CSRC)/optionsParser.ts $(CSRC)/tsc.ts | |
| SERVICES_SOURCES_BASE= \ | |
| $(SSRC)/es5compat.ts \ | |
| $(SSRC)/formatting/formatting.ts \ | |
| $(SSRC)/formatting/interop.ts \ | |
| $(SSRC)/formatting/formattingContext.ts \ | |
| $(SSRC)/formatting/formattingManager.ts \ | |
| $(SSRC)/formatting/formattingRequestKind.ts \ | |
| $(SSRC)/formatting/formattingTask.ts \ | |
| $(SSRC)/formatting/iformatter.ts \ | |
| $(SSRC)/formatting/ilineIndentationResolver.ts \ | |
| $(SSRC)/formatting/indentationBag.ts \ | |
| $(SSRC)/formatting/indentationEdgeFinder.ts \ | |
| $(SSRC)/formatting/indentationEditInfo.ts \ | |
| $(SSRC)/formatting/indentationInfo.ts \ | |
| $(SSRC)/formatting/indenter.ts \ | |
| $(SSRC)/formatting/matchingBlockFinderTask.ts \ | |
| $(SSRC)/formatting/parseNode.ts \ | |
| $(SSRC)/formatting/parseNodeExtensions.ts \ | |
| $(SSRC)/formatting/parseTree.ts \ | |
| $(SSRC)/formatting/rule.ts \ | |
| $(SSRC)/formatting/ruleAction.ts \ | |
| $(SSRC)/formatting/ruleDescriptor.ts \ | |
| $(SSRC)/formatting/ruleFlag.ts \ | |
| $(SSRC)/formatting/ruleOperation.ts \ | |
| $(SSRC)/formatting/ruleOperationContext.ts \ | |
| $(SSRC)/formatting/rules.ts \ | |
| $(SSRC)/formatting/rulesMap.ts \ | |
| $(SSRC)/formatting/rulesProvider.ts \ | |
| $(SSRC)/formatting/smartIndentManager.ts \ | |
| $(SSRC)/formatting/smartIndentTask.ts \ | |
| $(SSRC)/formatting/statementFinderTask.ts \ | |
| $(SSRC)/formatting/textEditInfo.ts \ | |
| $(SSRC)/formatting/tokenRange.ts \ | |
| $(SSRC)/formatting/tokenSpan.ts \ | |
| $(SSRC)/classifier.ts \ | |
| $(SSRC)/coreServices.ts \ | |
| $(SSRC)/scriptSyntaxAST.ts \ | |
| $(SSRC)/compilerState.ts \ | |
| $(SSRC)/braceMatchingManager.ts \ | |
| $(SSRC)/symbolSet.ts \ | |
| $(SSRC)/symbolTree.ts \ | |
| $(SSRC)/overridesCollector.ts \ | |
| $(SSRC)/languageService.ts \ | |
| $(SSRC)/shims.ts \ | |
| $(SSRC)/typescriptServices.ts | |
| SERVICES_SOURCES= \ | |
| $(COMPILER_SOURCES_BASE) \ | |
| $(SERVICES_SOURCES_BASE) | |
| all: | |
| $(STRC_LOCAL) -noresolve -target es5 $(SERVICES_SOURCES) $(CSRC)/io.ts $(CSRC)/optionsParser.ts $(HSRC)/exec.ts $(HSRC)/diff.ts $(HSRC)/harness.ts $(HSRC)/baselining.ts $(HSRC)/external/json2.ts dumper.ts -out dumper.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment