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

Sublime freezes when typing "out." in a workflow block. #5

Open
sclamons opened this issue Aug 2, 2022 · 5 comments
Open

Sublime freezes when typing "out." in a workflow block. #5

sclamons opened this issue Aug 2, 2022 · 5 comments

Comments

@sclamons
Copy link

sclamons commented Aug 2, 2022

As description. Only fix I've found is to restart sublime.

@cjfields
Copy link

cjfields commented Jan 7, 2025

I can say, from personal experience, this makes using the plugin very difficult once you encounter it; even clicking on the line with .out will trigger the issue. I suspect this is linked to syntax highlighting for that keyword, which is here:

- match: \.(out)

The \s* match in particular which isn't anchored.

@peterk87
Copy link
Collaborator

peterk87 commented Jan 7, 2025

Hi @cjfields, do you have any more info about this issue that you could provide?

  1. Version of Sublime Text?
  2. Any potentially relevant messages in the ST console (ctrl+`)?
  3. Nextflow project structure? or link to repo?

The issue is likely in the Python code for handling showing a popup with info on process/workflow outputs (

sublime/process_popups.py

Lines 356 to 370 in 0bd5fd3

class NextflowWorkflowProcessCallEventListener(sublime_plugin.EventListener):
def on_selection_modified_async(self, view: sublime.View):
"""Show popups for process calls and output channel property access
When the cursor is navigated over:
- a process name (entity.name.class.process.nextflow)
- process out keyword (e.g. FASTQC.out) (keyword.process.out.nextflow)
- named output channel (e.g. FASTQC.out.html) (variable.channel.process-output-emit.nextflow)
A popup will be shown with info about the process input/output channels. For named output channels, the accessed output channel will be highlighted.
"""
if view.syntax().name != 'Nextflow':
return
if len(view.selection) > 1:
)

@cjfields
Copy link

cjfields commented Jan 7, 2025

Hi @cjfields, do you have any more info about this issue that you could provide?

  1. Version of Sublime Text?

Sublime Text 4, Build 4189, Mac OS X

  1. Any potentially relevant messages in the ST console (ctrl+`)?

Will check and report back (I need to reinstall the package).

  1. Nextflow project structure? or link to repo?

I'm working on a branch of a repo converting a workflow from DSL1 to DSL2 (using nf-core skeleton but as a non-nf-core repo). Example line that caused issue:

https://github.com/h3abionet/TADA/blob/4828dbb22d3a89d2a31a5e0ddd43961a61b29827/subworkflows/local/filter_and_trim.nf#L23

EDIT: I should add, I actually set up a fork of this repo and added it as a custom package in the Packages User directory to see if I could sort it out; interestingly enough it seemed to go away for the time being. I will reinstall the original package and move out the fork to try reproducing w/ the console.

peterk87 added a commit to peterk87/sublime-nextflow that referenced this issue Jan 8, 2025
* fix: process popups hanging due to bad regex for getting output emit labels (nf-core#5)
* feat: added snippets for process version YML and ch_versions mixing (ver), process modules config (withName)
@peterk87
Copy link
Collaborator

peterk87 commented Jan 8, 2025

Hi @cjfields I think I have it fixed and working better than before.

Thanks for sharing your workflow. It was very helpful for debugging the issue (bad regex 🤦‍♂️). The POOLED_... process was the one crashing my ST.

Let me know if release 1.2.0 fixes the issue. Sorry for crashing your ST with my crappy code haha

@cjfields
Copy link

cjfields commented Jan 8, 2025

Hi @cjfields I think I have it fixed and working better than before.

Thanks for sharing your workflow. It was very helpful for debugging the issue (bad regex 🤦‍♂️). The POOLED_... process was the one crashing my ST.

Let me know if release 1.2.0 fixes the issue. Sorry for crashing your ST with my crappy code haha

Not a problem at all, I'm glad you took the time to fix it!

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

No branches or pull requests

3 participants