Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add completions for PHP functions with descriptions, return types and and params #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joehoyle
Copy link

This significantly improves the UX for PHP projects by adding
autocompletion configs for PHP function return values, parameter names,
descriptions and "since version" to the description.

The list of functions is generated from the JetBrains PHP-Stubs repo
(https://github.com/JetBrains/phpstorm-stubs)

This looks like this:

paramters.

This significantly improves the UX for PHP projects by adding
autocompletion configs for PHP function return values, paramter names,
descriptions and "sinse version" to the description.

The list of functions is generated from the JetBrains PHP-Stubds repo
(https://github.com/JetBrains/phpstorm-stubs)
@joehoyle
Copy link
Author

I also added PHP constants and class names.

@Ingramz
Copy link
Contributor

Ingramz commented Sep 29, 2016

Good job @joehoyle, but can we somehow automate this in a way that anyone can update these programmatically in the future?

Similar to https://github.com/atom/language-less/blob/master/update.coffee

@joehoyle
Copy link
Author

@Ingramz sure, I have a script to do this in PHP which builds the whole settings.json file - I can add that too - it's in PHP so anyone wanting to update it will need that of course, this is because the PHP Parser is written in PHP.

@joehoyle
Copy link
Author

@Ingramz ok I added the update project this it's own readme too.

@joehoyle
Copy link
Author

@Ingramz any update here?

@Ingramz
Copy link
Contributor

Ingramz commented Oct 11, 2016

@joehoyle very cool! Only pitfall that I am seeing here is that JSON file is re-generated and not simply modified. By all means this is better than no script. Edit: the reason for that is that people might try to modify the JSON directly, which can be easily overwritten by the script.

Also I have no clue if using JSON instead of CSON is desired, but I understand that's because of PHP limitations. I also thought of rewriting the scripts to pure javascript, which seems to be possible (perhaps using this and this). This is not required, just something that might be easier to maintain for javascript-oriented community.

In addition to that, some languages have an autocomplete-<some language> package instead of the grammar and autocomplete support being in the same repo. I don't know what the policy on that is though.

@winstliu
Copy link
Contributor

the reason for that is that people might try to modify the JSON directly, which can be easily overwritten by the script.

I'm for all manual changes getting wiped out so that the script is deterministic.

@Ingramz
Copy link
Contributor

Ingramz commented Oct 11, 2016

I still think it would be better to solve it like this https://github.com/atom/language-less/blob/master/update.coffee#L31-L35

@joehoyle
Copy link
Author

Ok, happy to do that!

@joehoyle
Copy link
Author

However, re:

In addition to that, some languages have an autocomplete- package instead of the grammar and autocomplete support being in the same repo. I don't know what the policy on that is though.

I feel like this is a somewhat important point and probably shouldn't continue this effort until this is decided.

@winstliu
Copy link
Contributor

I'm not too sure whether this should belong here or if we're trying to move all autocompletions into dedicated autocomplete packages. /cc @joefitzgerald

@PabloJoan
Copy link

IT BELONGS HERE!!

These are core php functions. not support of a library or a framework.

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

Successfully merging this pull request may close these issues.

4 participants