Skip to content

Commit

Permalink
Merge pull request #227681 from microsoft/revert-227653-watch-library…
Browse files Browse the repository at this point in the history
…-failsafe

Revert "Ignore tsserver requests for createDirectoryWatcher(~/Library) on macOS"
  • Loading branch information
bpasero authored Sep 5, 2024
2 parents 1180de7 + 7f5d714 commit abb449c
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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 @@ -1039,20 +1038,15 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return;

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

this.createFileSystemWatcher(
(event.body as Proto.CreateDirectoryWatcherEventBody).id,
new vscode.RelativePattern(
vscode.Uri.file(fpath),
vscode.Uri.file(path),
(event.body as Proto.CreateDirectoryWatcherEventBody).recursive ? '**' : '*'
),
(event.body as Proto.CreateDirectoryWatcherEventBody).ignoreUpdate
Expand Down

0 comments on commit abb449c

Please sign in to comment.