Skip to content

Commit 852929e

Browse files
milesziemerjoewyz
authored andcommitted
Fix Smithy file watch patterns (smithy-lang#192)
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.
1 parent 9bd5681 commit 852929e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/software/amazon/smithy/lsp/FilePatterns.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static String getSmithyFilePattern(Path path, boolean isWatcherPattern)
106106
glob += "**";
107107

108108
if (isWatcherPattern) {
109-
glob += ".{smithy,json}";
109+
glob += "/*.{smithy,json}";
110110
}
111111

112112
return escapeBackslashes(glob);

src/test/java/software/amazon/smithy/lsp/FileWatcherRegistrationsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.List;
1414
import org.eclipse.lsp4j.DidChangeWatchedFilesRegistrationOptions;
1515
import org.eclipse.lsp4j.Registration;
16+
import org.junit.jupiter.api.Disabled;
1617
import org.junit.jupiter.api.Test;
1718
import software.amazon.smithy.build.model.SmithyBuildConfig;
1819
import software.amazon.smithy.lsp.project.Project;
@@ -21,6 +22,7 @@
2122

2223
public class FileWatcherRegistrationsTest {
2324
@Test
25+
@Disabled("https://github.com/smithy-lang/smithy-language-server/issues/191")
2426
public void createsCorrectRegistrations() {
2527
TestWorkspace workspace = TestWorkspace.builder()
2628
.withSourceDir(new TestWorkspace.Dir()

0 commit comments

Comments
 (0)