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 ;
2
2
using System . Collections . ObjectModel ;
3
3
using System . Diagnostics ;
4
4
using System . Linq ;
@@ -734,7 +734,7 @@ public interface INotebookDocumentRegistrationOptions : IRegistrationOptions
734
734
/// <summary>
735
735
/// The notebooks to be synced
736
736
/// </summary>
737
- NotebookSelector NotebookSelector { get ; set ; }
737
+ Container < NotebookSelector > NotebookSelector { get ; set ; }
738
738
}
739
739
740
740
/// <summary>
@@ -761,7 +761,7 @@ public partial class NotebookDocumentSyncOptions : INotebookDocumentRegistration
761
761
/// value is provided it matches against the
762
762
/// notebook type. '*' matches every notebook.
763
763
/// </summary>
764
- public NotebookSelector NotebookSelector { get ; set ; }
764
+ public Container < NotebookSelector > NotebookSelector { get ; set ; }
765
765
766
766
/// <summary>
767
767
/// 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
101
101
var registrationOptions = descriptor . RegistrationOptions as INotebookDocumentRegistrationOptions ;
102
102
103
103
_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 )
106
107
{
107
108
_logger . LogTrace (
108
109
"Handler Selected: {Handler} {Id} via {NotebookDocumentSelector} (targeting {HandlerInterface})" ,
109
110
descriptor . ImplementationType . FullName ,
110
111
descriptor . Handler is ICanBeIdentifiedHandler h ? h . Id . ToString ( ) : string . Empty ,
111
- registrationOptions ? . NotebookSelector ? . ToString ( ) ,
112
+ selector ? . ToString ( ) ,
112
113
descriptor . HandlerType . FullName
113
114
) ;
114
115
yield return descriptor ;
You can’t perform that action at this time.
0 commit comments