Targeted fix for saving issue on MacOS (#9073)

* Create a targeted fix

* Add sql carbon edit
This commit is contained in:
Amir Omidi
2020-02-06 16:22:21 -08:00
committed by GitHub
parent 6da98ed439
commit 6fe49e8cef
2 changed files with 4 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ export class QueryEditorService implements IQueryEditorService {
let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath }); let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath });
// Create a sql document pane with accoutrements // Create a sql document pane with accoutrements
const fileInput = this._untitledEditorService.create({ associatedResource: docUri, mode: 'sql' }); const fileInput = this._untitledEditorService.create({ untitledResource: docUri, mode: 'sql' });
let untitledEditorModel = await fileInput.resolve(); let untitledEditorModel = await fileInput.resolve();
if (sqlContent) { if (sqlContent) {
untitledEditorModel.textEditorModel.setValue(sqlContent); untitledEditorModel.textEditorModel.setValue(sqlContent);
@@ -87,7 +87,7 @@ export class QueryEditorService implements IQueryEditorService {
let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath }); let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath });
// Create a sql document pane with accoutrements // Create a sql document pane with accoutrements
const fileInput = this._untitledEditorService.create({ associatedResource: docUri, mode: 'sql' }); const fileInput = this._untitledEditorService.create({ untitledResource: docUri, mode: 'sql' });
const m = await fileInput.resolve(); const m = await fileInput.resolve();
//when associatedResource editor is created it is dirty, this must be set to false to be able to detect changes to the editor. //when associatedResource editor is created it is dirty, this must be set to false to be able to detect changes to the editor.
m.setDirty(false); m.setDirty(false);

View File

@@ -572,7 +572,8 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
} }
// Finally fallback to suggest just the file name // Finally fallback to suggest just the file name
return toLocalResource(resource.with({ path: suggestedFilename }), remoteAuthority); // {{SQL CARBON EDIT}} - Rationale: this seems to be a bug we picked up from a vscode merge. This should get fixed with a new merge in the future.
return joinPath(this.fileDialogService.defaultFilePath() || URI.file(this.environmentService.userHome), suggestedFilename);
} }
//#endregion //#endregion