Repository navigation
Accept relative patterns in NotebookDocumentFilter.is - #1931
Merged
Dirk Bäumer (dbaeumer) merged 1 commit intoOct 30, 2026
Merged
Dirk Bäumer (dbaeumer) merged 1 commit into
Dirk Bäumer (dbaeumer) merged 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change enabling relative glob patterns in notebook filter validation.
No open issues 🎉
What changed in this PR
Aligns notebook filter validation with the existing GlobPattern type support from #1519, allowing relative patterns to pass through notebook cell and document selector guards.
Changes:
- Uses
GlobPattern.isinstead of a string-only check inNotebookDocumentFilter.is. - Adds regression tests for relative patterns, invalid inputs, string compatibility, and dependent selector guards.
| File | Description |
|---|---|
protocol/src/node/test/documentFilter.test.ts |
Adds coverage for notebook filters and dependent type guards. |
protocol/src/common/protocol.ts |
Accepts relative glob patterns in notebook filter validation. |
Review effort: Balanced
Dirk Bäumer (dbaeumer)
approved these changes
Oct 30, 2026
Dirk Bäumer (dbaeumer)
enabled auto-merge
October 30, 2026 16:07
Dirk Bäumer (dbaeumer)
approved these changes
Oct 30, 2026
Anthony Kim (anthonykim1)
approved these changes
Oct 30, 2026
TylerLeonhardt
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NotebookDocumentFilter.isstill only accepts a stringpattern, although #1519 changed the pattern of all notebook filters toGlobPattern. The client converter already usesasGlobPatternfor it, andTextDocumentFilter.ismoved toGlobPattern.isin #1516. A notebook filter identified only by a relative pattern is rejected:Because of this,
NotebookCellTextDocumentFilter.isandDocumentSelector.isalso return false. The client'sasDocumentSelectorthen turns{ notebook: { pattern: rel }, language: 'python' }into the plain text filter{ language: 'python' }, or drops it when there is no language. This change usesGlobPattern.isfor the notebook filter pattern, the same asTextDocumentFilter.is.npm run compile:protocoland the newprotocol/src/node/test/documentFilter.test.ts. Before the change 4 of its 7 tests fail; after it all pass.npm --prefix protocol run test:node(12 passing) andnpm --prefix protocol run lint(clean).{},{ pattern: 1 },{ pattern: {} }and an invalidbaseUriare still rejected. A plain text filter with a relative pattern is still not treated as a notebook cell filter.