File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Protocol/Features/Document Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1- using System ;
1+ using System ;
22using System . Collections . ObjectModel ;
33using System . Diagnostics ;
44using System . Linq ;
@@ -734,7 +734,7 @@ public interface INotebookDocumentRegistrationOptions : IRegistrationOptions
734734 /// <summary>
735735 /// The notebooks to be synced
736736 /// </summary>
737- NotebookSelector NotebookSelector { get ; set ; }
737+ Container < NotebookSelector > NotebookSelector { get ; set ; }
738738 }
739739
740740 /// <summary>
@@ -761,7 +761,7 @@ public partial class NotebookDocumentSyncOptions : INotebookDocumentRegistration
761761 /// value is provided it matches against the
762762 /// notebook type. '*' matches every notebook.
763763 /// </summary>
764- public NotebookSelector NotebookSelector { get ; set ; }
764+ public Container < NotebookSelector > NotebookSelector { get ; set ; }
765765
766766 /// <summary>
767767 /// Whether save notification should be forwarded to
Original file line number Diff line number Diff line change @@ -101,14 +101,15 @@ private IEnumerable<ILspHandlerDescriptor> GetHandler(IEnumerable<ILspHandlerDes
101101 var registrationOptions = descriptor . RegistrationOptions as INotebookDocumentRegistrationOptions ;
102102
103103 _logger . LogTrace ( "Registration options {OptionsName}" , registrationOptions ? . GetType ( ) . FullName ) ;
104- _logger . LogTrace ( "Document Selector {NotebookDocumentSelector}" , registrationOptions ? . NotebookSelector ? . ToString ( ) ?? string . Empty ) ;
105- if ( registrationOptions ? . NotebookSelector is null || registrationOptions . NotebookSelector . IsMatch ( attributes ) )
104+ var selector = registrationOptions ? . NotebookSelector ? . FirstOrDefault ( s => s . IsMatch ( attributes ) ) ;
105+ _logger . LogTrace ( "Document Selector {NotebookDocumentSelector}" , selector ? . ToString ( ) ) ;
106+ if ( registrationOptions ? . NotebookSelector is null || selector is not null )
106107 {
107108 _logger . LogTrace (
108109 "Handler Selected: {Handler} {Id} via {NotebookDocumentSelector} (targeting {HandlerInterface})" ,
109110 descriptor . ImplementationType . FullName ,
110111 descriptor . Handler is ICanBeIdentifiedHandler h ? h . Id . ToString ( ) : string . Empty ,
111- registrationOptions ? . NotebookSelector ? . ToString ( ) ,
112+ selector ? . ToString ( ) ,
112113 descriptor . HandlerType . FullName
113114 ) ;
114115 yield return descriptor ;
You can’t perform that action at this time.
0 commit comments