Skip to content

Commit

Permalink
Fix Smithy file watch patterns (smithy-lang#192)
Browse files Browse the repository at this point in the history
Addresses
smithy-lang#191. I had
to disable our test for watcher registrations because (as described in
the issue) PathMatcher behaves differently that whatever VSCode is using
to match glob patterns. For testing, I may need to followup with a more
robust way of verifying changes against specific clients.
  • Loading branch information
milesziemer authored and joewyz committed Feb 13, 2025
1 parent 9bd5681 commit 852929e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/software/amazon/smithy/lsp/FilePatterns.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private static String getSmithyFilePattern(Path path, boolean isWatcherPattern)
glob += "**";

if (isWatcherPattern) {
glob += ".{smithy,json}";
glob += "/*.{smithy,json}";
}

return escapeBackslashes(glob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;
import org.eclipse.lsp4j.DidChangeWatchedFilesRegistrationOptions;
import org.eclipse.lsp4j.Registration;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.smithy.build.model.SmithyBuildConfig;
import software.amazon.smithy.lsp.project.Project;
Expand All @@ -21,6 +22,7 @@

public class FileWatcherRegistrationsTest {
@Test
@Disabled("https://github.com/smithy-lang/smithy-language-server/issues/191")
public void createsCorrectRegistrations() {
TestWorkspace workspace = TestWorkspace.builder()
.withSourceDir(new TestWorkspace.Dir()
Expand Down

0 comments on commit 852929e

Please sign in to comment.