Skip to content

Find a TOML project when scanning a directory, not only when named a file - #63

Merged
ww-mw merged 1 commit into
mainfrom
toml-loaddirectory
Oct 2, 2026
Merged

ww-mw merged 1 commit into
mainfrom
toml-loaddirectory

Conversation

@ww-mw

@ww-mw ww-mw commented Oct 2, 2026

Copy link
Copy Markdown
Member

loadDirectory filtered on an extension set, so the one supported file with no distinguishing extension was invisible to it. A project converted with matlab.project.DefinitionFiles.Toml keeps no .prj and no resources/ — its whole definition is a file called matlab.toml. loadFromPath has opened that file since the reader landed in v1.35.0, which is the asymmetry: point a Node consumer at the file and it reads the project, point it at the folder the file is in and the folder reads as holding nothing.

The filter now asks isTomlProjectFile beside the extension set, rather than adding .toml to it — that would call every Cargo.toml and pyproject.toml in a folder a MATLAB project. The shared predicate rather than a literal, because this is the second path over one rule: ingest dispatches a project on isProjectFile, and a scan that disagrees with it either hides a file that opens fine or lists one nothing can open.

Non-vacuity, checked before trusting the test: with the source change stashed it fails with expected [] to deeply equal [ 'matlab.toml' ] — the reported symptom exactly. The marker in the fixture is MATLAB-written (copied from the parity artifact), and a Cargo.toml and pyproject.toml are written beside it so their absence from the result is the filter rejecting them and not an empty directory.

Scope: Node consumers of this package only. The VS Code extension discovers files through its own findFiles glob and never calls loadDirectory, so nothing downstream changes and no pin bump is needed. Left untagged deliberately — it rides the next release.

npm run verify green: typecheck, build, smoke, 175 files / 5242 tests, check:pack (dist-only, 539 files, 588.4 kB), check:leak, check:browser (148 modules).

…file

`loadDirectory` filtered on an extension set, so the one supported file that
has no distinguishing extension was invisible to it: a project converted with
`matlab.project.DefinitionFiles.Toml` keeps no `.prj` and no `resources/`, and
its whole definition is a file called `matlab.toml`. `loadFromPath` opened that
file fine from the moment the reader landed, which is the asymmetry — point a
Node consumer at the file and it reads the project, point it at the folder the
file is in and the folder reads as holding nothing.

The filter now asks `isTomlProjectFile` beside the extension set rather than
adding `.toml` to it, which would call every `Cargo.toml` and `pyproject.toml`
in a folder a MATLAB project. The predicate rather than a literal, because this
is the second path over one rule: `ingest` dispatches a project on
`isProjectFile`, and a scan that disagrees with it either hides a file that
opens fine or lists one nothing can open.

Proven not to be vacuous before being trusted: with the source change stashed,
the new test fails with `expected [] to deeply equal [ 'matlab.toml' ]` — the
reported symptom exactly. Its marker is MATLAB-written, copied from the parity
artifact, and two decoys are written beside it so their absence from the result
is the filter rejecting them and not an empty directory.

Affects Node consumers of this package only; the VS Code extension discovers
files through its own `findFiles` glob and never calls `loadDirectory`, so
nothing downstream changes and no pin needs bumping.
@ww-mw
ww-mw merged commit 3a8b87a into main Oct 2, 2026
4 checks passed
@ww-mw
ww-mw deleted the toml-loaddirectory branch October 2, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant