Example #1
0
 public void OnDocumentOpened(LanguageClientDocumentContext context, string text)
 {
     try {
         context.Session.OpenDocument(context.FileName, text);
     } catch (Exception ex) {
         LanguageClientLoggingService.LogError("Error opening document.", ex);
     }
 }
Example #2
0
        public void OnDocumentClosed(LanguageClientDocumentContext context)
        {
            if (context.Session == null)
            {
                return;
            }

            if (IsAnyDocumentOpenForSession(context.Session))
            {
                context.Session.CloseDocument(context.FileName);
            }
            else
            {
                ShutdownSession(context.Session).LogFault();
            }
        }
Example #3
0
        async Task Initialize(FileDocumentController fileController, Properties status)
        {
            await base.Initialize(status);

            context         = new LanguageClientDocumentContext(fileController);
            context.Session = LanguageClientServices.Workspace.GetSession(context);

            if (context.Session == null)
            {
                LanguageClientLoggingService.LogError(string.Format("Unable to get language client session for {0}", context.FileName));

                context = null;
                return;
            }

            if (!context.Session.IsStarted)
            {
                context.Session.Started += SessionStarted;
            }
        }