-
Notifications
You must be signed in to change notification settings - Fork 0
Add Preference API #30
Conversation
is packages/core/src/browser/preferences/preference-service.ts changes has been sumitted upstream ? |
|
||
export interface HostedPluginManagerExt { | ||
$initialize(contextPath: string, pluginMedata: PluginMetadata): void; | ||
$initialize(contextPath: string, pluginMetadata: PluginMetadata): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK it was me that added it with a wrong name :o
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
export function deepClone<T>(obj: T): T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use https://www.npmjs.com/package/lodash.clone ?
@@ -66,6 +66,9 @@ export class PreferenceFrontendContribution implements CommandContribution, Menu | |||
|
|||
protected async openWorkspacePreferences(): Promise<void> { | |||
const wsUri = await this.workspacePreferenceProvider.getUri(); | |||
if (!wsUri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported upstream ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already merged
eclipse-theia#2083
@@ -41,7 +48,7 @@ export abstract class AbstractResourcePreferenceProvider extends PreferenceProvi | |||
} | |||
} | |||
|
|||
abstract getUri(): MaybePromise<URI>; | |||
abstract getUri(): MaybePromise<URI | undefined>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported upstream ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already merged
const root = await this.workspaceService.root; | ||
if (root) { | ||
const rootUri = new URI(root.uri); | ||
return rootUri.resolve('.theia').resolve('settings.json'); | ||
} | ||
return new Promise<URI>(() => { }); | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported upstream ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so do you need to rebase current master branch with upstream master branch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice, but later
because I have to open another one PR for #30 (comment)
for the time being, no |
FYI I rebased this branch to the "rebased master branch" |
clonedTarget = clonedTarget ? cloneTarget : lookUp(clonedConfig, accessor); | ||
}; | ||
return isObject(target) | ||
? new Proxy(target, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to use ternary operator here, its hard to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll refactor this piece of code
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
CQ for |
packages/plugin-ext/package.json
Outdated
"@theia/monaco": "^0.3.11", | ||
"@theia/plugin": "^0.3.11", | ||
"@theia/workspace": "^0.3.11", | ||
"@types/lodash.clonedeep": "^4.5.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should @types be moved to dev dependency ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll fix it
export class PreferenceRegistryMainImpl implements PreferenceRegistryMain { | ||
private proxy: PreferenceRegistryExt; | ||
private preferenceService: PreferenceService; | ||
private preferenceServiceImpl: PreferenceServiceImpl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable uses only inside constructor. So maybe Should this constant has locale scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense, I'll fix it.
packages/plugin/API.md
Outdated
To change preference: | ||
```javascript | ||
preferences.update('tabSize', 2); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you apply doc for plugin writers how to use: onDidChangeConfiguration ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add an example how to use it.
}, | ||
onDidChangeConfiguration(listener, thisArgs?, disposables?): theia.Disposable { | ||
return preferenceRegistryExt.onDidChangeConfiguration(listener, thisArgs, disposables); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is update method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getConfiguration
returns an object with WorkspaceConfiguration
interface. There is method update
implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
* implement Preference API Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
* implement Preference API Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
* implement Preference API Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
* implement Preference API Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
resolves eclipse-che/che#9597
Signed-off-by: Oleksii Kurinnyi okurinny@redhat.com