コード例 #1
0
        public void SubjectBuffersConnected(ITextView textView, ConnectionReason reason, IReadOnlyCollection <ITextBuffer> subjectBuffers)
        {
            if (textView is null)
            {
                throw new ArgumentNullException(nameof(textView));
            }

            var vsTextView = _editorAdaptersFactory.GetViewAdapter(textView);

            RazorLSPTextViewFilter.CreateAndRegister(vsTextView);
        }
        public void SubjectBuffersConnected(ITextView textView, ConnectionReason reason, IReadOnlyCollection <ITextBuffer> subjectBuffers)
        {
            if (textView is null)
            {
                throw new ArgumentNullException(nameof(textView));
            }

            var vsTextView = _editorAdaptersFactory.GetViewAdapter(textView);

            // In remote client scenarios there's a custom language service applied to buffers in order to enable delegation of interactions.
            // Because of this we don't want to break that experience so we ensure not to "set" a langauge service for remote clients.
            if (!_editorFeatureDetector.IsRemoteClient())
            {
                vsTextView.GetBuffer(out var vsBuffer);
                vsBuffer.SetLanguageServiceID(RazorLSPConstants.RazorLanguageServiceGuid);
            }

            RazorLSPTextViewFilter.CreateAndRegister(vsTextView);
        }