【问题标题】:SublimeRepl New Repl "No Repl for 'sql' "SublimeRepl 新的 Repl “没有 'sql' 的 Repl”
【发布时间】:2016-05-09 08:45:30
【问题描述】:

我正在尝试使用 Sublime Repl 为 Postgres 设置 Sublime Text Repl。

我在Users/Packages/SublimeRepl/config 中建立了一个名为Postgres 的新文件夹并添加了两个文件:

Main.sublime-menu有以下内容

[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "R",
            "id": "SublimeREPL",
            "children":
            [
                {"command": "repl_open", 
                 "caption": "PSQL",
                 "id": "repl_psql",
                 "mnemonic": "Q",
                 "args": {
                    "type": "subprocess",
                    "encoding": {"windows": "$win_cmd_encoding",
                                 "linux": "utf-8",
                                 "osx": "utf-8"},
                    "cmd": {"windows": ["psql.exe", "-a"],
                            "linux": ["psql","-U","tahnoon"],
                            "osx": ["psql","-U","tahnoon"]},
                    "cwd": "$file_path",
                    "cmd_postfix": "\n", 
                    "env": {},
                    "suppress_echo": false, 
                    "syntax": "Packages/SQL/SQL.tmLanguage"
                    }
                }
            ]   
        }]
    }
]

Default.sublime-commands有以下内容

[
    {
        "caption": "SublimeREPL: PSQL",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_psql",
            "file": "config/Postgres/Main.sublime-menu"
        }
    }
]

如果我启动一个 repl 并尝试从名为 test.sql 的文件中使用 Ctrl+,F 进行 Eval,我会收到一条错误消息 Cannot Find Repl for 'sql'

我做错了什么?

【问题讨论】:

  • 你试过"id": "repl_sql"而不是"repl_psql"吗?
  • 嗨@MattDMo - 感谢您的回复。我做了并且还尝试将文件保存为 test.psql - 两者都没有效果。相同的错误信息

标签: postgresql sublimetext3 sublimerepl


【解决方案1】:

发现以下键值对 "external_id":"sql" 可以解决问题:

[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "R",
            "id": "SublimeREPL",
            "children":
            [
                {"command": "repl_open", 
                 "caption": "PSQL",
                 "id": "repl_sql",
                 "mnemonic": "Q",
                 "args": {
                    "type": "subprocess",
                    "encoding": {"windows": "$win_cmd_encoding",
                                 "linux": "utf-8",
                                 "osx": "utf-8"},
                    "cmd": {"windows": ["psql.exe","-U","tahnoon"],
                            "linux": ["psql","-U","tahnoon"],
                            "osx": ["psql","-U","tahnoon"]},
                    "cwd": "$file_path",
                    "cmd_postfix": "\n", 
                    "cwd": "$file_path",
                    "external_id": "sql",
                    "suppress_echo": false, 
                    "syntax": "Packages/SQL/SQL.tmLanguage"
                    }
                }
            ]   
        }]
    }
]

【讨论】:

    猜你喜欢
    • 2013-11-26
    • 1970-01-01
    • 2016-10-29
    • 1970-01-01
    • 2012-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-18
    相关资源
    最近更新 更多