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

Babashka Jack-In REPL doesn't show eval errors #1413

Closed
Cnly opened this issue Dec 2, 2021 · 4 comments
Closed

Babashka Jack-In REPL doesn't show eval errors #1413

Cnly opened this issue Dec 2, 2021 · 4 comments
Labels
bug Something isn't working output/repl window ux User experience related

Comments

@Cnly
Copy link

Cnly commented Dec 2, 2021

With VSCode + Calva 2.0.227 + Babashka 0.6.7, the Jack-In REPL won't show errors (or do anything else visible) while evaluating forms with problems. Well-written forms evaluate normally.

Here's the output with nREPL logging enabled where I evaluated two forms (+ 1 1) and (nosuchsymbol) (I've left out some repetitive content, but I also noticed there were duplicate autocomplete messages):

<- received
{
  id: '1',
  ns: 'user',
  session: 'none',
  value: '#object[sci.impl.vars.SciNamespace 0x4f2759eb "user"]'
}

<- received
{ id: '1', session: 'none', status: [ 'done' ] }

<- received
{
  id: '2',
  'new-session': '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  session: 'none',
  status: [ 'done' ]
}

-> sent
{
  op: 'init-debugger',
  id: '4',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c'
}

-> sent
{
  op: 'clojuredocs-refresh-cache',
  id: '5',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c'
}

<- received
{
  id: '3',
  ops: {
    clone: {},
    close: {},
    complete: {},
    describe: {},
    eldoc: {},
    eval: {},
    info: {},
    'load-file': {},
    lookup: {},
    'ls-sessions': {}
  },
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ],
  versions: { babashka: '0.6.7', 'babashka.nrepl': '0.0.6-SNAPSHOT' }
}

<- received
{
  id: '4',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

<- received
{
  id: '5',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  op: 'debug-instrumented-defs',
  id: '6',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c'
}

<- received
{
  id: '6',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  op: 'ns-list',
  id: '7',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  'filter-regexps': []
}

-> sent
{
  op: 'ns-list',
  id: '8',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  'filter-regexps': []
}

<- received
{
  id: '7',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

<- received
{
  id: '8',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: '+',
  id: '9',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: '+',
  id: '10',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [
    { candidate: '+', ns: 'clojure.core' },
    { candidate: 'read+string', ns: 'clojure.core' },
    { candidate: "+'", ns: 'clojure.core' }
  ],
  id: '9',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [
    { candidate: '+', ns: 'clojure.core' },
    { candidate: 'read+string', ns: 'clojure.core' },
    { candidate: "+'", ns: 'clojure.core' }
  ],
  id: '10',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'ns-list',
  id: '11',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  'filter-regexps': []
}

<- received
{
  id: '11',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  id: '12',
  op: 'eval',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  code: '(+ 1 1)',
  file: '/private/tmp/.calva/output-window/output.calva-repl',
  line: 21,
  column: 1,
  stdout: [Function: stdout],
  stderr: [Function: stderr],
  pprint: true
}

<- received
{
  id: '12',
  ns: 'user',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  value: '2'
}

<- received
{
  id: '12',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'n',
  id: '13',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'n',
  id: '14',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [
    { candidate: 'fs/ends-with?', ns: 'babashka.fs' },
    { candidate: 'cons', ns: 'clojure.core' },
    { candidate: 'unchecked-subtract', ns: 'clojure.core' },
    { candidate: 'json/decode', ns: 'cheshire.core' },
    <Omitted>
    ... 393 more items
  ],
  id: '13',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [
    { candidate: 'fs/ends-with?', ns: 'babashka.fs' },
    { candidate: 'cons', ns: 'clojure.core' },
    { candidate: 'unchecked-subtract', ns: 'clojure.core' },
    <Omitted>
   ... 393 more items
  ],
  id: '14',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'ns-list',
  id: '15',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  'filter-regexps': []
}

<- received
{
  id: '15',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'no',
  id: '16',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [
    { candidate: 'not-empty', ns: 'clojure.core' },
    <Omitted>
    { candidate: 'not=', ns: 'clojure.core' }
  ],
  id: '16',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'ns-list',
  id: '17',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  'filter-regexps': []
}

<- received
{
  id: '17',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nos',
  id: '18',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '18',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosu',
  id: '19',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosu',
  id: '20',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '19',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [],
  id: '20',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuc',
  id: '21',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuc',
  id: '22',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '21',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [],
  id: '22',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<Omitted many like these>

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymb',
  id: '31',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymb',
  id: '32',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '31',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [],
  id: '32',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymbo',
  id: '33',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymbo',
  id: '34',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '33',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [],
  id: '34',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymbol',
  id: '35',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

-> sent
{
  op: 'complete',
  ns: 'user',
  symbol: 'nosuchsymbol',
  id: '36',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  context: '(__prefix__)',
  'enhanced-cljs-completion?': 't'
}

<- received
{
  completions: [],
  id: '35',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

<- received
{
  completions: [],
  id: '36',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  id: '37',
  op: 'eval',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  code: '(nosuchsymbol)',
  file: '/private/tmp/.calva/output-window/output.calva-repl',
  line: 24,
  column: 1,
  stdout: [Function: stdout],
  stderr: [Function: stderr],
  pprint: true
}

<- received
{
  err: ': Could not resolve symbol: nosuchsymbol user /private/tmp/.calva/output-window/output.calva-repl:1:2\n',
  id: '37',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c'
}

<- received
{
  ex: 'class ',
  id: '37',
  'root-ex': 'class ',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'eval-error' ]
}

<- received
{
  id: '37',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'done' ]
}

-> sent
{
  op: 'stacktrace',
  id: '38',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c'
}

<- received
{
  id: '38',
  session: '36a04e7b-0c8a-452f-b535-b03432f91a3c',
  status: [ 'error', 'unknown-op', 'done' ]
}
@Hzqi
Copy link

Hzqi commented Dec 2, 2021

I got the same problem. VSCode1.62.3 + Calva 2.0.228 + nrepl 0.6.

When use alt + enter to some code, it it runs ok, it's fine. But if it runs throws something, zhe output repl window just show nothing.

I suspect it is about the VSCode version, because my last VSCode version is fine, after the auto update of that, the problem came out.

@Hzqi
Copy link

Hzqi commented Dec 2, 2021

I got the same problem. VSCode1.62.3 + Calva 2.0.228 + nrepl 0.6.

When use alt + enter to some code, it it runs ok, it's fine. But if it runs throws something, zhe output repl window just show nothing.

I suspect it is about the VSCode version, because my last VSCode version is fine, after the auto update of that, the problem came out.

looks I got fixed...

I just downgrade the calva to 2.0.225..

So it maybe a new version bug

@PEZ
Copy link
Collaborator

PEZ commented Dec 2, 2021

Thanks for investigating it some more, @Hzqi !

I did think it was strange I haven't noticed this before...

Does this extra info ring any bells for you, @bpringe, @marcomorain ?

@marcomorain
Copy link
Contributor

This is caused by the error handling code that I added. I can reproduce and I'm debugging now.

marcomorain added a commit to marcomorain/calva that referenced this issue Dec 2, 2021
When the user is using a NREPL connection that doesn't have the
cider-nrepl middleware loaded, we cannot reply on the `stacktrace`
middleware being present. Handle the missing middleware gracefully.

Fixes: BetterThanTomorrow#1413
marcomorain added a commit to marcomorain/calva that referenced this issue Dec 2, 2021
When the user is using a NREPL connection that doesn't have the
cider-nrepl middleware loaded, we cannot reply on the `stacktrace`
middleware being present. Handle the missing middleware gracefully.

Fixes: BetterThanTomorrow#1413
@bpringe bpringe added bug Something isn't working output/repl window ux User experience related labels Dec 3, 2021
marcomorain added a commit to marcomorain/calva that referenced this issue Dec 7, 2021
When the user is using a NREPL connection that doesn't have the
cider-nrepl middleware loaded, we cannot reply on the `stacktrace`
middleware being present. Handle the missing middleware gracefully.

Fixes: BetterThanTomorrow#1413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working output/repl window ux User experience related
Projects
None yet
Development

No branches or pull requests

5 participants