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:
Joe Previte
2021-03-11 11:14:35 -07:00
parent 8512be85a5
commit cc8e4ee97c
2 changed files with 11 additions and 24 deletions

View File

@@ -78,12 +78,6 @@
// Do nothing. If we can't read the file we have no
// language pack config.
}
}, err => {
if (err.code === 'ENOENT') {
return undefined;
}
throw err;
});
}
function readFile(file) {
@@ -121,15 +115,17 @@
* @returns {object}
*/
function getLanguagePackConfigurations(userDataPath) {
const configFile = path.join(userDataPath, 'languagepacks.json');
try {
// NOTE@coder: Swapped require with readFile since require is cached and
// we don't restart the server-side portion of code-server when the
// language changes.
return JSON.parse(fs.readFileSync(configFile, 'utf8'));
} catch (err) {
// Do nothing. If we can't read the file we have no
// language pack config.
const configFile = path.join(userDataPath, 'languagepacks.json');
try {
// NOTE@coder: Swapped require with readFile since require is cached and
// we don't restart the server-side portion of code-server when the
// language changes.
return JSON.parse(fs.readFileSync(configFile, 'utf8'));
} catch (err) {
// Do nothing. If we can't read the file we have no
// language pack config.
}
return undefined;
}
/**