Skip to content

FileSystemWatcher registrations for Smithy files don't match Smithy files in directories #191

@milesziemer

Description

@milesziemer

When you have a folder structure like:

.
├── models
│   └── foo.smithy
└── smithy-build.json

adding a new Smithy file to models should trigger the didChangeWatchedFiles notification. We register for this notification using SmithyLanguageServer::registerSmithyFileWatchers, which basically sends a list of glob Patterns of the files we want to watch.

Assuming the root dir of the above example is /foo, the registration glob pattern (right now) would look like:

/foo/models/**.{smithy,json}

Java's PathMatcher would match a /foo/models/bar.smithy using that pattern, which is what our tests in FileWatcherRegistrationsTest verify. However, in VSCode, we don't get a didChangeWatchedFiles notification if you added /foo/models/bar.smithy. I confirmed that the registrations were sent properly, so its not an issue there.

If I change the pattern we register for to:

/foo/models/**/*.{smithy,json}

then VSCode does send didChangeWatchedFiles if you added /foo/models/bar.smithy, but our test fails.

I also checked Neovim, and it seems either file pattern works.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions