Skip to content

Commit 3f21677

Browse files
committed
chore(quickfix) DISABLE the light bulb for now
closes #772
1 parent 721d324 commit 3f21677

File tree

2 files changed

+53
-95
lines changed

2 files changed

+53
-95
lines changed

dist/main/atom/editorSetup.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,4 @@
11
"use strict";
2-
var utils_1 = require("../lang/utils");
3-
var parent = require("../../worker/parent");
4-
var atomUtils = require("./atomUtils");
5-
var transformer_1 = require("../lang/transformers/transformer");
62
function setupEditor(editor) {
7-
var quickFixDecoration = null;
8-
var quickFixMarker = null;
9-
function clearExistingQuickfixDecoration() {
10-
if (quickFixDecoration) {
11-
quickFixDecoration.destroy();
12-
quickFixDecoration = null;
13-
}
14-
if (quickFixMarker) {
15-
quickFixMarker.destroy();
16-
quickFixMarker = null;
17-
}
18-
}
19-
var queryForQuickFix = utils_1.debounce(function (filePathPosition) {
20-
parent.getQuickFixes(filePathPosition).then(function (res) {
21-
clearExistingQuickfixDecoration();
22-
if (res.fixes.length) {
23-
quickFixMarker = editor.markBufferRange(editor.getSelectedBufferRange());
24-
quickFixDecoration = editor.decorateMarker(quickFixMarker, { type: "line-number", class: "quickfix" });
25-
}
26-
});
27-
}, 500);
28-
var cursorObserver = editor.onDidChangeCursorPosition(function () {
29-
try {
30-
var pathPos = atomUtils.getFilePathPosition();
31-
if (transformer_1.isTransformerFile(pathPos.filePath)) {
32-
clearExistingQuickfixDecoration();
33-
return;
34-
}
35-
queryForQuickFix(pathPos);
36-
}
37-
catch (ex) {
38-
clearExistingQuickfixDecoration();
39-
}
40-
});
41-
var destroyObserver = editor.onDidDestroy(function () {
42-
cursorObserver.dispose();
43-
destroyObserver.dispose();
44-
});
453
}
464
exports.setupEditor = setupEditor;

lib/main/atom/editorSetup.ts

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,57 @@ import * as atomUtils from "./atomUtils";
77
import {isTransformerFile} from "../lang/transformers/transformer";
88

99
export function setupEditor(editor: AtomCore.IEditor) {
10-
11-
// Quick fix decoration stuff
12-
var quickFixDecoration: AtomCore.Decoration = null;
13-
var quickFixMarker: any = null;
14-
function clearExistingQuickfixDecoration() {
15-
if (quickFixDecoration) {
16-
quickFixDecoration.destroy();
17-
quickFixDecoration = null;
18-
}
19-
if (quickFixMarker) {
20-
quickFixMarker.destroy();
21-
quickFixMarker = null;
22-
}
23-
}
24-
var queryForQuickFix = debounce((filePathPosition:{filePath:string;position:number}) => {
25-
parent.getQuickFixes(filePathPosition).then(res=> {
26-
clearExistingQuickfixDecoration();
27-
if (res.fixes.length) {
28-
quickFixMarker = editor.markBufferRange(editor.getSelectedBufferRange());
29-
quickFixDecoration = editor.decorateMarker(quickFixMarker,
30-
{ type: "line-number", class: "quickfix" });
31-
}
32-
})
33-
}, 500);
34-
var cursorObserver = editor.onDidChangeCursorPosition(() => {
35-
try {
36-
// This line seems to throw an exception sometimes.
37-
// https://github.com/TypeStrong/atom-typescript/issues/325
38-
// https://github.com/TypeStrong/atom-typescript/issues/310
39-
let pathPos = atomUtils.getFilePathPosition();
40-
41-
// TODO: implement quickfix logic for transformed files
42-
if (isTransformerFile(pathPos.filePath)) {
43-
clearExistingQuickfixDecoration();
44-
return;
45-
}
46-
47-
queryForQuickFix(pathPos);
48-
}
49-
catch (ex) {
50-
clearExistingQuickfixDecoration();
51-
}
52-
});
53-
54-
55-
/**
56-
* On final dispose
57-
*/
58-
var destroyObserver = editor.onDidDestroy(() => {
59-
// Clear editor observers
60-
cursorObserver.dispose();
61-
destroyObserver.dispose();
62-
});
10+
//
11+
// // Quick fix decoration stuff
12+
// var quickFixDecoration: AtomCore.Decoration = null;
13+
// var quickFixMarker: any = null;
14+
// function clearExistingQuickfixDecoration() {
15+
// if (quickFixDecoration) {
16+
// quickFixDecoration.destroy();
17+
// quickFixDecoration = null;
18+
// }
19+
// if (quickFixMarker) {
20+
// quickFixMarker.destroy();
21+
// quickFixMarker = null;
22+
// }
23+
// }
24+
// var queryForQuickFix = debounce((filePathPosition:{filePath:string;position:number}) => {
25+
// parent.getQuickFixes(filePathPosition).then(res=> {
26+
// clearExistingQuickfixDecoration();
27+
// if (res.fixes.length) {
28+
// quickFixMarker = editor.markBufferRange(editor.getSelectedBufferRange());
29+
// quickFixDecoration = editor.decorateMarker(quickFixMarker,
30+
// { type: "line-number", class: "quickfix" });
31+
// }
32+
// })
33+
// }, 500);
34+
// var cursorObserver = editor.onDidChangeCursorPosition(() => {
35+
// try {
36+
// // This line seems to throw an exception sometimes.
37+
// // https://github.com/TypeStrong/atom-typescript/issues/325
38+
// // https://github.com/TypeStrong/atom-typescript/issues/310
39+
// let pathPos = atomUtils.getFilePathPosition();
40+
//
41+
// // TODO: implement quickfix logic for transformed files
42+
// if (isTransformerFile(pathPos.filePath)) {
43+
// clearExistingQuickfixDecoration();
44+
// return;
45+
// }
46+
//
47+
// queryForQuickFix(pathPos);
48+
// }
49+
// catch (ex) {
50+
// clearExistingQuickfixDecoration();
51+
// }
52+
// });
53+
//
54+
//
55+
// /**
56+
// * On final dispose
57+
// */
58+
// var destroyObserver = editor.onDidDestroy(() => {
59+
// // Clear editor observers
60+
// cursorObserver.dispose();
61+
// destroyObserver.dispose();
62+
// });
6363
}

0 commit comments

Comments
 (0)