mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-18 18:46:47 -05:00
disable updateNameFromFirstLine from untitledTextEditorModel (#9064)
* disable updateNameFromFirstLine * change to either * WIP commit * final fix * formatting * fix for tab space * replace tab with space * Fix formatting Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -510,15 +510,15 @@ class ResourceLabelWidget extends IconLabel {
|
||||
}
|
||||
|
||||
let label = this.label.name || '';
|
||||
if (resource?.scheme === Schemas.untitled) {
|
||||
// Untitled labels are very dynamic because they may change
|
||||
// whenever the content changes. As such we always ask the
|
||||
// text file service for the name of the untitled editor
|
||||
const untitledName = this.textFileService.untitled.get(resource)?.getName();
|
||||
if (untitledName) {
|
||||
label = untitledName;
|
||||
}
|
||||
}
|
||||
// if (resource?.scheme === Schemas.untitled) { // {{SQL CARBON EDIT}} - For Query Editor, untitled editor query must use same label.
|
||||
// // Untitled labels are very dynamic because they may change
|
||||
// // whenever the content changes. As such we always ask the
|
||||
// // text file service for the name of the untitled editor
|
||||
// const untitledName = this.textFileService.untitled.get(resource)?.getName();
|
||||
// if (untitledName) {
|
||||
// label = untitledName;
|
||||
// }
|
||||
// }
|
||||
|
||||
this.setLabel(label, this.label.description, iconLabelOptions);
|
||||
|
||||
|
||||
@@ -242,9 +242,9 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt
|
||||
}
|
||||
|
||||
private updateNameFromFirstLine(): void {
|
||||
if (this.hasAssociatedFilePath) {
|
||||
return; // not in case of an associated file path
|
||||
}
|
||||
// if (this.hasAssociatedFilePath) { {{SQL CARBON EDIT}} - For Query Editor, must not change name even without file path.
|
||||
return;
|
||||
// }
|
||||
|
||||
// Determine the first words of the model following these rules:
|
||||
// - cannot be only whitespace (so we trim())
|
||||
|
||||
@@ -303,7 +303,7 @@ suite('Workbench untitled text editors', () => {
|
||||
model.dispose();
|
||||
});
|
||||
|
||||
test('service#onDidChangeLabel', async () => {
|
||||
test.skip('service#onDidChangeLabel', async () => { // {{SQL CARBON EDIT}} - Disable as untitledTextEditorModel test is disabled.
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const input = service.create();
|
||||
|
||||
@@ -383,7 +383,7 @@ suite('Workbench untitled text editors', () => {
|
||||
assert.ok(counter > 1);
|
||||
});
|
||||
|
||||
test('model#onDidChangeName and input name', async function () {
|
||||
test.skip('model#onDidChangeName and input name', async function () { // {{SQL CARBON EDIT}} - Disable as untitledTextEditorModel test is disabled.
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const input = service.create();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user