From 18c2bda9003663fc043b5241b5220e79db87a0c3 Mon Sep 17 00:00:00 2001 From: Reyshawn Date: Tue, 18 Jun 2019 12:00:58 +0800 Subject: [PATCH 1/2] Fix DeprecationWarning: REPLServer.rli is deprecated --- config/NodeJS/repl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/NodeJS/repl.js b/config/NodeJS/repl.js index fd39e685..cdf23c11 100644 --- a/config/NodeJS/repl.js +++ b/config/NodeJS/repl.js @@ -3,7 +3,7 @@ var repl = require('repl'); var rep = repl.start({ - prompt: null, //'> ', + prompt: '> ', //'> ', source: null, //process.stdin, eval: null, //require('vm').runInThisContext, useGlobal: true, //false @@ -32,7 +32,7 @@ var payload = msg.length + ":" + msg + ","; client.write(payload) } - rep.rli.completer(inData.line, send); + rep.completer(inData.line, send); }); })(); From 1c7305290a2e53546e62096bcb718c33c0e851c7 Mon Sep 17 00:00:00 2001 From: Reyshawn Date: Fri, 22 May 2020 10:39:55 +0800 Subject: [PATCH 2/2] Add `repl_swift` command and also: 1. Use `python3` instead of `python` in the macOS; --- config/Python/Main.sublime-menu | 12 +++++------ config/Swift/Default.sublime-commands | 10 +++++++++ config/Swift/Main.sublime-menu | 29 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 config/Swift/Default.sublime-commands create mode 100644 config/Swift/Main.sublime-menu diff --git a/config/Python/Main.sublime-menu b/config/Python/Main.sublime-menu index bfb724a8..06562d44 100644 --- a/config/Python/Main.sublime-menu +++ b/config/Python/Main.sublime-menu @@ -19,7 +19,7 @@ "args": { "type": "subprocess", "encoding": "utf8", - "cmd": ["python", "-i", "-u"], + "cmd": ["python3", "-i", "-u"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", @@ -36,7 +36,7 @@ "args": { "type": "subprocess", "encoding": "utf8", - "cmd": ["python", "-i", "-u", "-m", "pdb", "$file_basename"], + "cmd": ["python3", "-i", "-u", "-m", "pdb", "$file_basename"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", @@ -50,7 +50,7 @@ "args": { "type": "subprocess", "encoding": "utf8", - "cmd": ["python", "-u", "$file_basename"], + "cmd": ["python3", "-u", "$file_basename"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", @@ -66,9 +66,9 @@ "encoding": "utf8", "autocomplete_server": true, "cmd": { - "osx": ["python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"], - "linux": ["python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"], - "windows": ["python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"] + "osx": ["python3", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"], + "linux": ["python3", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"], + "windows": ["python3", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"] }, "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", diff --git a/config/Swift/Default.sublime-commands b/config/Swift/Default.sublime-commands new file mode 100644 index 00000000..3e3182d5 --- /dev/null +++ b/config/Swift/Default.sublime-commands @@ -0,0 +1,10 @@ +[ + { + "caption": "SublimeREPL: Swift", + "command": "run_existing_window_command", + "args": { + "id": "repl_swift", + "file": "config/Swift/Main.sublime-menu" + } + } +] \ No newline at end of file diff --git a/config/Swift/Main.sublime-menu b/config/Swift/Main.sublime-menu new file mode 100644 index 00000000..1d375733 --- /dev/null +++ b/config/Swift/Main.sublime-menu @@ -0,0 +1,29 @@ +[ + { + "id": "tools", + "children": + [{ + "caption": "SublimeREPL", + "mnemonic": "r", + "id": "SublimeREPL", + "children": + [ + {"command": "repl_open", + "caption": "Swift", + "id": "repl_swift", + "args": { + "type": "subprocess", + "external_id": "swift", + "encoding": "utf8", + "cmd": { + "osx": ["swift"] + }, + "cwd": "$file_path", + "additional_scopes": ["swift"], + "syntax": "Packages/Swift/Syntaxes/Swift.tmLanguage" + } + } + ] + }] + } +] \ No newline at end of file