mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-24 18:41:05 +00:00
55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
|
|
const defaultSettings = {
|
|
appRoot: 'app/src/main'
|
|
}
|
|
|
|
class AndroidProjectSettings {
|
|
/**
|
|
* The root of the app source folder.
|
|
* This folder should contain AndroidManifest.xml as well as the asets, res, etc folders
|
|
*/
|
|
appRoot = defaultSettings.appRoot;
|
|
|
|
/**
|
|
* The identifier for the language server settings
|
|
*/
|
|
ID = 'androidJavaLanguageServer';
|
|
|
|
static Instance = new AndroidProjectSettings();
|
|
|
|
/**
|
|
* Called when the user edits the settings
|
|
* @param {*} values
|
|
*/
|
|
onChange(values) {
|
|
this.set(values);
|
|
}
|
|
|
|
set(values) {
|
|
console.log(`settings set: ${JSON.stringify(values)}`);
|
|
for (let key in defaultSettings) {
|
|
if (Object.prototype.hasOwnProperty.call(values, key)) {
|
|
this[key] = values[key];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// function getDocumentSettings(resource) {
|
|
// if (!hasConfigurationCapability) {
|
|
// return Promise.resolve(projectSettings);
|
|
// }
|
|
// let result = documentSettings.get(resource);
|
|
// if (!result) {
|
|
// result = connection.workspace.getConfiguration({
|
|
// scopeUri: resource,
|
|
// section: 'androidJavaLanguageServer',
|
|
// });
|
|
// documentSettings.set(resource, result);
|
|
// }
|
|
// return result;
|
|
// }
|
|
|
|
exports.Settings = AndroidProjectSettings.Instance;
|