@@ -7,57 +7,57 @@ import * as atomUtils from "./atomUtils";
7
7
import { isTransformerFile } from "../lang/transformers/transformer" ;
8
8
9
9
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
+ // });
63
63
}
0 commit comments