Skip to content

Commit 9947253

Browse files
committed
Add file names to root file watch globs
1 parent 08c6506 commit 9947253

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal/project/project.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,15 @@ func (p *Project) LanguageService() *ls.LanguageService {
231231

232232
func (p *Project) getRootFileWatchGlobs() []string {
233233
if p.kind == KindConfigured {
234-
wildcardDirectories := p.parsedCommandLine.WildcardDirectories()
235-
result := make([]string, 0, len(wildcardDirectories)+1)
234+
globs := p.parsedCommandLine.WildcardDirectories()
235+
result := make([]string, 0, len(globs)+1)
236236
result = append(result, p.configFileName)
237-
for dir, recursive := range wildcardDirectories {
237+
for dir, recursive := range globs {
238238
result = append(result, fmt.Sprintf("%s/%s", dir, core.IfElse(recursive, recursiveFileGlobPattern, fileGlobPattern)))
239239
}
240+
for _, fileName := range p.parsedCommandLine.FileNames() {
241+
result = append(result, fileName)
242+
}
240243
return result
241244
}
242245
return nil

0 commit comments

Comments
 (0)