Giter Club home page Giter Club logo

slyblime's Introduction

      ___           ___       ___           ___           ___                   ___           ___     
     /\  \         /\__\     |\__\         /\  \         /\__\      ___        /\__\         /\  \    
    /::\  \       /:/  /     |:|  |       /::\  \       /:/  /     /\  \      /::|  |       /::\  \   
   /:/\ \  \     /:/  /      |:|  |      /:/\:\  \     /:/  /      \:\  \    /:|:|  |      /:/\:\  \  
  _\:\~\ \  \   /:/  /       |:|__|__   /::\~\:\__\   /:/  /       /::\__\  /:/|:|__|__   /::\~\:\  \ 
 /\ \:\ \ \__\ /:/__/        /::::\__\ /:/\:\ \:|__| /:/__/     __/:/\/__/ /:/ |::::\__\ /:/\:\ \:\__\
 \:\ \:\ \/__/ \:\  \       /:/~~/~    \:\~\:\/:/  / \:\  \    /\/:/  /    \/__/~~/:/  / \:\~\:\ \/__/
  \:\ \:\__\    \:\  \     /:/  /       \:\ \::/  /   \:\  \   \::/__/           /:/  /   \:\ \:\__\  
   \:\/:/  /     \:\  \    \/__/         \:\/:/  /     \:\  \   \:\__\          /:/  /     \:\ \/__/  
    \::/  /       \:\__\                  \::/__/       \:\__\   \/__/         /:/  /       \:\__\    
     \/__/         \/__/                   ~~            \/__/                 \/__/         \/__/    

ko-fi

Slyblime is Sylvester the Cat's Common Lisp IDE for Sublime Text 4:

Slyblime is an implementation of SLY and uses the same backend (SLYNK).

Currently it includes:

  • REPL integration including backtracking
  • Autocomplete and documentation
  • References, disassembly, macroexpansion etc.
  • Inspection support
  • Tracing support
  • Compilation support with notes
  • Multiple connexions
  • Debugger including stack frame inspection
  • NEW! Ability to open an inferior Lisp directly from the editor!

The primary missing feature is the ability to use stickers from Sly.

Installation

First install SublimeREPL and this plugin. Use Package Control to install them, or download and unzip the plugins in your packages folder. Then type Sly: Upgrade SublimeREPL to work with Sly into the command palette. Finally, to get started just run Sly: Start and connect to an inferior Lisp instance in the command palette (you may need to change the default lisp program in the settings).

Obligatory animated GIFs section

Flex Completion

Flex Completion

Backreferences

Backreferences

Usage

Make sure to install SublimeREPL (via Package Control) and then running Sly: Upgrade SublimeREPL to work with Sly into the command palette before attempting to use Slyblime!

Using an inferior Lisp

Go to the settings and set the inferior lisp command to what you want (by default it's lisp). After that run Sly: Start and connect to an inferior Lisp instance to start a inferior lisp and REPL.

External connexion

To connect to a Slynk instance run Sly: Connect to slynk using the command palette. Make sure to use the included Lisp+ syntax for all the features to work correctly.

Pathname translation

To use pathname translation, create file Sublime Text/Packages/User/slyblime/filename_translators.py. Then at the top add from slyblime.filename_translation import *. A pathname translator is any class definition which extends the (slyblime.filename_translation.)PathnameTranslator abstract class as follows:

class PathnameTranslator():
    # Tells Slyblime if the translator should be offered for the current connexion
    def is_active(self, session: SlynkSession) -> bool
    def local_to_remote(self, pathname: str) -> str
    def remote_to_local(self, pathname: str) -> str
    # A two line description of the translator for the selection menu
    description: Tuple[str, str]
``` For most cases, it is preferable to use extend the (`slyblime.filename_translation.`)`SimpleTranslator` abstract class:
```python
class SimpleTranslator(PathnameTranslator):
    local_stem:str
    remote_stem:str
    def is_active(self, session: SlynkSession) -> bool
``` where a bijection is created such that path "`local_stem`/*A*" ≃ "`remote_stem`/*A*".

## Developping

The recommended way to develop is to clone this repo somewhere, then symlink the `src` folder to the Sublime packages folder and symlink the `sly` submodule folder into the `src` folder. While this may seem convolouted, this allows almost all files to remain toplevel in the package folder which means that Sublime Text will reload them upon modification, speeding up editing speed.

## Copying

See [COPYING.md](COPYING.md), but tl;dr GPL.

## Contributing

Open an issue or a pull request.

slyblime's People

Contributors

s-clerc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

slyblime's Issues

eof on slynk

Thanks for your extension.
I'm getting disconnected when writing autoclosed quotes or double-quotes (just press the quote, not evaluating it).

image

CL-USER⟩ (format "")
image

CL-USER(2): ;; slynk:close-connection: eof encountered on stream
#<STRING-INPUT-SIMPLE-STREAM "" @ #x102047b1012>
;; closing 1 channels
;; closing 0 listeners

Poor error messages in debugger

Hey there, big fan of this amazing plugin.

I just wanted to ask about something fairly basic - when I hit an error, the debugger popups up and takes over my sublime text, but doesn't actually tell me what the issue is. Here's what copy all supplies (and is what's on the screen)

COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "tides" "tides">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR] in thread 6
Restarts:
	【0】RETRY: Retry compiling #<CL-SOURCE-FILE "tides" "tides">.
	【1】ACCEPT: Continue, treating compiling #<CL-SOURCE-FILE "tides" "tides"> as having been successful.
	【2】RETRY: Retry ASDF operation.
	【3】CLEAR-CONFIGURATION-AND-RETRY: Retry ASDF operation after resetting the configuration.
	【4】RETRY: Retry ASDF operation.
	【5】CLEAR-CONFIGURATION-AND-RETRY: Retry ASDF operation after resetting the configuration.
	【6】ABORT: Give up on "tides"
	【7】RETRY: Retry SLY mREPL evaluation request.
	【8】*ABORT: Return to SLY's top level.
	【9】ABORT: abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1001E904D3}>)
Backtrace
:	【0】(UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "tides" "tides">)))
	【1】((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "tides" "tides">)
	【2】((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
	【3】((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "tides" "tides">) [fast-method]
	【4】((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1003735153}>) [fast-method]
	【5】((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
	【6】((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1003735153}>) [fast-method]
	【7】((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "tides"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
	【8】((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "tides"> :VERBOSE NIL)
	【9】((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
	【10】((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "tides"> :VERBOSE NIL) [fast-method]
	【11】((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "tides" :VERBOSE NIL)
	【12】((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
	【13】((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "tides" :VERBOSE NIL) [fast-method]
	【14】(ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10037330DB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
	【15】((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
	【16】(ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100372D05B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
	【17】((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "tides" :VERBOSE NIL) [fast-method]
	【18】(ASDF/OPERATE:LOAD-SYSTEM "tides" :VERBOSE NIL)
	【19】(QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<CLOSURE (LAMBDA NIL :IN QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) {100372CE5B}>)

But... here's the actual error (which is in the REPL, which I have to switch to):

 caught ERROR:
;   READ error during COMPILE-FILE:
;   
;     Symbol "MAKE-GPU-ARRAY" not found in the VARI package.
;   
;       Line: 50, Column: 36, File-Position: 917
;   
;       Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/ashe/Documents/tides/src/tides.lisp" {1004A1BFF3}>

I understand that the debugger has a slightly different purpose, however, it is frustrating that I have to switch to the REPL, read the error, then go back to the debugger to respond to it. It's just not very user friendly as the error messages supplied can be a little scary!

Big fan of the plugin though! :)

Frequently complains about type-error while typing a string.

Thank you for your work, this is a brilliant plugin, and really best-in-class for anything not Emacs.

I keep encountering the Type error condition: e.g. when typing (print "Hey"), it'll error on each letter.

AFAICT this error is coming from the matching ?

I'm running against a Lispworks instance, if that matters.

Here's an example:

Image 6-8-22

can't connect to Slynk

I am on MacBook Pro M1 Max running Ventura. Up to date Sublime Text 4.

Installed the Slyblime plugin. Ran upgrade to Python 3.8, which seemed to complete successfully.

Changed settings for inferior lisp to:

"inferior_lisp_process": {
"command": ["sbcl"],
"autoclose": true,
"loading_time": 3,
"setup_time": 3
},
Then run Sly: Start and connect to an inferior lisp instance.

It's hard to tell if anything happens. There is no feedback at all in the sublime UI that anything has happened. Activity Monitor shows that an sbcl instance has started.

Then in a tiny little .lisp file I try to run from the context menu: Sly/Compile top-level at cursor. Status bar says "Slynk not connected." Is there some way to tell if installing the plugin really installed Slynk. I am not very good at sbcl yet so I don't know what to run in sbcl to see what is running. I has asdf but don't know if that will tell me anything.

Since everything depends on Slynk nothing at all works.

Note: I have since used quicklisp to install slynk from within sbcl. I try to start it. Then switch to Sublime and still can't connect.

I have no idea how to diagnose this.

Doesn't work on Windows

Hello. Unfortunately, the plugin does not work under Windows because it handles the path for the Sly file to load incorrectly here:

2023-09-26-120132_2044x571_scrot

I've tried fixing that, but there is some other problem — after calling slynk-loader:init and/or slynk:create-server here everything just gets stuck, and SBCL does not open the server connection. @s-clerc do you mind lending me a hand with this?

Indentation integration

Either

  • we fork lisp-indent and make it accept a regex/list
  • we take lisp-indent's code and copy it into Slys and do whatever
  • write a new solution

Allow copy / pasting of errors when debugging?

If I get an error in the REPL, I get it all in the terminal and it can be easily copied and pasted (I'm a beginner so I tend to be copying and pasting my errors when I'm receiving help). I love your interactive debugging process and it's amazing! But I do think a dump of the error how it would be presented in the REPL at the bottom of the page would be useful just when you do want to copy and paste?

If there is a way to copy and paste it, maybe it needs to be explained on the readme for new users? :) Thank you!

Cannot run `Connect to Slynk` command

Although having already installed both SublimeREPL and Slyblime on Sublime, I cannot run Sly: Connect to slynk command on the command palette of Sublime.

Install instructions don't work

I have SublimeREPL installed, but after I typed Sly: Upgrade SublimeREPL to work with Sly in the command palette, nothing happened. Anything that I'm missing?

Let me know about Slynk problems

Not a bug, SLY's author here. I think this project is interesting, even though it will inhibit some design decisions on SLY's side. This is not a bad thing. If you come across any API difficulties or Emacs-specific stuff, let me know in the SLY bug tracker. Maybe this could be the kickoff for making Slynk a standalone package once and for all.

Repl backtrack highlighting

Ideally using phantoms, perhaps we store a record of all the previous output so we can determine their positions.

Perhaps we also add a configurable limit to the number of values stored (e.g. 25 ?)

Failed to start Lisp process

Hi, I have installed SublimeRepl and slyblime on Sublime Text 4 (build 4101) on Windows 10.
I also ran Sly: Upgrade SublimeREPL to work with Sly.
I set the Inferior lisp command to sbcl --load as I am using sbcl.
Then, I tried running Sly: Start and connect to an inferior Lisp instance.
But, I got an error:
img
How do I fix this ?

Race condition with `:read-mode`

It seems like for some reason, there is a desynchronisation between setting the read-mode and receiving input, and eventually Slynk decides it just wants to show a prompt and then we have a problem but I'm not exactly clear why.

How to reproduce:

  1. Start any function which continually demands (read-line) and keeps demanding it on no-input
  2. Press and hold enter until the error appears.

Log files:

Earlier up

b'(:channel-send 1 (:set-read-mode :read))'


b'000026(:EMACS-CHANNEL-SEND 1 (:PROCESS "\n"))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'

Just before the error:

b'000026(:EMACS-CHANNEL-SEND 1 (:PROCESS "\n"))'
b'(:channel-send 1 (:set-read-mode :read))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'


b'000025(:EMACS-CHANNEL-SEND 1 (:PROCESS ""))'
write: [...]
b'(:channel-send 1 (:set-read-mode :read))'
b'(:channel-send 1 (:set-read-mode :finished-reading))'
b'(:channel-send 1 (:prompt "COMMON-LISP-USER" "CL-USER" 1 "#<END-OF-FILE #x30200190788D>"))'


b'000025(:EMACS-CHANNEL-SEND 1 (:PROCESS ""))'

Cannot transfer contents of selection to REPL

This may be an issue with SublimeREPL, but when I have an inferior lisp running (from sly:start and connect to an inferior lisp instance), I have to manually copy and paste from the buffer, and the SublimeREPL transfer-to-repl commands do not work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.