nextflow-io / nextflow-io/language-server

Fix exception handling in compiler

Open
#106 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
31
Forks
8
Avg merge
1d 10h
Merged PRs (30d)
2

Description

The compiler currently catches all CompilationFailedExceptions and ignores them:

https://github.com/nextflow-io/nextflow/blob/0f588576e193f4df81dcf7ffd7e0412f89540636/modules/nf-lang/src/main/java/nextflow/script/control/Compiler.java#L73-L82

This is so that parsing errors don't crash the language server. However, if an exception occurs for some other reason, like a bug, it is also ignored, and typically leads to the AST not being built and no errors reported.

The problem is that some legitimate parsing errors are being collected by the error collector and still being thrown. If I can remove that unnecessary throw, I should be able to remove these no-op catch clauses.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/nf-lang/src/main/java/nextflow/script/control/Compiler.java around lines 73-82 and trace how CompilationFailedException is handled. Check how the error collector records and rethrows legitimate parsing errors. Done means parsing errors remain available to the language server while unexpected compiler failures are no longer silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.