mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix editor URI when properties are set in extension (#2360)
* Actually fix editorUri property - Fix by always setting on property update, otherwise it can be lost. * Add comment
This commit is contained in:
@@ -80,7 +80,7 @@ export default class EditorComponent extends ComponentBase implements IComponent
|
|||||||
let uri = URI.from({ scheme: Schemas.untitled, path: `${this.descriptor.type}-${this.descriptor.id}` });
|
let uri = URI.from({ scheme: Schemas.untitled, path: `${this.descriptor.type}-${this.descriptor.id}` });
|
||||||
// Use this to set the internal (immutable) and public (shared with extension) uri properties
|
// Use this to set the internal (immutable) and public (shared with extension) uri properties
|
||||||
this._uri = uri.toString();
|
this._uri = uri.toString();
|
||||||
this.uri = this._uri;
|
this.editorUri = this._uri;
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,8 @@ export default class EditorComponent extends ComponentBase implements IComponent
|
|||||||
if (this.languageMode !== this._languageMode) {
|
if (this.languageMode !== this._languageMode) {
|
||||||
this.updateLanguageMode();
|
this.updateLanguageMode();
|
||||||
}
|
}
|
||||||
// Intentionally not setting URI for now as it is readonly.
|
// Intentionally always updating editorUri as it's wiped out by parent setProperties call.
|
||||||
|
this.editorUri = this._uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSS-bound properties
|
// CSS-bound properties
|
||||||
@@ -161,11 +162,11 @@ export default class EditorComponent extends ComponentBase implements IComponent
|
|||||||
this.setPropertyFromUI<sqlops.EditorProperties, string>((properties, position) => { properties.position = position; }, newValue);
|
this.setPropertyFromUI<sqlops.EditorProperties, string>((properties, position) => { properties.position = position; }, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get uri(): string {
|
public get editorUri(): string {
|
||||||
return this.getPropertyOrDefault<sqlops.EditorProperties, string>((props) => props.editorUri, '');
|
return this.getPropertyOrDefault<sqlops.EditorProperties, string>((props) => props.editorUri, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public set uri(newValue: string) {
|
public set editorUri(newValue: string) {
|
||||||
this.setPropertyFromUI<sqlops.EditorProperties, string>((properties, editorUri) => { properties.editorUri = editorUri; }, newValue);
|
this.setPropertyFromUI<sqlops.EditorProperties, string>((properties, editorUri) => { properties.editorUri = editorUri; }, newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user