cmf / schemely Goto Github PK
View Code? Open in Web Editor NEWScheme plugin for IntelliJ
Scheme plugin for IntelliJ
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.
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.
The menu action 'Run selected text in REPL' loads the selected text into an already-stopped REPL. It seems that this is a GUI-related issue.
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
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.
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.
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.
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. 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
There is not support for horizontal scrolling in the REPL.
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.
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.
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.
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))
In the REPL, (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.
The console input area expands and shrinks depending on the space required. It would be good if the user could specify a minimum amount of space that would always be present.
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.
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 (|)])
The start of a new line is not indented correctly if it starts with a quote character:
(define a
'(test))
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.
Implementations should be able to optionally support square braces for list values. SISC and Racket allow this, for example.
"new" and "throw" are incorrectly highlighted as keywords in the editor.
When the REPL tool window gets the focus, it should position the caret on the last position of the REPL editor.
There are currently a few minor problems with the plugin - it would be good to get these sorted out.
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
There should be a way to let the user input data. Invoking read turns the REPL irresponsive. It is necessary to shut down IDEA.
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.
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)
)
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.
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.
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)))
When renaming, currently a dialog box pops up. This should be in-place like the Java rename.
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.
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.
In the list of suggested symbols when completing, each element appears twice.
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).
The current prompt
does not provide any sensitive information and I suggest to make it simpler, maybe just a '>'.
The action Tools -> Scheme REPL -> Load file to REPL is not assigned a shortcut.
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.
If one executes 'Run selected text in REPL' and there is not a REPL available, a new one should be launched in which to evaluate the code text.
The fix for #16 works by autoindenting the line when a character is typed and the cursor is at the start of the line. This should also be implemented for paste and delete.
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.
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.
This action in the plugin does not have an associated shortcut. It is an action that may be used quite frequently.
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.
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)
If the user has entered a command in the REPL but then navigates through their history, when they return to the current item their command is gone.
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.
If I define:
(define eternity
(lambda (x)
(eternity x)))
the scope of the symbol "eternity" doesn't include the body of the define, so I don't get autocompletion for recursive functions.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.