Giter Club home page Giter Club logo

schemely's People

Contributors

cmf 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

Watchers

 avatar  avatar

schemely's Issues

REPL - Scrolling issue

When 'Run selected text in REPL' is invoked, the part of the REPL containing the 'history' of the evaluations (the upper middle) is not scroll down automatically, forcing the user to do it manually.

REPL - Completion minor issues

Issue #1:

Last character is not taken into account in automatic completion. Example:

Suggestions are shown right up until the n:

(defin_<-- caret here

If after the 'n' in '(defin' I type an 'e', then the suggestion list disappears, and it shouldn't. At least, the list should be still displayed or the automatic completion should insert a space character after it.

Issue #2:

Backwards completion does not work. Example:

(definK_<-- caret here

If backspace is pressed, then the list of suggestions should appear again.

Editor - Incorrect indentation

Having this code in the editor:

;test comment

(define nth-elt
  (lambda (lst n)

The next line corresponding to the lambda body is not indented correctly:

;test comment

(define nth-elt
  (lambda (lst n)
  badbad

In-editor contextual menu

A new item in the editor contextual menu, associated to this plugin, could prove handy. For example, the user might want to select some code in the editor, right-click it, and be offered an option to run it in the REPL. (What if there are several REPLs to choose from? I guess the active one should do). It is useful to be able to use the shorcuts, but the "slower" way to execute those actions should be available as well. You might lose potential users of the plugin otherwise :)

Same with other actions applicable to code snippets in the editor.

Inconsistent displacements of code lines

This might be hard to implement, but I think it would be nice to be able to move variable declarations within a let in a structural, not textual way. Let me explain better. If I have the following code:

(let* ((numbers '(3 -2 1 six -5))
       (six 6))

And I select the declaration '(six 6)', maybe using the outstanding cmd-W shortcut, I would like to move to the first position in the list of let declarations, as in:

(let* ((six 6)
       (numbers '(3 -2 1 six -5)))

So my code is valid. Normally, this is accomplished using the combination cmd-shift-up/down. Alas, this is not context-aware, and it leaves the expression looking really ugly:

        (six 6))
 (let* ((numbers '(3 -2 1 six -5))

We could think of additional scenarios that might benefit from this type of structural changes.

Create inspection for unresolved symbols

I have code in the annotator for unresolved symbols - this is useful for debugging. This should really be an inspection so that it can be turned on and off without commenting code.

Ability to relaunch a dead REPL

After killing a REPL with the 'Stop REPL' button, one should be able to reuse it without having to close it and start a new one.

No completion for symbolic data

No completion for symbolic data. It could be useful that the list of autocomplete suggestions includes all the symbolic data used in the current file. For example,

(define (attach-tag type-tag contents)
  (if (equal? type-tag 'scheme-number)
    contents
    (cons type-tag contents)))

while editing another function, the sugesstion list should include 'scheme-number

Allow user to configure if arrow keys move in history

Now that we have the next/previous history actions, it makes less sense to allow the user to move through the history with the normal arrow keys. This is very confusing sometimes when editing multi-line items in the REPL. It should be configurable whether to permit this or not.

Focus lost when pressing ESC in the REPL

Pressing ESC in the REPL moves the focus to the editor. At least it should do nothing. My suggestion is that it should clear the input, a la Skype's conversation window.

Block navigation

When editing Java, one can navigate between the methods of a class using the key combinations ctrl+up/down. It would be great to be able to do the same while editing Scheme source.

REPL - Incorrect automatic indentation

In the REPL, if I start typing:

 > (define (test n)

The next line is not indented properly:

> (define (test n)
  (+ n 1))

If possible, it should be pretty-printed:

> (define (test n)
    (+ n 1))

Load support

In the REPL, (load ) uses the IntelliJ's running path to look for the source to load:

(load "test.scm")
Error in load: error opening 'file:/Applications/IntelliJ IDEA 10 CE.app/bin/test.scm'.

It is not clear what directory to use for this. It seems that Guile and Racket support setting a load path, see "Source Loading" section in http://sisc-scheme.org/manual/html/ch05.html

This needs further investigation.

REPL - Infinite loops finish?

I define the next procedure in the REPL:

> (define (eternity x)
  (eternity x))

If I execute it right after:

> (eternity 1)

From the user perspective, the execution seems to finish (?). This might prove wrong the validity of the Halting Problem.

Wrong smart insertion pair ")" in Let expresssion

Writing the following "let" expression
(let* [get-record |]))
after introducing a '(' in the editor, the closed parenthese is added in the wrong place.
(let* [get-record (|]))
It should be
(let* [get-record (|)])

REPL - Tab names

Could it be feasible to allow the user rename a REPL tab? Right now, all of them are named "Local". As an example, if the user is working with two files separately with their corresponding REPLs, this would help him discern which one should work on.

Fix minor issues

There are currently a few minor problems with the plugin - it would be good to get these sorted out.

  • The New Scheme file action doesn't work
  • The code style panel is currently not useful

REPL - Space after completion

After symbol completion, a space character should be inserted as to let the user continue to type the expression. Example:

(defi[press tab]

then

(define_<--caret here

rather than

(define _<-- here

Support for interactive input

There should be a way to let the user input data. Invoking read turns the REPL irresponsive. It is necessary to shut down IDEA.

REPL - Errors not shown

If I enter the expression 'asdf' in the REPL -an undeclared identifier- I would expect to see an error message in the line of 'unknown identifier: asdf'. Currently, nothing is shown.

New line and indent

After insert new line, the cursor is placed to the beginning of the line.
(define (product-deriv operands var)
)

When the first character is introduced, the line is indent.
(define (product-deriv operands var)
k)

It should indent the new line directly without await for first character
(define (product-deriv operands var)
)

REPL toolwindow stays open on restart

When restarting IDEA, if the user had a REPL toolwindow open when IDEA was closed, the window remains open on restart even though it's empty. It would be good to close this.

REPL doesn't track end of output correctly

When the REPL contains a lot of output (i.e. always), the output frame doesn't correctly track the end of the output. This means the user has to scroll down continuously to see the recent output, which is really annoying.

Editor - Bad formatting

I have this procedure definition in the editor:

(define test
  (lambda (n) ;dispatch
    (+ 2 n)))

It is formatted (cmd+opt+L) to:

(define test
  (lambda (n) ;dispatch
              (+ 2 n)))

Give lambda icon transparent background

Currently the lambda icon used in the plugin has a fixed white background. There are a lot of times when this looks strange, it would be better to replace that with transparency.

Ability to reset the REPL

Provide a way to reset the REPL so that the user can interact with it using a clean environment, without the need to close the current one and re-open it. A shortcut for this feature would be handy.

Allow scheme implementation to be chosen for project

Currently the scheme implementation is hard coded to be Kawa. Ideally the user should be able to choose between different implementations, at a minimum Kawa and SISC (Racket would be another obvious alternative). This selection will have to be done at the project level since it requires separate implementations of many parts of the plugin (parser, lexer, resolution, annotation).

Simpler prompt

The current prompt

|kawa:1|

does not provide any sensitive information and I suggest to make it simpler, maybe just a '>'.

Turn the Scheme REPL into a tool window

The REPL at the current state is just a run Run window tab. Converting it into a tool window would let the user to place it whatever they need to fit in their window layout.

Allow camel-humps style completion

Often Scheme identifiers are very long (call-with-current-continuation etc) - it would be useful to have some form of completion like IntelliJ offers in Java. Perhaps allowing c-w-c-c or CWCC.

Completion - Order of suggestions

When I start to type (cd in the editor, I get the following list of suggestions:

cdaaar
cdaadr
cdaar
...
cdddr
cddr
cdr

It should be shown in reverse order.

Complete current statement

The editor action for completing the current statement is really useful when editing languages not based on S-Expressions, and I consider that it would bring even greater value to lispy languages.

For example:

(define list-length
   (lambda (lst)
   (if (null? lst)
       0
       (+ 1 (list-length (cdr lst)_<-- caret here

Using at that point the key combination -or whatever is assigned for completing the current statement- cmd+shift+enter would include the remaining closing parentheses.

(define list-length
  (lambda (lst)
  (if (null? lst)
      0
      (+ 1 (list-length (cdr lst))))))
_<-- caret here

This action is certainly not context-free, and it may be addressed in several ways. For instance, in the example above, it could also close just the expression corresponding to list-length:

(define list-length
   (lambda (lst)
   (if (null? lst)
       0
       (+ 1 (list-length (cdr lst))_<-- caret here

All in all, something to investigate that could uplift the editor capability set.

Formatting indents lines after comments by one

For some reason, when formatting scheme code the line after a comment is always indented by one. This happens even if the following line is also a comment:

; Parse an sexp into our syntax tree
 (define (parse sexp)

; Perform substitutions. Doesn't actually do anything yet
 ; (i.e. performs no calculations)
 (define (subst expr sub-id val)

Identifiers starting with N- (being N a number) are not caught by cmd+W

I have the following expression:

(define 2-scheme-value? (lambda (v) #t))

With the caret anywhere over scheme-value? (not over 2-), pressing cmd+W selects scheme-value?. Pressing it again selects the whole expression, while it should select only 2-scheme-value?, since that is a valid name for a procedure in Scheme.

Add SISC-specific symbol resolution

When editing SISC code, resolution code specific to the implementation is required. This will require modifying the Scheme interface to support extensions to the PsiBuilder, at a minimum.

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.