Commit caa1ccfb authored by Denys Mishunov's avatar Denys Mishunov

Renamed 'diff' to 'isDiff'

Done to highlight its boolean nature. As per review
parent 8a9e379a
...@@ -110,7 +110,7 @@ export default class EditorLite { ...@@ -110,7 +110,7 @@ export default class EditorLite {
blobOriginalContent, blobOriginalContent,
blobGlobalId, blobGlobalId,
instance, instance,
diff, isDiff,
} = {}) { } = {}) {
if (!instance) { if (!instance) {
return null; return null;
...@@ -119,7 +119,7 @@ export default class EditorLite { ...@@ -119,7 +119,7 @@ export default class EditorLite {
const uri = Uri.file(uriFilePath); const uri = Uri.file(uriFilePath);
const existingModel = monacoEditor.getModel(uri); const existingModel = monacoEditor.getModel(uri);
const model = existingModel || monacoEditor.createModel(blobContent, undefined, uri); const model = existingModel || monacoEditor.createModel(blobContent, undefined, uri);
if (!diff) { if (!isDiff) {
instance.setModel(model); instance.setModel(model);
return model; return model;
} }
...@@ -198,12 +198,12 @@ export default class EditorLite { ...@@ -198,12 +198,12 @@ export default class EditorLite {
blobOriginalContent = '', blobOriginalContent = '',
blobGlobalId = uuids()[0], blobGlobalId = uuids()[0],
extensions = [], extensions = [],
diff = false, isDiff = false,
...instanceOptions ...instanceOptions
} = {}) { } = {}) {
EditorLite.prepareInstance(el); EditorLite.prepareInstance(el);
const createEditorFn = diff ? 'createDiffEditor' : 'create'; const createEditorFn = isDiff ? 'createDiffEditor' : 'create';
const instance = EditorLite.convertMonacoToELInstance( const instance = EditorLite.convertMonacoToELInstance(
monacoEditor[createEditorFn].call(this, el, { monacoEditor[createEditorFn].call(this, el, {
...this.options, ...this.options,
...@@ -219,7 +219,7 @@ export default class EditorLite { ...@@ -219,7 +219,7 @@ export default class EditorLite {
blobPath, blobPath,
blobContent, blobContent,
instance, instance,
diff, isDiff,
}); });
} }
...@@ -237,7 +237,7 @@ export default class EditorLite { ...@@ -237,7 +237,7 @@ export default class EditorLite {
createDiffInstance(args) { createDiffInstance(args) {
return this.createInstance({ return this.createInstance({
...args, ...args,
diff: true, isDiff: true,
}); });
} }
......
...@@ -178,7 +178,7 @@ describe('Base editor', () => { ...@@ -178,7 +178,7 @@ describe('Base editor', () => {
editor.createDiffInstance(); editor.createDiffInstance();
expect(spy).toHaveBeenCalledWith( expect(spy).toHaveBeenCalledWith(
expect.objectContaining({ expect.objectContaining({
diff: true, isDiff: true,
}), }),
); );
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment