Skip to content

"Flycheck cannot use this syntax checker for this buffer." #8

@MarTango

Description

@MarTango

Relevant lines in my init.el:

(defun my/php-mode-hook ()
  "Gets run on php-mode load."
  (make-local-variable 'company-backends)
  (add-to-list 'company-backends 'company-phpactor)
  (flycheck-select-checker 'phpstan)
  (setq php-mode-coding-style 'psr2
        c-basic-offset 4)
  (when (eq 0 (buffer-size))
    (insert "<?php\n\n")))

(use-package php-mode :ensure t
  :init (add-hook 'php-mode-hook #'my/php-mode-hook))
(use-package flycheck-phpstan :ensure t :after (php-mode flycheck))

The buffer that appears when I open PHP file:

Syntax checker in buffer MyFile.php in php-mode:

  phpstan (disabled)
    - major mode: `php-mode' supported
    - may enable: Automatically disabled!
    - executable: Found at /usr/local/bin/php

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 32snapshot (package: 20180422.2106)
Emacs version:    26.1
System:           x86_64-apple-darwin17.5.0
Window system:    ns

PHPStan Project Version - installed using project's composer.
PHPStan - PHP Static Analysis Tool dev-master@de7fd7d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions