Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

phpconfig.json Blueprints #118

Open
TheColorRed opened this issue Jun 30, 2016 · 8 comments
Open

phpconfig.json Blueprints #118

TheColorRed opened this issue Jun 30, 2016 · 8 comments

Comments

@TheColorRed
Copy link
Contributor

TheColorRed commented Jun 30, 2016

This thread will be for the starting point for the phpconfig.json. If anyone has anything that they would like to add/remove, please post your thoughts and we will update the blueprints if needed.

{
    // These glob paths will be excluded from the workspace root 
    "exclude": ["/workspace/root/myFile.php", "/src/myDir/*"],
    // These glob paths are included and based outside of the workspace
    "include": ["/src/myDir", "c:\\phplibs\\some-lib\\"],
    // This is the document webroot; it has possible usage for autocomplete or some other features
    // This defaults to the workspace root
    "webRoot": "/public",
    // This is the root of the application
    // This defaults to the workspace root
    "appRoot": "/app"
}
@nevadascout
Copy link
Member

Are we including those "include" files/folders in the cache when we save it?

Also, are we caching the php library stubs? Seems like a good idea to do that if not.

@TheColorRed
Copy link
Contributor Author

The idea is for the included files to be placed in the tree and be cached. I feel that the stubs should still automatically be parsed if you have any installed. There could be an option such as excludeStubs which takes a list of stub folder names (default the master list).

@girvo
Copy link

girvo commented Jul 8, 2016

Will the config be able to parse composer.json (and/or composer.lock)? Perhaps it's useful to be able to specify where the composer file is -- a lot of our projects have our actual code in code/, ie. code/composer.json

@TheColorRed
Copy link
Contributor Author

I am not sure having composer information in there would be helpful to the client/server, as this file would be for instructing crane on what it needs to do in the current workspace. What features did you have in mind for the composer information?

@girvo
Copy link

girvo commented Jul 8, 2016

@TheColorRed composer.json's autoload property is used to to point at what files should be included via the autoloader, including those that don't map to PSR-4:

https://getcomposer.org/doc/04-schema.md#autoload

Specifically, the classmap and files sub-properties, these to me have a direct correlation to the proposed include property of the blueprint, so it'd be lovely to have some kind of correlation between them, no?

@girvo
Copy link

girvo commented Jul 8, 2016

Just to make it somewhat clearer: Those specific properties are used to map to files outside the current workspace (as it's one of the only ways of achieving that within composer), similar to what is proposed. What I'm suggesting is not a replacement of the current proposal, but an extension to think about long-term :)

@TheColorRed
Copy link
Contributor Author

I have just recently started using composer, so I am not super familiar with it and PSR-*, so please help me understand what you mean by outside files because in my time with it, I have never had anything out of my workspace when using composer.

When I open my project in vscode I open it so everything is in a view similar to this:

+ app
    + folder 1
    + folder 2
+ vendor
    + vender1
        + lib
    + vender2
        + lib
+ composer.json

Are you opening/creating a project in another way, or does composer show the autoload in a different way to show external files?

If you are opening your project in the above way, the current plugin will read EVERYTHING that is associated to a php file in the current workspace.

@TheColorRed
Copy link
Contributor Author

PR #181 introduces a files and exclude setting for telling the parser what files it should/shouldn't parse.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants