fix(lib/vscode): update extensionManagementService
Looks like a few import updates and one minor update for language packs. We had made this change ourselves, but now it's officially in the vscode codebase. Super cool.
This commit is contained in:
parent
8512be85a5
commit
cc8e4ee97c
@ -78,12 +78,6 @@
|
|||||||
// Do nothing. If we can't read the file we have no
|
// Do nothing. If we can't read the file we have no
|
||||||
// language pack config.
|
// language pack config.
|
||||||
}
|
}
|
||||||
}, err => {
|
|
||||||
if (err.code === 'ENOENT') {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function readFile(file) {
|
function readFile(file) {
|
||||||
@ -121,15 +115,17 @@
|
|||||||
* @returns {object}
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
function getLanguagePackConfigurations(userDataPath) {
|
function getLanguagePackConfigurations(userDataPath) {
|
||||||
const configFile = path.join(userDataPath, 'languagepacks.json');
|
const configFile = path.join(userDataPath, 'languagepacks.json');
|
||||||
try {
|
try {
|
||||||
// NOTE@coder: Swapped require with readFile since require is cached and
|
// NOTE@coder: Swapped require with readFile since require is cached and
|
||||||
// we don't restart the server-side portion of code-server when the
|
// we don't restart the server-side portion of code-server when the
|
||||||
// language changes.
|
// language changes.
|
||||||
return JSON.parse(fs.readFileSync(configFile, 'utf8'));
|
return JSON.parse(fs.readFileSync(configFile, 'utf8'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Do nothing. If we can't read the file we have no
|
// Do nothing. If we can't read the file we have no
|
||||||
// language pack config.
|
// language pack config.
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,12 +24,9 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
|||||||
import Severity from 'vs/base/common/severity';
|
import Severity from 'vs/base/common/severity';
|
||||||
import { canceled } from 'vs/base/common/errors';
|
import { canceled } from 'vs/base/common/errors';
|
||||||
import { IUserDataAutoSyncEnablementService, IUserDataSyncResourceEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
|
import { IUserDataAutoSyncEnablementService, IUserDataSyncResourceEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
|
||||||
<<<<<<< HEAD
|
|
||||||
import { isWeb } from 'vs/base/common/platform';
|
import { isWeb } from 'vs/base/common/platform';
|
||||||
=======
|
|
||||||
import { Promises } from 'vs/base/common/async';
|
import { Promises } from 'vs/base/common/async';
|
||||||
import { IWorkspaceTrustService, WorkspaceTrustState } from 'vs/platform/workspace/common/workspaceTrust';
|
import { IWorkspaceTrustService, WorkspaceTrustState } from 'vs/platform/workspace/common/workspaceTrust';
|
||||||
>>>>>>> e8cd17a97d8c58fffcbac05394b3ee2b3c72d384
|
|
||||||
|
|
||||||
export class ExtensionManagementService extends Disposable implements IWorkbenchExtensioManagementService {
|
export class ExtensionManagementService extends Disposable implements IWorkbenchExtensioManagementService {
|
||||||
|
|
||||||
@ -263,13 +260,7 @@ export class ExtensionManagementService extends Disposable implements IWorkbench
|
|||||||
|
|
||||||
// Install Language pack on local and remote servers
|
// Install Language pack on local and remote servers
|
||||||
if (isLanguagePackExtension(manifest)) {
|
if (isLanguagePackExtension(manifest)) {
|
||||||
<<<<<<< HEAD
|
|
||||||
// NOTE@coder: It does not appear language packs can be installed on the web
|
|
||||||
// extension management server at this time. Filter out the web to fix this.
|
|
||||||
servers.push(...this.servers.filter(s => s !== this.extensionManagementServerService.webExtensionManagementServer));
|
|
||||||
=======
|
|
||||||
servers.push(...this.servers.filter(server => server !== this.extensionManagementServerService.webExtensionManagementServer));
|
servers.push(...this.servers.filter(server => server !== this.extensionManagementServerService.webExtensionManagementServer));
|
||||||
>>>>>>> e8cd17a97d8c58fffcbac05394b3ee2b3c72d384
|
|
||||||
} else {
|
} else {
|
||||||
const server = this.getExtensionManagementServerToInstall(manifest);
|
const server = this.getExtensionManagementServerToInstall(manifest);
|
||||||
if (server) {
|
if (server) {
|
||||||
|
Reference in New Issue
Block a user