Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions lib/connection.coffee

This file was deleted.

76 changes: 76 additions & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
'use babel'
import { time } from './misc';
import externalTerminal from './connection/terminal';

import IPC from './connection/ipc'
import messages from './connection/messages'
import client from './connection/client'
import local from './connection/local'
import terminal from './connection/terminal'

let booting = false;
let ink;

export function activate() {
messages.activate();
client.activate();
client.boot = () => boot();
local.activate();
booting = false;
}

export function deactivate() {
client.deactivate();
}

export function consumeInk(ink_in) {
ink = ink_in;
IPC.consumeInk(ink);
}

export function consumeGetServerConfig(getconf) {
local.consumeGetServerConfig(getconf);
}

export function consumeGetServerName(name) {
local.consumeGetServerName(name);
}

export function _boot(provider) {
if (!client.isActive() && !booting) {
booting = true;
client.setBootMode(provider);

let p;
if (provider === 'External Terminal') {
p = externalTerminal.connectedRepl();
} else {
p = local.start(provider);
}

if (ink) {
ink.Opener.allowRemoteFiles(provider === 'Remote');
}
p.then(() => {
booting = false;
});
p.catch(() => {
booting = false;
});
return time("Julia Boot", client.import('ping')());
}
}

export function bootRemote() {
return _boot('Remote');
}

export function boot() {
return _boot(atom.config.get('julia-client.juliaOptions.bootMode'));
}

exports.IPC = IPC
exports.messages = messages
exports.client = client
exports.local = local
exports.terminal = terminal
2 changes: 1 addition & 1 deletion lib/package/config.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{terminal} = require '../connection'
terminal = require '../connection/terminal'

config =
juliaPath:
Expand Down
27 changes: 13 additions & 14 deletions lib/runtime/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import { CompositeDisposable } from 'atom'
import { views } from '../ui'
import { client } from '../connection'
import connection from '../connection'
import { client, boot as connection_boot } from '../connection'
import { blocks, cells, paths } from '../misc'
import modules from './modules'

Expand Down Expand Up @@ -273,53 +272,53 @@ export function debugBlock(shouldStep, cell) {
}

export function clearbps() {
connection.boot()
connection_boot()
breakpoints.clear()
if (client.isActive()) client.import('clearbps')()
}

function toggleJuliaBP (item) {
connection.boot()
connection_boot()
return client.import('toggleBP')(item)
}
function clearJulia () {
connection.boot()
connection_boot()
return client.import('clearbps')()
}
function toggleUncaughtJulia () {
connection.boot()
connection_boot()
return client.import('toggleUncaught')()
}
function toggleExceptionJulia () {
connection.boot()
connection_boot()
return client.import('toggleException')()
}
function toggleCompiled () {
connection.boot()
connection_boot()
return client.import('toggleCompiled')()
}
function getBreakpoints () {
connection.boot()
connection_boot()
return client.import('getBreakpoints')()
}
function addArgsJulia (args) {
connection.boot()
connection_boot()
return client.import('addArgs')(args)
}
function toggleAllActiveJulia (args) {
connection.boot()
connection_boot()
return client.import('toggleAllActiveBP')(args)
}
function toggleActiveJulia (item) {
connection.boot()
connection_boot()
return client.import('toggleActiveBP')(item)
}
function addCondition (item, cond) {
connection.boot()
connection_boot()
return client.import('addConditionById')(item, cond)
}
function setLevel (level) {
connection.boot()
connection_boot()
return client.import('setStackLevel')(level)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/evaluation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = require 'path'
{dialog, BrowserWindow} = require('electron').remote

{client} = require '../connection'
client = require '../connection/client'
{notifications, views, selector, docpane} = require '../ui'
{paths, blocks, cells, words, weave} = require '../misc'
{processLinks} = require '../ui/docs'
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/modules.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{CompositeDisposable, Disposable, Emitter} = require 'atom'
{debounce} = require 'underscore-plus'

{client} = require '../connection'
client = require '../connection/client'
{show} = require '../ui/selector'

{module: getmodule, allmodules, ismodule} = client.import ['module', 'allmodules', 'ismodule']
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/workspace.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{CompositeDisposable} = require 'atom'

{client} = require '../connection'
client = require '../connection/client'
{views} = require '../ui'
goto = require './goto'
modules = require './modules'
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/progress.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{CompositeDisposable} = require 'atom'
{client} = require '../connection'
client = require '../connection/client'
{formatTimePeriod} = require '../misc'

module.exports =
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Highlighter = require './highlighter'

{client} = require '../connection'
client = require '../connection/client'
{once} = require '../misc'

getlazy = client.import 'getlazy'
Expand Down