Commit Graph

60 Commits (f030a685d21cfa6481073bfdfd3f6031aa02dd21)
 

Author SHA1 Message Date
Hugo Thunnissen f030a685d2 Alter interpret-expression-type to interpret array-member assignment
continuous-integration/drone/push Build was killed Details
interpret-expression-type now interprets assignment values provided through
array access as derived statements. This makes type inference work for cases
like `[$foo[0]]`, where it did not before.
1 year ago
Hugo Thunnissen 0c0c1ca381 Add test for phpinspect-get-pattern-type-in-block
continuous-integration/drone/push Build was killed Details
1 year ago
Hugo Thunnissen 8cd4dc2025 Remove commented code + tidy some formatting 1 year ago
Hugo Thunnissen 224bbd7916 Implement array member type inference
phpinspect now understands typed arrays!
1 year ago
Hugo Thunnissen ae3acbdbe1 Disable auto-reindexing by default
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen 97377c2922 Fix bugs in phpinspect-fix-imports
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen 1b1cf45638 Fix bug in extended classes' method merging + add some tests
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen e65b268cea Implement @method annotation indexation
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen 350850c07a Fix phpinspect-index-static-methods test
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen dbf0ec0390 Transition from index script to autoloader
continuous-integration/drone/push Build is failing Details
2 years ago
Hugo Thunnissen ca8d0972ff Implement psr-0 and psr-4 autoloaders 2 years ago
Hugo Thunnissen ef9a7336cf Replace virtual-directory with more general virtual-fs implementation 2 years ago
Hugo Thunnissen 153ff71fcf WIP: Implement psr0 and psr4 autoload strategies
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen 43ab1bd99b Make sure that the worker is running during tests
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2 years ago
Hugo Thunnissen 56eaa3b36d Replace index-thread with more generic and encapsulated worker type
continuous-integration/drone/push Build is failing Details
The new implementaiton makes the background thread more extensible in terms of
the types of tasks that it can execute. It also allows for the injection of a
worker as dependency of project instances, which will make automated testing
easier in the future.
2 years ago
Hugo Thunnissen 1816495538 Use thread-live-p in stead of thread-alive-p for emacs 28.1 support
continuous-integration/drone/push Build is passing Details
2 years ago
Hugo Thunnissen 2fd575dbf5 Add drone.yml
continuous-integration/drone/push Build is failing Details
2 years ago
Hugo Thunnissen 0bc9e795b2 Fix tests and patch bugs that came to light in the process 2 years ago
Hugo Thunnissen 3a3e2cd362 Update README with new development repository location 2 years ago
Hugo Thunnissen 0b210309e7 Fix variable suggestion when there are loose dollar signs in the buffer 2 years ago
Hugo Thunnissen c0786db131 WIP: Index every possibly required type ahead of time.
- Changed project and after-save-action implementation to include imports in
  opened files. This way any types that are used in a file will have completion
  available for it ahead of time.
- Extra attributes have been added to phpinspect--class to check whether or not
  its file has been indexed/is queued for indexation yet.
- Misc: Fixed eldoc function bug that was caused by a previous commit
2 years ago
Hugo Thunnissen 2e487e7810 Fix resolving of function argument types 2 years ago
Hugo Thunnissen a2ce841555 WIP: Make index thread block/wakeup when queue is empty/populated 2 years ago
Hugo Thunnissen 341afd42da WIP: Index types in the background using collaborative threading.
Created queue for types to be indexed in separate thread and tried to limit
lock-ups as much as possible by using idle timers.
2 years ago
Hugo Thunnissen f013b3c709 WIP: Support ambiguous typehints
- Try to infer type of "object" typehint by using the return annotation
- Support late static binding with "static" and "this" return type
2 years ago
Hugo Thunnissen f8bf0b611a WIP: List static methods when requested 2 years ago
Hugo Thunnissen 98e88d45ac WIP: Fix find-class-file 2 years ago
Hugo Thunnissen e07e1ed9e6 WIP: Split code up into separate files 2 years ago
Hugo Thunnissen 74bd0ad434 WIP: New data type for cached classes 2 years ago
Hugo Thunnissen a60dba5f11 WIP: new struct to represent types, and string comparison optimization with obarray 2 years ago
Hugo Thunnissen 2b85271b2b Test + fix get-last-statement-in-token for static attribute references 3 years ago
Hugo Thunnissen 8caf967b57 Add test for resolve-type-from-context with preceding bareword 3 years ago
Hugo Thunnissen 6b8db3a318 Test and fix eldoc function for static methods
Add tests for
- phpinspect-eldoc-function in the context of static attribute and object attribute references
- phpinspect-resolve-type-from-context in the context of static attribute references

Fix:
- phpinspect-get-derived-statement-type-in-block
3 years ago
Hugo Thunnissen f5fe299c01 Make functions that access the filesystem configurable and add test
Add test for `phpinspect-resolve-type-from-context'
3 years ago
Hugo Thunnissen a6bb09b2b3 Test and fix static function indexation 3 years ago
Hugo Thunnissen e57edab86e Index new files when no FQN can be found for a type 3 years ago
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