Exemplo n.º 1
0
        ParseInformation ParseTypeScriptFile(FileName fileName, ITextSource fileContent, TypeScriptProject project)
        {
            var parser = new TypeScriptParser(new LanguageServiceNullLogger());
            List <TypeScriptFile> files = project.GetTypeScriptFiles().ToList();

            return(parser.Parse(fileName, fileContent, project, files));
        }
        ParseInformation ParseTypeScriptFile(string fileName, ITextBuffer fileContent, TypeScriptProject project)
        {
            var parser                  = new TypeScriptParser(new LanguageServiceNullLogger());
            var projectContent          = new TypeScriptProjectContent(project);
            List <TypeScriptFile> files = project.GetTypeScriptFiles().ToList();
            ICompilationUnit      unit  = parser.Parse(projectContent, fileName, fileContent, files);

            return(new ParseInformation(unit));
        }
Exemplo n.º 3
0
        public void Parse(string text, string fileName = @"d:\projects\MyProject\test.ts")
        {
            ProjectContent = MockRepository.GenerateStub<IProjectContent>();
            var textBuffer = new StringTextBuffer(text);

            var scriptLoader = new ParseTestScriptLoader();
            var logger = new LanguageServiceLogger();
            ITypeScriptContextFactory contextFactory = MockRepository.GenerateStub<ITypeScriptContextFactory>();
            contextFactory
                .Stub(f => f.CreateContext())
                .Return(new TypeScriptContext(scriptLoader, logger));

            var parser = new TypeScriptParser(contextFactory);
            CompilationUnit = parser.Parse(ProjectContent, fileName, textBuffer);
        }
Exemplo n.º 4
0
		public void Parse(string text, string fileName = @"d:\projects\MyProject\test.ts")
		{
			Project = MockRepository.GenerateStub<IProject>();
			var fileContent = new TextDocument(text);
			
			var scriptLoader = new ParseTestScriptLoader();
			var logger = new LanguageServiceLogger();
			ITypeScriptContextFactory contextFactory = MockRepository.GenerateStub<ITypeScriptContextFactory>();
			contextFactory
				.Stub(f => f.CreateContext())
				.Return(new TypeScriptContext(javaScriptContext, scriptLoader, logger));
			
			var parser = new TypeScriptParser(contextFactory);
			ParseInfo = parser.Parse(new FileName(fileName), fileContent, null, new TypeScriptFile[0]);
		}
		ParseInformation ParseTypeScriptFile(FileName fileName, ITextSource fileContent, TypeScriptProject project)
		{
			var parser = new TypeScriptParser(new LanguageServiceNullLogger());
			List<TypeScriptFile> files = project.GetTypeScriptFiles().ToList();
			return parser.Parse(fileName, fileContent, project, files);
		}
 ParseInformation ParseTypeScriptFile(string fileName, ITextBuffer fileContent, TypeScriptProject project)
 {
     var parser = new TypeScriptParser(new LanguageServiceNullLogger());
     var projectContent = new TypeScriptProjectContent(project);
     List<TypeScriptFile> files = project.GetTypeScriptFiles().ToList();
     ICompilationUnit unit = parser.Parse(projectContent, fileName, fileContent, files);
     return new ParseInformation(unit);
 }
 ParseInformation ParseTypeScriptFile(string fileName, ITextBuffer fileContent)
 {
     var parser = new TypeScriptParser(new LanguageServiceNullLogger());
     var projectContent = new DefaultProjectContent();
     ICompilationUnit unit = parser.Parse(projectContent, fileName, fileContent);
     return new ParseInformation(unit);
 }