Skip to content

Commit

Permalink
Ignore tsserver requests for createDirectoryWatcher(~/Library) on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Sep 5, 2024
1 parent 76671ce commit bdef085
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import * as path from 'path';
import * as vscode from 'vscode';
import { homedir } from 'os';
import { ServiceConfigurationProvider, SyntaxServerConfiguration, TsServerLogLevel, TypeScriptServiceConfiguration, areServiceConfigurationsEqual } from './configuration/configuration';
import * as fileSchemes from './configuration/fileSchemes';
import { Schemes } from './configuration/schemes';
Expand Down Expand Up @@ -1038,10 +1039,16 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return;

case EventName.createDirectoryWatcher: {
const join = path.join;
const path = (event.body as Proto.CreateDirectoryWatcherEventBody).path;
if (path.startsWith(inMemoryResourcePrefix)) {
return;
}
if (process.platform === 'darwin' && path === join(os.homedir(), 'Library')) {
// ignore directory watch requests on ~/Library
// until microsoft/TypeScript#59831 is resolved
return;
}

this.createFileSystemWatcher(
(event.body as Proto.CreateDirectoryWatcherEventBody).id,
Expand Down

0 comments on commit bdef085

Please sign in to comment.