Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not using assigned repl #310

Open
1 of 2 tasks
yelled1 opened this issue Nov 26, 2020 · 2 comments
Open
1 of 2 tasks

Not using assigned repl #310

yelled1 opened this issue Nov 26, 2020 · 2 comments
Labels

Comments

@yelled1
Copy link

yelled1 commented Nov 26, 2020

Describe the bug
I have assigned the mill instead of sbt, but neoterm does not recognize it

To Reproduce
below is the script that assigns mill compiler to produce mil -i {prj}.console

$ cat ~/bin/mill_repl.sh
#!/bin/sh
prj=$(grep -i object ./build.sc | grep ScalaModule | awk '{print $2}')
echo $prj
/usr/local/bin/mill -i $prj.console
#/usr/local/bin/mill -i $prj.repl
unset $prj

I have following lines setup:

let g:neoterm_autoscroll=1       "if you want to open neoterm in the Auto Scroll
let g:neoterm_autoinsert=1      " &  Insert/terminal mode you can set it with                                        autocmd FileType scala let g:neoterm_automap_keys = '<leader>r'
let mill_repl = $HOME . '/bin/mill_repl.sh' . ' console'                                                             let g:neoterm_repl_scala = mill_repl
if has("win32")
    let g:neoterm_direct_open_repl = 1 " causes file directory NOT found error
    let g:neoterm_auto_repl_cmd = 1
elseif has("unix")
   "let g:neoterm_repl_python = '/opt/miniconda3/envs/SPk/bin/ipython --no-autoindent'
   autocmd FileType scala nnoremap <leader>r :botright Tnew<CR>
   autocmd FileType scala vmap <localleader>\ :TREPLSendSelection<CR>
   autocmd Filetype scala imap <localleader>\ :TREPLSendLine<CR>
   autocmd Filetype scala nmap <localleader>\ :TREPLSendLine<CR>
endif

Expected behavior
I get a repl open with the following:

~/Prj/mill_spark$  ~/bin/mill_repl.sh
cor_poc
[33/33] cor_poc.console
Welcome to Scala 2.12.10 (OpenJDK 64-Bit Server VM, Java 1.8.0_275).
Type in expressions for evaluation. Or try :help.

scala>

Instead I get a bash shell

~  20
~  21     def read_foldr(Ss: SparkSession, foldr_str: String): DataFrame =
~  22       Ss.read
 emr_cust_consumr.scala                                                                                     0%    1:1
 syoon@DESKTOP-3DKM78D:~/Prj/mill_spark$
syoon@DESKTOP-3DKM78D:~/Prj/mill_spark$
syoon@DESKTOP-3DKM78D:~/Prj/mill_spark$ ~/bin/mill_repl.sh
cor_poc
[33/33] cor_poc.console
Welcome to Scala 2.12.10 (OpenJDK 64-Bit Server VM, Java 1.8.0_275).
Type in expressions for evaluation. Or try :help.
scala>

Above is to to start this process manually. Or else sbt console will mess up the mil project
when I send a line I get

scala> sbt console
<console>:12: error: not found: value sbt
       sbt console
       ^
<console>:12: warning: postfix operator console should be enabled
by making the implicit value scala.language.postfixOps visible.
This can be achieved by adding the import clause 'import scala.language.postfixOps'
or by setting the compiler option -language:postfixOps.
See the Scaladoc for value scala.language.postfixOps for a discussion
why the feature should be explicitly enabled.
       sbt console
           ^

scala> import org.apache.spark.sql.types._
import org.apache.spark.sql.types._

Versions (Issues without this information will take longer to be answered/solved):

  • OS: $ uname -a
    Linux DESKTOP-8D 4.19.128-microsoft-standard Unknown function: neoterm#rspec #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • neoterm commit latest
  • Vim or Neovim
    • vim
    • neovim
  • Version: NVIM v0.4.3
@yelled1 yelled1 added the bug label Nov 26, 2020
@shy00n
Copy link

shy00n commented Nov 26, 2020

Was able to verify that it was assigned

:echo neoterm_repl_scala
/home/syoon/bin/mill_repl.sh console

just not using it.

@kassio
Copy link
Owner

kassio commented Nov 29, 2020

Currently there's not configuration to customize scala repl. Can you open a pull request? You can follow g:neoterm_repl_r example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants