D. Ataro
D. Ataro

Reputation: 1821

Eclipse PDT Oxygen - Cannot Mark as Source Folder

The Problem

In the previous versions of Eclipse PDT, all PHP classes inside a project have been, to my current understanding, included under the default proposals. In Oxygen, however, it would seem as though only files located in directories marked as source folders show up under the default proposals.

All directories except one in my project are marked as source folders, but I believe this is the case since I created them with a previous version of Eclipse (cannot remember; bad memory). The classes inside the directory which is not marked as a source folder does not show up at all under the default proposals, and yield errors when I try to use them in other parts of the code.

TL;DR version

Some classes does not show up under the default proposals, and yield errors if used elsewhere in the code. It is as though they do not exist, at all. It appears as though this is happening because some directories are not marked as source folders, thus making the contents therein as though invisible by Eclipse.

Contemplation

I have been considering what might cause such a thing to occur, and as described above, I believe this problem might have to do with some directories not being marked as source folders. In Eclipse PDT Oxygen, apart from the previous versions of Eclipse, it is not possible to mark directly mark directories as source folders.

Everything from recreating directories, refactoring them, looking through menus, and much more, I have tried. But, no luck from those actions.

Hopefully someone will know what it is I am describing, and thus being able to point me in the right direction!

Upvotes: 0

Views: 169

Answers (1)

D. Ataro
D. Ataro

Reputation: 1821

After quite some exploration of the web, I came across the help reference for the Eclipse platform, and managed to change it to the current release of Eclipse (even though that seemed to change nothing on the page.) The example is for C/C++, but adding source folders is done somewhat similarly in PDT.

Solution

In order to mark a directory as a source folder in Eclipse PDT Oxygen, right click the project you wish to add a source folder for, then:

Properties > PHP > Source Paths > Build Path

On this page, you can press the "Add Folder..." button. Check the folder (or folders) you wish to make source folders, then apply the changes and close the settings window.

Upvotes: 1

Related Questions