Commit Graph

174 Commits (master)
 

Author SHA1 Message Date
Hugo Thunnissen faa936a4f0 Test type-resolver + make type resolving work for "blocked" namespaces
Test type-resolver created from resolvecontext with:
 - File containing single namespace and no block
 - File containing one namespace with a block ('{}')
 - File containing multiple namespaces with blocks

Patch `phpinspect--make-type-resolver-for-resolvecontext' to support namespaces with
blocks.
3 years ago
Hugo Thunnissen df821c4039 Add ticket tracker link to README 3 years ago
Hugo Thunnissen dbbc5927e4 Enable company-mode before changing its variables in README example 3 years ago
Hugo Thunnissen 1e4e865c9b Add variables nested in (function or other) blocks to candidates 3 years ago
Hugo Thunnissen c50f2ae09b Fix resolving of "static" and "self" types 3 years ago
Hugo Thunnissen 4c2b3dd601 Only attempt to return the inside class name when it is non-nil 3 years ago
Hugo Thunnissen f8689ac9df Return parser function in stead of just the symbol 3 years ago
Hugo Thunnissen 825a3de2c4 Add indexation command to mode docstring + add install to readme 3 years ago
Hugo Thunnissen 15c175dc61 Only attempt to byte compile when the handler isn't already compiled 3 years ago
Hugo Thunnissen 59a098a4cd Add note about parser cache to defhandler + add config example 3 years ago
Hugo Thunnissen 098146bfc5 Add resolvecontext structure and optimze type resolving process
The resolvecontext will from now on be used as store for all data required to resolve the
return type of a statement at any given point.

`phpinspect--word-end-regex` has been altered to match words that are directly followed by
other, "non-word" characters.

`phpinspect-describe-handler` has been added to list and describe handlers during runtime.

A bug has been fixed that made the parser interpret the "static" keyword inside functions
as a class attribute in stead of just a word.

Aside from the company backend, `phpinspect-eldoc-function` has been simplified and
adapted to make use of the resolvecontext structure.

The resolving of statment/variable types has been altered to make use of imperative loops
in a couple of places for the sake of simplicity and optimization.
3 years ago
Hugo Thunnissen e8f486f095 Improve codestyle and documentation + add tests for indexation
This commit contains one logic change: Changed add-to-list usage to cl-pushnew in
phpinspect-merge-indexes implementation for classes. The resulting function output should
be the same.
3 years ago
Hugo Thunnissen b338aa9b75 Fix most of the byte-compilation warnings 3 years ago
Hugo Thunnissen 4430aaccb9 Rework parser code
The parser is now JIT compiled. Parser functions are generated and byte-compiled on the
fly as needed and stored in an obarray. Handler functions are stored in an obarray as well
and are compiled at load time. See docstrings and code for more information.

Macro use has been brought back to a minimum and macros have been reworked to make the
code easier to reason about.

To be able to redifine parser functions during runtime,
"M-x phpinspect-purge-parser-cache" has been added.

To redifine a handler function, one can use `phpinspect-defhandler` after loading
phpinspect.el and purge the parser cache to make sure that the new function definition is
used.
3 years ago
Hugo Thunnissen 811a9a9141 Add more tests for the parser code 3 years ago
Hugo Thunnissen f7d88a90f4 Implement some general tests for the parser code 3 years ago
Hugo Thunnissen f7c2a49b25 Remove dependency on php-project.el
Remove dependency on php-project.el by implementing a standalone version of
`phpinspect--get-project-root`.
3 years ago
Kenta Usami bbc37bea32 Update README code format and to use setq-local
setq-local was added in Emacs 24.3 (released in 2013).
3 years ago
Hugo Thunnissen 8d3bd21015 Add license information 3 years ago
Kenta Usami 0350069e34 Fix native (built-in) type names
Fix phpinspect-native-types to valid PHP built-in type names.

See the code below for the types that can be described as valid return types:
https://3v4l.org/fJgLA#v8.0.10
3 years ago
Hugo Thunnissen d6c63ef6f4 Truncate "uses_own" index file before filling the index 3 years ago
Hugo Thunnissen ad12203a91 Add more parts of phpns that were apparently still required 3 years ago
Hugo Thunnissen 50d2bfeebe Change indexer's cache dir from/to .cache/{phpns,phpinspect} 3 years ago
Hugo Thunnissen 681f13d4de Initial commit: Move out of personal dotfile repository. 3 years ago