Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse exclude php files from validation but not build

I have a very simple use case. Eclipse Kepler with PDF. New project with PHP nature.

One file at the root

# test.php
<?php

$fu = new Fu();
$fu->bar();

&

One file in a directory

# vendor/vendor.php
<?php

class Fu {
    public function bar () {

    }
}

&

Both files show an error in the Problems view. I need to exclude all files under vendor/ (recursively) from the Problems view, while keeping the code completion on objects defined under vendor/ (recursively).

Desired result:

  • code completion in test.php still works on Fu and all classes defined under vendor/
  • the Problems view doesn't show any error or warning on files under vendor/
  • the Problems view shows errors and warnings on other files as usual
  • the Problems view doesn't depend on the selected element

What I tried:

  • removing vendor/ from the Build Path also removes all code completion on classes under vendor/
  • Project > Properties > Validation > Enable project specific settings + PHP CodeSniffer Validator settings > Exclude Group > Folder: vendor doesn't do anything at all
like image 851
Alsciende Avatar asked Oct 10 '14 11:10

Alsciende


1 Answers

You should install latest PDT (3.3.1 is available on marketplace) into your eclipse kepler instance.

This version have special feature: "library dir". This functionality allow you to disable all validators (JS/PHP/HTML/CSS...) on buildpath dir.

like image 75
zulus Avatar answered Sep 23 '22 22:09

zulus