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

cannot find .flowconfig #23

Open
vladp opened this issue Aug 16, 2019 · 1 comment
Open

cannot find .flowconfig #23

vladp opened this issue Aug 16, 2019 · 1 comment

Comments

@vladp
Copy link

vladp commented Aug 16, 2019

I am starting emacs from
/home/v/devel/mine/proj1/rnweb/app1/csr/

that directory has .flowconfig (VSCode uses that too).

However, for some reason that flowconfig is ingored,
and instead I get:

Could not open_in_bin: '/home/v/devel/mine/proj1/.flowconfig' ((Sys_error
"/home/v/devel/mine/proj1/.flowconfig: No such file or directory"))

Process flow-ls stderr finished

I also have put .projectfile file into
/home/v/devel/mine/proj1/rnweb/app1/csr/

In the hope that it will instruct LSP, and therefore JS2-mode, and therefore this minor mode, that
/home/v/devel/mine/proj1/rnweb/app1/csr/

But that's not working.
Are there options to instruct a component that's invoking flow to use .flowconfig from directory I need ?

Other information:
emacs 27.0.50
flow: 0.105.2
lsp is using javascript-typescript-langserver

Relevant .emacs config:


(use-package lsp-mode
  :commands lsp
  :hook (prog-mode . lsp)
  :init (setq lsp-auto-guess-root t)
  )

(defun my/hide-frame-line-numbers (frame _window)
  "Display line numbers from a specific frame in a window."
  (select-frame frame)
  (display-line-numbers-mode 1)
  )

(use-package lsp-ui
  :commands lsp-ui-mode
  :hook (lsp-mode . lsp-ui-mode)
  :config
  (setq lsp-ui-sideline-ignore-duplicate t)
  )

(use-package company-lsp
  :commands company-lsp
  :config
  (push 'company-lsp company-backends)
  (setq company-lsp-async t
        company-lsp-cache-candidates 'auto
        company-lsp-enable-recompletion t))


;; lsp-javascript specific start
(use-package js2-mode
  :mode "\\.js\\'"
  :init
  (add-hook 'js2-mode-hook #'js2-imenu-extras-mode)
  (setf js2-mode-indent-inhibit-undo t)
  :config
  (with-eval-after-load "lsp-javascript-typescript"
    (add-hook 'js2-mode-hook #'lsp)))
;; for flow start
(add-hook 'js2-mode-hook 'flow-minor-enable-automatically)
;; for flow end 


;; JSON
(use-package json-mode
  :defer t)
;; lsp javascript specific-end


@gitonthescene
Copy link

I don't know if you found a solution here, but all this uses is the elisp (locate-dominating-file) function. My best guess is that your .flowconfig is a dead symlink. Maybe you can run something like the following to debug:

$ junk pwd
/tmp/junk
$  junk find . -ls        
8627313060        0 drwxr-xr-x    6 douglasmennella  wheel                 192 Nov 29 09:03 .  
8627333212        0 drwxr-xr-x    2 douglasmennella  wheel                  64 Nov 29 08:49 ./touch
8627333219        0 drwxr-xr-x    3 douglasmennella  wheel                  96 Nov 29 09:01 ./subdir
8627341971        0 lrwxr-xr-x    1 douglasmennella  wheel                   7 Nov 29 09:01 ./subdir/.flowconfig -> garbage
8627342016        0 -rw-r--r--    1 douglasmennella  wheel                   0 Nov 29 09:03 ./.flowconfig
8627313064        8 -rw-r--r--    1 douglasmennella  wheel                 789 Nov 28 19:39 ./x.sh
$  junk cd subdir 
$  subdir ls -al
total 0
drwxr-xr-x  3 douglasmennella  wheel   96 Nov 29 09:01 .
drwxr-xr-x  6 douglasmennella  wheel  192 Nov 29 09:03 ..
lrwxr-xr-x  1 douglasmennella  wheel    7 Nov 29 09:01 .flowconfig -> garbage
$ subdir emacs -Q -batch --eval '(message (locate-dominating-file default-directory ".flowconfig"))'
/tmp/junk/
$ subdir 

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

2 participants