DocumentScript GetScript(string fileName)
        {
            DocumentScript script;
            var            fileNameObj = FileName.Create(fileName);

            if (scripts.TryGetValue(fileNameObj, out script))
            {
                return(script);
            }

            IDocument document = context.GetDocument(fileNameObj);
            var       ctx      = SDRefactoringContext.Create(fileNameObj, document);

            script = new DocumentScript(document, FormattingOptionsFactory.CreateSharpDevelop(), new TextEditorOptions());
            scripts.Add(fileNameObj, script);
            return(script);
        }
Example #2
0
        DocumentScript GetScript(string fileName)
        {
            DocumentScript script;
            var            fileNameObj = FileName.Create(fileName);

            if (scripts.TryGetValue(fileNameObj, out script))
            {
                return(script);
            }

            IDocument document          = context.GetDocument(fileNameObj);
            var       ctx               = SDRefactoringContext.Create(fileNameObj, document);
            var       formattingOptions = CSharpFormattingPolicies.Instance.GetProjectOptions(compilation.GetProject());

            script = new DocumentScript(document, formattingOptions.OptionsContainer.GetEffectiveOptions(), new TextEditorOptions());
            scripts.Add(fileNameObj, script);
            return(script);
        }