How to ignore syntax errors while preserving the autocomplete in netbeans?

0

First of all I will be more clear, the situation that is presented is this: When adding a newly created Laravel project, Netbeans launches the syntax errors flag «This obviously applies as false errors» .

The directory that has the supposed errors is the vendor / we could assume that to solve this we simply ignore the directory using the option:

Properties > Ignored Folders > Add Folder

However, this solution, while eliminating the red flag for syntax errors, also deletes the completion corresponding to the code analysis to the vendor / directory.

Next I will propose a rather archaic solution, hoping to find better answers.

PS: This error does not apply for cases in which certain warnings can be disabled using the editor options Options > Editor > Hints > PHP .

    
asked by NekoOs 20.09.2017 в 19:07
source

1 answer

0

The general solution that I found is a trick that only works for directories that the user can exclude from the netbeans project tree that follows the following algorithm:

  • create a link in the directory that generates the syntax error in a place outside the project.
  • ignore the directory that generates the error.
  • add the link created to the included routes of the project configuration.
  •   

    Solution in Linux

    Suppose that our project directory is:

    /var/www/html/stackoverflow
    

    The first step is to create a directory link outside the project, for which we can use something like this:

    ln -s /var/www/html/stackoverflow/vendor ~/proyectos/otros/vendor-stackoverflow
    

    The second step is to ignore the directory that generates the syntax error, by right clicking on the project and selecting the option Properties , then go to the section Ignored Folders and add the mentioned file.

    This will remove the directory from the netbeans project tree as well as the error notification, but it will also delete the auto-completion corresponding to the code analysis to this directory, so to solve this emerging problem: Finally we turn to the section Include Path of the properties of the project and add in the tab Private the symbolic link that we have created previously

    The result will be the absence of the annoying red notifier and the permanence of the self-completion of our bookstores, something like this:

      

    Solution in Windows {Versions greater than Vista}

    In windows only differs from the first step since the way to create links is somewhat different, in this case the command will be something like this:

    mklink /j c:\xampp\stackoverflow\vendor  c:\users\proyecto\vendor-stackoverflow
    

    Assuming clearly that our project is stored in c:\xampp\stackoverflow .

    From here on you should only follow the steps mentioned and everything should work correctly.

        
    answered by 20.09.2017 в 19:07