mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1900395 - [devtools] Migrate getEditorFileMode to use the util in the source editor r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D222833
This commit is contained in:
parent
8240380ef3
commit
afd8f544e6
@ -2182,10 +2182,7 @@ function getCM(dbg) {
|
|||||||
|
|
||||||
// Gets the mode used for the file
|
// Gets the mode used for the file
|
||||||
function getEditorFileMode(dbg) {
|
function getEditorFileMode(dbg) {
|
||||||
if (isCm6Enabled) {
|
return getCMEditor(dbg).getEditorFileMode();
|
||||||
return dbg.win.document.querySelector(".cm-content").dataset.language;
|
|
||||||
}
|
|
||||||
return getCM(dbg).getOption("mode").name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCoordsFromPosition(cm, { line, ch }) {
|
function getCoordsFromPosition(cm, { line, ch }) {
|
||||||
|
@ -3100,6 +3100,15 @@ class Editor extends EventEmitter {
|
|||||||
return cm.setCursor({ line, ch: column });
|
return cm.setCursor({ line, ch: column });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used only in tests
|
||||||
|
getEditorFileMode() {
|
||||||
|
const cm = editors.get(this);
|
||||||
|
if (this.config.cm6) {
|
||||||
|
return cm.contentDOM.dataset.language;
|
||||||
|
}
|
||||||
|
return cm.getOption("mode").name;
|
||||||
|
}
|
||||||
|
|
||||||
// Used only in tests
|
// Used only in tests
|
||||||
getEditorContent() {
|
getEditorContent() {
|
||||||
const cm = editors.get(this);
|
const cm = editors.get(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user