Ejemplo n.º 1
0
        public PackageIndex(IServiceContainer services, IIntellisenseRSession host, IFunctionIndex functionIndex)
        {
            _host          = host;
            _functionIndex = functionIndex;
            _idleTime      = services.GetService <IIdleTimeService>();

            var interactiveWorkflowProvider = services.GetService <IRInteractiveWorkflowProvider>();
            var workflow = interactiveWorkflowProvider.GetOrCreate();

            var sessionProvider    = workflow.RSessions;
            var interactiveSession = workflow.RSession;

            interactiveSession.Connected         += OnSessionConnected;
            interactiveSession.PackagesInstalled += OnPackagesChanged;
            interactiveSession.PackagesRemoved   += OnPackagesChanged;

            sessionProvider.BrokerStateChanged += OnBrokerStateChanged;

            if (interactiveSession.IsHostRunning)
            {
                BuildIndexAsync().DoNotWait();
            }

            _disposableBag
            .Add(() => interactiveSession.PackagesInstalled -= OnPackagesChanged)
            .Add(() => interactiveSession.PackagesRemoved   -= OnPackagesChanged)
            .Add(() => interactiveSession.Connected         -= OnSessionConnected)
            .Add(() => sessionProvider.BrokerStateChanged   -= OnBrokerStateChanged)
            .Add(_host);
        }
Ejemplo n.º 2
0
 public PackageInfo(IIntellisenseRSession host, string name, string description, string version, IEnumerable <string> functionNames) :
     base(name, description, NamedItemType.Package)
 {
     _host      = host;
     _version   = version;
     _functions = new ConcurrentBag <INamedItemInfo>(functionNames.Select(fn => new FunctionInfo(fn)));
 }
Ejemplo n.º 3
0
 public PackageInfo(IIntellisenseRSession host, string name, string description, string version, IEnumerable <IPersistentFunctionInfo> functions) :
     base(name, description, NamedItemType.Package)
 {
     _host      = host;
     _fs        = _host.Services.FileSystem();
     _version   = version;
     _functions = new ConcurrentBag <IFunctionInfo>(functions.Select(fn => new FunctionInfo(fn.Name, fn.IsInternal)));
 }
Ejemplo n.º 4
0
        public PackageIndex(IRInteractiveWorkflowProvider interactiveWorkflowProvider, ICoreShell shell, IIntellisenseRSession host, IFunctionIndex functionIndex)
        {
            _shell         = shell;
            _host          = host;
            _functionIndex = functionIndex;

            _interactiveSession = interactiveWorkflowProvider.GetOrCreate().RSession;

            _interactiveSession.PackagesInstalled += OnPackagesChanged;
            _interactiveSession.PackagesRemoved   += OnPackagesChanged;
        }
Ejemplo n.º 5
0
        public PackageFunctionCompletionProvider(IServiceContainer serviceContainer)
        {
            _session = serviceContainer.GetService <IIntellisenseRSession>();
            _snippetInformationSource = serviceContainer.GetService <ISnippetInformationSourceProvider>();
            _packageIndex             = serviceContainer.GetService <IPackageIndex>();
            _functionIndex            = serviceContainer.GetService <IFunctionIndex>();

            var imageService = serviceContainer.GetService <IImageService>();

            _functionGlyph = imageService.GetImage(ImageType.Method);
            _constantGlyph = imageService.GetImage(ImageType.Constant);
        }
Ejemplo n.º 6
0
        public PackageFunctionCompletionProvider(
            IIntellisenseRSession session,
            [Import(AllowDefault = true)] ISnippetInformationSourceProvider snippetInformationSource,
            IPackageIndex packageIndex,
            IFunctionIndex functionIndex,
            IGlyphService glyphService)
        {
            _session = session;
            _snippetInformationSource = snippetInformationSource;
            _packageIndex             = packageIndex;
            _functionIndex            = functionIndex;

            _functionGlyph = glyphService.GetGlyphThreadSafe(StandardGlyphGroup.GlyphGroupMethod, StandardGlyphItem.GlyphItemPublic);
            _constantGlyph = glyphService.GetGlyphThreadSafe(StandardGlyphGroup.GlyphGroupConstant, StandardGlyphItem.GlyphItemPublic);
        }
        public PackageFunctionCompletionProvider(
            IIntellisenseRSession session,
            [Import(AllowDefault = true)] ISnippetInformationSourceProvider snippetInformationSource,
            IPackageIndex packageIndex,
            IFunctionIndex functionIndex,
            ICoreShell coreShell)
        {
            _session = session;
            _snippetInformationSource = snippetInformationSource;
            _packageIndex             = packageIndex;
            _functionIndex            = functionIndex;

            var imageService = coreShell.GetService <IImageService>();

            _functionGlyph = imageService.GetImage(ImageType.Method) as ImageSource;
            _constantGlyph = imageService.GetImage(ImageType.Constant) as ImageSource;;
        }
Ejemplo n.º 8
0
        public PackageIndex(IRInteractiveWorkflowProvider interactiveWorkflowProvider, ICoreShell shell, IIntellisenseRSession host, IFunctionIndex functionIndex) {
            _shell = shell;
            _host = host;
            _functionIndex = functionIndex;

            _workflow = interactiveWorkflowProvider.GetOrCreate();

            _interactiveSession = _workflow.RSession;
            _interactiveSession.Connected += OnSessionConnected;
            _interactiveSession.PackagesInstalled += OnPackagesChanged;
            _interactiveSession.PackagesRemoved += OnPackagesChanged;

            _workflow.RSessions.BrokerStateChanged += OnBrokerStateChanged;

            if (_workflow.RSession.IsHostRunning) {
                BuildIndexAsync().DoNotWait();
            }
        }
Ejemplo n.º 9
0
        public PackageIndex(
            IRInteractiveWorkflowProvider interactiveWorkflowProvider, ICoreShell shell, IIntellisenseRSession host, IFunctionIndex functionIndex)
        {
            _shell         = shell;
            _host          = host;
            _functionIndex = functionIndex;

            _workflow = interactiveWorkflowProvider.GetOrCreate();

            _interactiveSession                  = _workflow.RSession;
            _interactiveSession.Connected       += OnSessionConnected;
            _interactiveSession.PackagesRemoved += OnPackagesRemoved;

            _workflow.RSessions.BrokerStateChanged += OnBrokerStateChanged;

            if (_workflow.RSession.IsHostRunning)
            {
                BuildIndexAsync().DoNotWait();
            }
        }
Ejemplo n.º 10
0
 public PackageInfo(IIntellisenseRSession host, string name, string description, string version) :
     this(host, name, description, version, Enumerable.Empty <string>())
 {
 }
Ejemplo n.º 11
0
 public FunctionIndex(IServiceContainer services, IFunctionRdDataProvider rdDataProfider, IIntellisenseRSession host)
 {
     Services = services;
     _functionRdDataProvider = rdDataProfider;
     _host = host;
 }
Ejemplo n.º 12
0
 public FunctionRdDataProvider(IIntellisenseRSession host)
 {
     _host = host;
 }
Ejemplo n.º 13
0
 public FunctionRdDataProvider(IIntellisenseRSession host) {
     _host = host;
 }
Ejemplo n.º 14
0
 public FunctionIndex(ICoreShell coreShell, IFunctionRdDataProvider rdDataProfider, IIntellisenseRSession host)
 {
     _coreShell = coreShell;
     _functionRdDataProvider = rdDataProfider;
     _host = host;
 }
Ejemplo n.º 15
0
 public FunctionRdDataProvider(IServiceContainer services)
 {
     _host = services.GetService <IIntellisenseRSession>();
 }
Ejemplo n.º 16
0
 public PackageIndex(ICoreShell shell, IIntellisenseRSession host, IFunctionIndex functionIndex)
 {
     _shell         = shell;
     _host          = host;
     _functionIndex = functionIndex;
 }
Ejemplo n.º 17
0
 public PackageInfo(IIntellisenseRSession host, string name, string description, string version) :
     base(name, description, NamedItemType.Package) {
     _host = host;
     _version = version;
 }
Ejemplo n.º 18
0
 public FunctionIndex(ICoreShell coreShell, IFunctionRdDataProvider rdDataProfider, IIntellisenseRSession host) {
     _coreShell = coreShell;
     _functionRdDataProvider = rdDataProfider;
     _host = host;
 }
Ejemplo n.º 19
0
 public PackageInfo(IIntellisenseRSession host, string name, string description, string version) :
     base(name, description, NamedItemType.Package)
 {
     _host    = host;
     _version = version;
 }