forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly gate type acquisition on web
For microsoft#221299 Make sure we don't register the file system at all in these cases
- Loading branch information
Showing
3 changed files
with
37 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
extensions/typescript-language-features/src/filesystems/ata.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as vscode from 'vscode'; | ||
import { conditionalRegistration, requireGlobalConfiguration } from '../languageFeatures/util/dependentRegistration'; | ||
import { supportsReadableByteStreams } from '../utils/platform'; | ||
import { AutoInstallerFs } from './autoInstallerFs'; | ||
import { MemFs } from './memFs'; | ||
|
||
export function registerAtaSupport(): vscode.Disposable { | ||
if (!supportsReadableByteStreams()) { | ||
return vscode.Disposable.from(); | ||
} | ||
|
||
return conditionalRegistration([ | ||
requireGlobalConfiguration('typescript', 'tsserver.web.typeAcquisition.enabled'), | ||
], () => { | ||
return vscode.Disposable.from( | ||
vscode.workspace.registerFileSystemProvider('vscode-global-typings', new MemFs(), { | ||
isCaseSensitive: true, | ||
isReadonly: false | ||
}), | ||
vscode.workspace.registerFileSystemProvider('vscode-node-modules', new AutoInstallerFs(), { | ||
isCaseSensitive: true, | ||
isReadonly: false | ||
})); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters