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

No working with VScode #68

Closed
Mgldvd opened this issue Jun 9, 2023 · 6 comments · Fixed by #69
Closed

No working with VScode #68

Mgldvd opened this issue Jun 9, 2023 · 6 comments · Fixed by #69
Labels

Comments

@Mgldvd
Copy link

Mgldvd commented Jun 9, 2023

Hi, I'm not sure if this is out of scope.
Is working fine with vim or the default visual editor on the os but not working with editor like vscode, pulsar editor or sublime text
also not working with nano
the output is just
Funzzy: Watching...
I'm using Linux mint as OS

Here the yml file:

- name: run my test
  run: [
    'ls -a',
    'echo helooooo'
  ]
  change: "**"

also i want to point out that inotifywait is working fine:

while inotifywait -e close_write **; \
do clear && \
    date +"%T"
    ls -la
done

Any idea? Thank you

@cristianoliveira
Copy link
Owner

Hello @Mgldvd it isn't out of scope! The watcher must work on any regular terminal, even when running within an IDE.
Could you help me understand the issue by:

  • Let me know which version you are using
  • Checking if it works with a more specific rule like:
- name: run my test
  run: [
    'ls -a',
    'echo helooooo'
  ]
  change: "./src/**"
  • Could you paste here the verbose output? Enable it with -V (capitalized v)

@cristianoliveira
Copy link
Owner

Ok, after some tests, I think I figured! Thanks again for reporting 😄

Today the watcher only listenCreate which, when editing with VIM, is always triggered. (here). The reason is to avoid triggering multiple times the same task.

It seems the VScode only triggers Write and NoticeWrite events when saving a file. I think I know how to fix that by checking more events and only picking the first one, to avoid running the task multiple times

Here is the output for when VIM saves a buffer into a file:

-----------------------------
Funzzy: Watching...
-----------------------------
Funzzy verbose: event NoticeRemove("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/4913") 
-----------------------------
-----------------------------
Funzzy verbose: event NoticeRemove("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua") 
-----------------------------
-----------------------------
Funzzy verbose: event NoticeRemove("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua~") 
-----------------------------
-----------------------------
Funzzy verbose: event Remove("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/4913") 
-----------------------------
-----------------------------
Funzzy verbose: event Create("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua") 
-----------------------------
-----------------------------
Funzzy verbose: Triggered by change in: /Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua 
-----------------------------
Funzzy:  task make test 

Here is for VScode:

-----------------------------
Funzzy verbose: watches Watches { rules: [Rules { name: "run my test", commands: ["make test"], watch_patterns: ["lua/**"], ignore_patterns: [], run_on_init: false }] } 
-----------------------------
-----------------------------
Funzzy verbose: Verbose mode enabled. 
-----------------------------
Funzzy: Watching...
-----------------------------
Funzzy verbose: event NoticeWrite("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua") 
-----------------------------
-----------------------------
Funzzy verbose: event Write("/Users/cristianoliveira/other/funzzy.nvim/lua/funzzy/init.lua") 
-----------------------------

@cristianoliveira
Copy link
Owner

Hey @Mgldvd Now it's capturing any event. I made a pair of tests using VScode and it is working, let me know if it fixes the issue for you

@Mgldvd
Copy link
Author

Mgldvd commented Jun 12, 2023

Hi, Yea!! is working perfect now, really nice app. Thank you.

By the way, as a suggestion, it should also work with the .yml extension.

@cristianoliveira
Copy link
Owner

Noted! I'll extend the watcher to look for the .yml by default, today there is the --config arg that allows you to point to any valid yaml file :D

@cristianoliveira
Copy link
Owner

Addressed your feature request #98
😄

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

Successfully merging a pull request may close this issue.

2 participants