Make sure main process webview file resource loads stays on main process

We were checking the wrong uri
This commit is contained in:
Matt Bierner 2020-07-21 13:57:10 -07:00
parent 145a0072d3
commit ec8606cb49
3 changed files with 21 additions and 2 deletions

View file

@ -0,0 +1,18 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withBrowserDefaults = require('../shared.webpack.config').browser;
module.exports = withBrowserDefaults({
context: __dirname,
entry: {
extension: './src/extension.browser.ts',
'tsserver.browser': './src/tsserver.browser.ts',
}
});

View file

@ -107,7 +107,8 @@ export function register(
telemetryReporter: TelemetryReporter,
) {
return conditionalRegistration([
requireMinVersion(client, OrganizeImportsCodeActionProvider.minVersion)
requireMinVersion(client, OrganizeImportsCodeActionProvider.minVersion),
], () => {
const organizeImportsProvider = new OrganizeImportsCodeActionProvider(client, commandManager, fileConfigurationManager, telemetryReporter);
return vscode.languages.registerCodeActionsProvider(selector.syntax,

View file

@ -174,7 +174,7 @@ export class WebviewProtocolProvider extends Disposable {
const fileService = {
readFileStream: async (resource: URI): Promise<VSBufferReadableStream> => {
if (uri.scheme === Schemas.file) {
if (resource.scheme === Schemas.file) {
return (await this.fileService.readFileStream(resource)).value;
}