fix file event handler when file is in a dot folder (#389)
parent
fa68c54a01
commit
b089cc3833
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue