fix file event handler when file is in a dot folder (#389)

master
Brad Cornes 2021-09-17 15:55:41 +01:00
parent fa68c54a01
commit b089cc3833
1 changed files with 4 additions and 3 deletions

View File

@ -228,13 +228,13 @@ async function createProjectService(
let file = normalizePath(change.file)
for (let ignorePattern of ignore) {
if (minimatch(file, ignorePattern)) {
if (minimatch(file, ignorePattern, { dot: true })) {
continue
}
}
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`)
let isPackageFile = minimatch(file, '**/package.json')
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`, { dot: true })
let isPackageFile = minimatch(file, '**/package.json', { dot: true })
let isDependency = state.dependencies && state.dependencies.includes(change.file)
if (!isConfigFile && !isPackageFile && !isDependency) continue
@ -268,6 +268,7 @@ async function createProjectService(
if (params.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration) {
connection.onDidChangeWatchedFiles(({ changes }) => {
console.log('watched file changed')
onFileEvents(
changes.map(({ uri, type }) => ({
file: URI.parse(uri).fsPath,