Exemple #1
0
        JsonLanguageServiceHost CreateHost(Project project)
        {
            var host = new JsonLanguageServiceHost(project);

            host.Start();
            return(host);
        }
Exemple #2
0
        public override void Dispose()
        {
            if (host != null)
            {
                host.OnDiagnostics -= OnDiagnostics;
            }

            host = null;
            base.Dispose();
        }
Exemple #3
0
        protected override void Initialize()
        {
            JsonServices.Activate();

            host = JsonServices.Workspace.GetHost(DocumentContext.Project);
            host.OnDiagnostics += OnDiagnostics;

            Editor.TextChanged += TextChanged;

            base.Initialize();
        }
Exemple #4
0
        public JsonLanguageServiceHost GetHost(Project project)
        {
            JsonLanguageServiceHost host = hosts.FirstOrDefault(currentHost => currentHost.Project == project);

            if (host != null)
            {
                return(host);
            }

            host = CreateHost(project);
            hosts.Add(host);

            return(host);
        }
Exemple #5
0
        void WorkbenchDocumentClosed(Document document)
        {
            JsonLanguageServiceHost host = GetHost(document);

            host.CloseDocument(document);
        }
Exemple #6
0
        void WorkbenchDocumentOpened(Document document)
        {
            JsonLanguageServiceHost host = GetHost(document);

            host.OpenDocument(document);
        }