Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore tsserver requests for createDirectoryWatcher(~/Library) on macOS #227653

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Collaborator

@deepak1556 deepak1556 Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import breaks the web build, needs to update fallback in

    Module not found: Error: Can't resolve 'os' in '/mnt/vss/_work/1/s/extensions/typescript-language-features/src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
	- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "os": false }
Details:
    domainEmitter: [object Object]
    domainThrown: false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check, I had a feeling this would break

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

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

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