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

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

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

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

            Editor.TextChanged += TextChanged;

            base.Initialize();
        }
예제 #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);
        }
예제 #5
0
        void WorkbenchDocumentClosed(Document document)
        {
            JsonLanguageServiceHost host = GetHost(document);

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

            host.OpenDocument(document);
        }