File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ EndProject
1111Project ("{2150E333-8FDC-42A3-9474-1A3956D46DE8}" ) = "src" , "src" , "{176D5273-0AF5-44A6-894C-F057F13F3391}"
1212 Project Section (SolutionItems ) = preProject
1313 src \atom -bindings .fsx = src \atom -bindings .fsx
14- src \autocomplete .fsx = src \autocomplete .fsx
14+ src \core .fsx = src \core .fsx
1515 src \funscript -atom .fsx = src \funscript -atom .fsx
1616 EndProject Section
1717EndProject
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ let t = match foobar with
1212 | 1 -> 0
1313
1414let t = System.IO.Directory
15- let a = System.IO.D
15+ let a = System.IO.DriveInfo.GetDrives ()
Original file line number Diff line number Diff line change @@ -23,3 +23,12 @@ module Promise =
2323module JS =
2424 [<JSEmitInline( " ({1}[{0}])" ) >]
2525 let getProperty < 'T > ( prop : string ) ( o : obj ) : 'T = failwith " JS"
26+
27+ [<JSEmitInline( " ({0}[{1}] != undefined)" ) >]
28+ let isPropertyDefined ( o : obj ) ( key : string ) : bool = failwith " JS"
29+
30+ [<JSEmitInline( " (global[{0}] != undefined)" ) >]
31+ let isGloballyDefined ( key : string ) : bool = failwith " never"
32+
33+ [<JSEmitInline( " ({0} != undefined)" ) >]
34+ let isDefined ( o : obj ) : bool = failwith " never"
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ open FunScript.TypeScript.text_buffer
1010#load " funscript-atom.fsx"
1111#load " atom-bindings.fsx"
1212
13- // open Atom
13+ open Atom
1414//open Atom.Editor
1515//open Atom.Promise
1616
@@ -95,7 +95,7 @@ module AutocompleteHandler =
9595 service |> AutocompleteService.ask str 2 cb
9696
9797 let parseEditor ( editor : IEditor ) cb service =
98- if editor.getGrammar() .name = " F#" then
98+ if JS.isDefined editor && JS.isPropertyDefined editor " getGrammar " && editor.getGrammar() .name = " F#" then
9999 let path = editor.buffer.file.path
100100 let text = editor.getText()
101101 let action ( s : string ) =
@@ -214,7 +214,7 @@ module Views =
214214 |> jq
215215
216216 let hadnleEditorChange ( panel : IPanel ) ( editor : AtomCore.IEditor ) =
217- if editor.getGrammar() .name = " F#" then panel.show() else panel.hide()
217+ if JS.isDefined editor && JS.isPropertyDefined editor " getGrammar " && editor.getGrammar() .name = " F#" then panel.show() else panel.hide()
218218
219219 type PanelOptions =
220220 { item: JQuery ;
You can’t perform that action at this time.
0 commit comments