Exemple #1
0
        protected override void DoParseStep()
        {
            if (document == null)
            {
                return;
            }
            var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(document);

            projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);
        }
        public CSharpCodeCompletionContext(IDocument document, int offset, IProjectContent projectContent)
        {
            this.document = new ReadOnlyDocument(document, document.FileName);
            this.offset   = offset;

            var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(this.document);

            this.projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);

            completionContextProvider = new DefaultCompletionContextProvider(this.document, unresolvedFile);

            var compilation = this.projectContent.CreateCompilation();
            var location    = this.document.GetLocation(this.offset);

            typeResolveContextAtCaret = unresolvedFile.GetTypeResolveContext(compilation, location);
        }
 public CSharpCodeFoldingContext(IDocument document)
 {
     this.document = new ReadOnlyDocument(document, document.FileName);
     syntaxTree    = CSharpParsingHelpers.CreateSyntaxTree(this.document);
 }