diff --git a/company-phpactor.el b/company-phpactor.el index c140c7c..d350bba 100644 --- a/company-phpactor.el +++ b/company-phpactor.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2018 Friends of Emacs-PHP development ;; Author: Martin Tang +;; Mikael Kermorgant ;; Created: 18 Apr 2018 ;; Version: 0.1.0 ;; Keywords: tools, php @@ -56,15 +57,17 @@ Here we create a temporary syntax table in order to add $ to symbols." (mapcar (lambda (suggestion) (setq candidate (plist-get suggestion :name)) - (put-text-property 0 1 'annotation (plist-get suggestion :info) candidate) + (put-text-property 0 1 'annotation (plist-get suggestion :short_description) candidate) (put-text-property 0 1 'type (plist-get suggestion :type) candidate) + (if (string= (plist-get suggestion :type) "class") + (put-text-property 0 1 'class_import (plist-get suggestion :class_import) candidate)) candidate) suggestions))) (defun company-phpactor--post-completion (arg) "Trigger auto-import of completed item ARG when relevant." - (if (string= (get-text-property 0 'type arg) "t") - (phpactor-import-class (get-text-property 0 'annotation arg)))) + (if (get-text-property 0 'class_import arg) + (phpactor-import-class (get-text-property 0 'class_import arg)))) (defun company-phpactor--annotation (arg) "Show additional info (ARG) from phpactor as lateral annotation." diff --git a/composer.json b/composer.json index 8c82b3d..aa3467e 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "phpactor/completion": "dev-master", "phpactor/docblock": "@dev", "phpactor/path-finder": "@dev", - "phpactor/phpactor": "^0.7.0", + "phpactor/phpactor": "^0.9.0", "phpactor/source-code-filesystem": "@dev", "phpactor/worse-reflection": "@dev", "phpbench/phpbench": "@dev", diff --git a/composer.lock b/composer.lock index 79f15e9..35a946e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f6e44236958af26a3afb9dc03503a7fd", + "content-hash": "a1db134b14ec1f3e7522e97f7cd2bd29", "packages": [ { "name": "beberlei/assert", - "version": "v2.9.5", + "version": "v2.9.6", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "c07fe163d6a3b3e4b1275981ec004397954afa89" + "reference": "ec9e4cf0b63890edce844ee3922e2b95a526e936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/c07fe163d6a3b3e4b1275981ec004397954afa89", - "reference": "c07fe163d6a3b3e4b1275981ec004397954afa89", + "url": "https://api.github.com/repos/beberlei/assert/zipball/ec9e4cf0b63890edce844ee3922e2b95a526e936", + "reference": "ec9e4cf0b63890edce844ee3922e2b95a526e936", "shasum": "" }, "require": { @@ -59,20 +59,20 @@ "assertion", "validation" ], - "time": "2018-04-16T11:18:27+00:00" + "time": "2018-06-11T17:15:25+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.1.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", "shasum": "" }, "require": { @@ -103,7 +103,7 @@ "Xdebug", "performance" ], - "time": "2018-04-11T15:42:36+00:00" + "time": "2018-08-31T19:07:57+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -266,12 +266,12 @@ "source": { "type": "git", "url": "https://github.com/JetBrains/phpstorm-stubs.git", - "reference": "15620ee9d8df58a209000a81759277570bc89317" + "reference": "eae9c1b5b5fa6c0e1d5a8a845b0c9269f3cc35eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/15620ee9d8df58a209000a81759277570bc89317", - "reference": "15620ee9d8df58a209000a81759277570bc89317", + "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/eae9c1b5b5fa6c0e1d5a8a845b0c9269f3cc35eb", + "reference": "eae9c1b5b5fa6c0e1d5a8a845b0c9269f3cc35eb", "shasum": "" }, "require-dev": { @@ -296,7 +296,7 @@ "stubs", "type" ], - "time": "2018-08-02T10:56:10+00:00" + "time": "2018-09-14T12:31:19+00:00" }, { "name": "lstrojny/functional-php", @@ -443,12 +443,12 @@ "source": { "type": "git", "url": "https://github.com/Microsoft/tolerant-php-parser.git", - "reference": "58814f104f8de9c96d295487b70c5734b9c77959" + "reference": "7ea773435b57ede3507c162c86e8a013625bcccf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Microsoft/tolerant-php-parser/zipball/58814f104f8de9c96d295487b70c5734b9c77959", - "reference": "58814f104f8de9c96d295487b70c5734b9c77959", + "url": "https://api.github.com/repos/Microsoft/tolerant-php-parser/zipball/7ea773435b57ede3507c162c86e8a013625bcccf", + "reference": "7ea773435b57ede3507c162c86e8a013625bcccf", "shasum": "" }, "require": { @@ -476,7 +476,7 @@ } ], "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios", - "time": "2018-07-27T16:59:32+00:00" + "time": "2018-09-10T01:10:27+00:00" }, { "name": "monolog/monolog", @@ -611,12 +611,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/class-mover.git", - "reference": "f5f2b9db5ed624643b00eac042fabe80a00d32a9" + "reference": "529a0c9f4ae76b69eebd48f03fd8fcf9d54fda01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/class-mover/zipball/f5f2b9db5ed624643b00eac042fabe80a00d32a9", - "reference": "f5f2b9db5ed624643b00eac042fabe80a00d32a9", + "url": "https://api.github.com/repos/phpactor/class-mover/zipball/529a0c9f4ae76b69eebd48f03fd8fcf9d54fda01", + "reference": "529a0c9f4ae76b69eebd48f03fd8fcf9d54fda01", "shasum": "" }, "require": { @@ -652,7 +652,7 @@ } ], "description": "Library for moving classes", - "time": "2018-05-04T12:44:57+00:00" + "time": "2018-08-04T19:37:16+00:00" }, { "name": "phpactor/class-to-file", @@ -660,12 +660,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/class-to-file.git", - "reference": "a2d586fee61ecf9f382cd8afc299dce2abbb6a65" + "reference": "53798359f0c4f87dedc4833fd2c92fb02ce90757" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/class-to-file/zipball/a2d586fee61ecf9f382cd8afc299dce2abbb6a65", - "reference": "a2d586fee61ecf9f382cd8afc299dce2abbb6a65", + "url": "https://api.github.com/repos/phpactor/class-to-file/zipball/53798359f0c4f87dedc4833fd2c92fb02ce90757", + "reference": "53798359f0c4f87dedc4833fd2c92fb02ce90757", "shasum": "" }, "require": { @@ -698,7 +698,7 @@ } ], "description": "Library to covert class names to file paths and vice-versa", - "time": "2018-01-28T09:43:54+00:00" + "time": "2018-09-09T12:54:13+00:00" }, { "name": "phpactor/code-builder", @@ -706,12 +706,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/code-builder.git", - "reference": "63e622574b1d43e33ee8f2bc311f2f71ca55fe7b" + "reference": "68832ef137c9af323180f42c3787d54f3c94579e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/code-builder/zipball/63e622574b1d43e33ee8f2bc311f2f71ca55fe7b", - "reference": "63e622574b1d43e33ee8f2bc311f2f71ca55fe7b", + "url": "https://api.github.com/repos/phpactor/code-builder/zipball/68832ef137c9af323180f42c3787d54f3c94579e", + "reference": "68832ef137c9af323180f42c3787d54f3c94579e", "shasum": "" }, "require": { @@ -719,6 +719,7 @@ "twig/twig": "^2.4" }, "require-dev": { + "phpactor/test-utils": "^1.0@dev", "phpactor/worse-reflection": "^1.0@dev", "phpunit/phpunit": "^6.2" }, @@ -744,7 +745,7 @@ } ], "description": "Generating and modifying source code", - "time": "2018-05-10T15:26:36+00:00" + "time": "2018-09-01T11:49:03+00:00" }, { "name": "phpactor/code-transform", @@ -800,12 +801,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/completion.git", - "reference": "22d5ba1925ea428390afdf521f8cdd2052f7bccd" + "reference": "3138e9dc45d4bc842a19482c31ca719716ba26a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/completion/zipball/22d5ba1925ea428390afdf521f8cdd2052f7bccd", - "reference": "22d5ba1925ea428390afdf521f8cdd2052f7bccd", + "url": "https://api.github.com/repos/phpactor/completion/zipball/3138e9dc45d4bc842a19482c31ca719716ba26a0", + "reference": "3138e9dc45d4bc842a19482c31ca719716ba26a0", "shasum": "" }, "require": { @@ -841,7 +842,7 @@ } ], "description": "Completion library for Worse Reflection", - "time": "2018-08-02T07:24:03+00:00" + "time": "2018-09-09T11:50:43+00:00" }, { "name": "phpactor/docblock", @@ -849,12 +850,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/docblock.git", - "reference": "746f0c61ca738b5148ddc6d5b2f155c6d8e16183" + "reference": "ae0dd14ff4ddfd263315a82a93758fd7e1c7ed52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/docblock/zipball/746f0c61ca738b5148ddc6d5b2f155c6d8e16183", - "reference": "746f0c61ca738b5148ddc6d5b2f155c6d8e16183", + "url": "https://api.github.com/repos/phpactor/docblock/zipball/ae0dd14ff4ddfd263315a82a93758fd7e1c7ed52", + "reference": "ae0dd14ff4ddfd263315a82a93758fd7e1c7ed52", "shasum": "" }, "require-dev": { @@ -877,7 +878,7 @@ } ], "description": "Simple Docblock Parser", - "time": "2018-04-28T16:56:30+00:00" + "time": "2018-09-09T14:00:15+00:00" }, { "name": "phpactor/path-finder", @@ -926,16 +927,16 @@ }, { "name": "phpactor/phpactor", - "version": "0.7.0", + "version": "0.9.0", "source": { "type": "git", "url": "https://github.com/phpactor/phpactor.git", - "reference": "a22c370917e57dbbb8d4de0189413ac0fbd5b7b9" + "reference": "f53bec1af21280c4e9aff5ccf00db10ebdefe73f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/phpactor/zipball/a22c370917e57dbbb8d4de0189413ac0fbd5b7b9", - "reference": "a22c370917e57dbbb8d4de0189413ac0fbd5b7b9", + "url": "https://api.github.com/repos/phpactor/phpactor/zipball/f53bec1af21280c4e9aff5ccf00db10ebdefe73f", + "reference": "f53bec1af21280c4e9aff5ccf00db10ebdefe73f", "shasum": "" }, "require": { @@ -977,7 +978,7 @@ } }, "notification-url": "https://packagist.org/downloads/", - "time": "2018-07-02T20:39:29+00:00" + "time": "2018-09-12T18:28:14+00:00" }, { "name": "phpactor/source-code-filesystem", @@ -985,12 +986,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/source-code-filesystem.git", - "reference": "16f8406af3343bce700ea44e19d8b8945f049ff4" + "reference": "a0b641b9ed4be27810895fdffc31a2cb1c69b31c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/source-code-filesystem/zipball/16f8406af3343bce700ea44e19d8b8945f049ff4", - "reference": "16f8406af3343bce700ea44e19d8b8945f049ff4", + "url": "https://api.github.com/repos/phpactor/source-code-filesystem/zipball/a0b641b9ed4be27810895fdffc31a2cb1c69b31c", + "reference": "a0b641b9ed4be27810895fdffc31a2cb1c69b31c", "shasum": "" }, "require": { @@ -1023,7 +1024,7 @@ } ], "description": "Filesystem library for working with source code files", - "time": "2018-05-06T20:02:36+00:00" + "time": "2018-08-03T06:31:35+00:00" }, { "name": "phpactor/worse-reflection", @@ -1031,12 +1032,12 @@ "source": { "type": "git", "url": "https://github.com/phpactor/worse-reflection.git", - "reference": "86e3fbdea0755df50aeeb038656761f56be33773" + "reference": "b3c7fbc796ac60fe1225c4c8d8d305db0ab407ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpactor/worse-reflection/zipball/86e3fbdea0755df50aeeb038656761f56be33773", - "reference": "86e3fbdea0755df50aeeb038656761f56be33773", + "url": "https://api.github.com/repos/phpactor/worse-reflection/zipball/b3c7fbc796ac60fe1225c4c8d8d305db0ab407ee", + "reference": "b3c7fbc796ac60fe1225c4c8d8d305db0ab407ee", "shasum": "" }, "require": { @@ -1075,7 +1076,7 @@ } ], "description": "Lazy AST reflector that is much worse than better", - "time": "2018-07-06T14:18:15+00:00" + "time": "2018-09-02T09:25:02+00:00" }, { "name": "phpbench/container", @@ -1172,16 +1173,16 @@ "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "f1aeadeff34e4886186a1b1953a585c241e03ea7" + "reference": "7a33cea9dcb39fd14c29e69f1dea3070ebecae21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/f1aeadeff34e4886186a1b1953a585c241e03ea7", - "reference": "f1aeadeff34e4886186a1b1953a585c241e03ea7", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/7a33cea9dcb39fd14c29e69f1dea3070ebecae21", + "reference": "7a33cea9dcb39fd14c29e69f1dea3070ebecae21", "shasum": "" }, "require": { - "beberlei/assert": "^2.4", + "beberlei/assert": "^2.4|^3.0", "doctrine/annotations": "^1.2.7", "ext-dom": "*", "ext-json": "*", @@ -1240,7 +1241,7 @@ } ], "description": "PHP Benchmarking Framework", - "time": "2018-06-18T16:02:11+00:00" + "time": "2018-09-08T09:00:14+00:00" }, { "name": "psr/container", @@ -1441,7 +1442,7 @@ }, { "name": "symfony/console", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1510,16 +1511,16 @@ }, { "name": "symfony/debug", - "version": "v4.1.1", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d" + "reference": "47ead688f1f2877f3f14219670f52e4722ee7052" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/dbe0fad88046a755dcf9379f2964c61a02f5ae3d", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d", + "url": "https://api.github.com/repos/symfony/debug/zipball/47ead688f1f2877f3f14219670f52e4722ee7052", + "reference": "47ead688f1f2877f3f14219670f52e4722ee7052", "shasum": "" }, "require": { @@ -1562,20 +1563,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-08T09:39:36+00:00" + "time": "2018-08-03T11:13:38+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.12", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", "shasum": "" }, "require": { @@ -1612,20 +1613,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" + "time": "2018-08-10T07:29:05+00:00" }, { "name": "symfony/finder", - "version": "v4.1.1", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" + "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", + "url": "https://api.github.com/repos/symfony/finder/zipball/e162f1df3102d0b7472805a5a9d5db9fcf0a8068", + "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068", "shasum": "" }, "require": { @@ -1661,20 +1662,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-07-26T11:24:31+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.1.1", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef" + "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", - "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1913f1962477cdbb13df951f8147d5da1fe2412c", + "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c", "shasum": "" }, "require": { @@ -1715,29 +1716,32 @@ "configuration", "options" ], - "time": "2018-05-31T10:17:53+00:00" + "time": "2018-07-26T08:55:25+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1770,20 +1774,20 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -1795,7 +1799,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1829,20 +1833,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v4.1.1", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a" + "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", - "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", + "url": "https://api.github.com/repos/symfony/process/zipball/86cdb930a6a855b0ab35fb60c1504cb36184f843", + "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843", "shasum": "" }, "require": { @@ -1878,20 +1882,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "time": "2018-08-03T11:13:38+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.12", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", "shasum": "" }, "require": { @@ -1937,7 +1941,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-03T23:18:14+00:00" + "time": "2018-08-10T07:34:36+00:00" }, { "name": "twig/twig", diff --git a/phpactor.el b/phpactor.el index 9edf1a1..972550a 100644 --- a/phpactor.el +++ b/phpactor.el @@ -3,6 +3,8 @@ ;; Copyright (C) 2018 Friends of Emacs-PHP development ;; Author: USAMI Kenta +;; Mikael Kermorgant + ;; Created: 8 Apr 2018 ;; Version: 0.1.0 ;; Keywords: tools, php @@ -75,6 +77,7 @@ (defvar phpactor--buffer-name "*Phpactor*") (defconst phpactor-command-name "phpactor") +(defconst phpactor--supported-rpc-version "1.0.0") ;; Special variables (defvar phpactor--execute-async nil) @@ -180,7 +183,7 @@ (file_references . phpactor-action-file-references) (input_callback . phpactor-action-input-callback) (information . phpactor-action-information) - (replace_file_source . phpactor-action-replace-file-source))) + (update_file_source . phpactor-action-update-file-source))) ;; Helper functions: (cl-defun phpactor--action-input-parameters (value-type &key default label choices type) @@ -329,7 +332,7 @@ (apply #'phpactor-action-dispatch (list :action (plist-get action :name) :parameters (plist-get action :parameters)))) actions)) -(cl-defun phpactor-action-open-file (&key path offset) +(cl-defun phpactor-action-open-file (&key path offset force_reload) "Open file from Phpactor." (unless (and path offset) (user-error "Definition not found")) @@ -339,6 +342,11 @@ (with-no-warnings (ring-insert find-tag-marker-ring (point-marker)))) + (let ((buf (find-buffer-visiting path))) + (when (and force_reload buf) + (progn + (set-buffer buf) + (revert-buffer t t t)))) (find-file path) (goto-char (1+ (byte-to-position offset)))) @@ -424,7 +432,7 @@ function." (error "Invalid rcs patch or internal error in phpactor--apply-rcs-patch"))))))) (move-to-column column))) -(cl-defun phpactor-action-replace-file-source (&key path source) +(cl-defun phpactor-action-update-file-source (&key path source edits) "Replace the source code in the current file." (interactive) (let ((tmpfile (make-temp-file "phpactor" nil ".php")) @@ -450,9 +458,11 @@ function." (delete-file tmpfile)))) ;; Dispatcher: -(cl-defun phpactor-action-dispatch (&key action parameters) +(cl-defun phpactor-action-dispatch (&key action parameters version) "Execite action by `NAME' and `PARAMETERS'." - (phpactor--add-history 'phpactor-action-dispatch (list :action action :parameters parameters)) + (when (and version (not (equal phpactor--supported-rpc-version version))) + (error "Phpactor uses rpc protocol %s whereas this package requires %s" version phpactor--supported-rpc-version)) + (phpactor--add-history 'phpactor-action-dispatch (list :action action :parameters parameters :version version)) (let ((func (cdr-safe (assq (intern action) phpactor-action-table)))) (if func (apply func parameters)