Commit Graph
293 Commits
Author SHA1 Message Date
Ilya.Kazakevich 9152012eb1 Trying to use no implicit context on name resolver to improve performance as desribed in PY-15459 2015-04-21 23:47:02 +03:00
Alexey Kudravtsev 2e0e544145 fields made final 2015-04-20 13:24:37 +03:00
Mikhail Golubev ad899a88ac Add method isEmpty() in PySequenceExpression, simplify several usages of getElements() 2015-04-14 18:47:50 +03:00
Mikhail Golubev 8f30a5836a PY-15469 Delimiter "->" in Python is parsed as single token
Thanks to that, pressing enter no longer inserts backslash in the
middle of "->" sequence (and such corrupted code is properly
highlighted now on).
2015-04-08 16:28:54 +03:00
Ilya.Kazakevich e8fc164738 Interface PyFunction extracted from PyFunctionImpl for (for PY-15459) to create PyFunction interface in python-psi module 2015-04-06 23:32:29 +03:00
Mikhail Golubev 77b11662fa PY-2903 Take into account preceding comments when picking place for extracted method
Interestingly, test existed already but was disabled a long ago.
2015-04-02 20:08:32 +03:00
Mikhail Golubev db4701a2d8 Slightly refactor PyExtractMethodHandler
* Renamed PyPsiUtil#getStatement to PyPsiUtil#getParentRightBefore as
this name more clearly describes method's functionality.
* Return Couple<PsiElement> instead of awkward two-items array or
PsiElements.
2015-04-02 20:08:31 +03:00
Mikhail Golubev 987fdbcdac PY-15342 Call getFirstChild instead of getLastChild in PyPsiUtil#deleteAdjacentCommaWithWhitespaces 2015-04-02 16:36:00 +03:00
Andrey Vlasovskikh 31a33949a3 Merge branch 'typing-update' 2015-04-01 21:09:18 +03:00
Andrey Vlasovskikh ba7d99f478 Moved annotation-based type inference to PyTypingTypeProvider
We couldn't do check for 'typing.Any' inside PyTypingTypeProvider, so
we had to put some 'typing' knowlegde into PyFunctionImpl and
PyParameterImpl which wasn't elegant. Also we couldn't combine
type information from annotations and default arguments that was
required for Optional[T] for 'x: T = None'. Now we can implement it.
2015-03-31 22:25:34 +03:00
Andrey Vlasovskikh bf1d5b924e PyTypeProvider can return 'Any' type for parameter and return types
Previously there was no way for a type provider to tell that the type
is really 'Any'. The 'null' return value was just a sign that the
provider doesn't know the return type and we should try other
alternatives.
2015-03-31 18:07:34 +03:00
Andrey Vlasovskikh f1d939b9e4 Renamed 'unknown' to 'Any' for displaying the 'null' type (PY-15206) 2015-03-30 19:34:12 +03:00
Mikhail Golubev 637325192a PY-15342 Use PSI to find and delete comma to avoid excess hopping between PSI and AST 2015-03-30 16:46:32 +03:00
Mikhail Golubev c478b45ddf PY-15342 Further reduce duplication using updated PyPsiUtils.deleteAdjacentComma
PyPsiUtils.deleteAdjacentComma is now more robust and delete comma
with surrounding whitespaces of any type in one action.
2015-03-30 16:46:32 +03:00
Mikhail Golubev 2998c75dbe PY-15342 Extract common method for searching closest adjacent comma in utils and PSI elements
Override removeChildInternal in PyGlobalStatement and
PyNonlocalStatement in similar fashion as it's done already in
PyArgumentList and PySequenceExpression, i.e. delete dangling comma
if any
2015-03-30 16:46:31 +03:00
Andrey Vlasovskikh 4257881862 Added Python 3.5 to all language levels list
The list of all the language levels was defined in
UnsupportedFeaturesUtil, so it was easy to forget to update it when
introducing a new language level. Now it's defined in LanguageLevel.
2015-03-25 12:37:58 +03:00
Andrey Vlasovskikh a77b51054b Compeltion for matrix multiplication methods (PY-15390) 2015-03-24 18:58:53 +03:00
Andrey Vlasovskikh 009cb3ee3d Resolve '@' to '__matmul__' and '__rmatmul__' (PY-15390) 2015-03-24 18:42:45 +03:00
Andrey Vlasovskikh 186032ab9d Added PyAugAssignmentStatement.getOperator()
There was no public API for accessing the operator of an augmented
assignment expression, the *Impl class was used instead which is a
bad practice.
2015-03-24 18:08:29 +03:00
Andrey Vlasovskikh e7db2ff39c Parsing of '@' and '@=' operators (PY-15390)
We have to introduce a new lexeme '@=' and re-define '@' to become a
binary operator as well as the prefix of the decorator.
2015-03-24 17:40:42 +03:00
Andrey Vlasovskikh d093874c3a Introduced a new language level for Python 3.5 2015-03-24 15:50:20 +03:00
Andrey Vlasovskikh 67bafd87ed Use Python 3.4 as a default Python 3 instead of 3.3
3.4 is the current stable version of Python 3.
2015-03-24 15:35:12 +03:00
Mikhail Golubev b5c92ae0ba Rename com.jetbrains.python.psi.Callable to PyCallable so as not to clash with java.util.concurrent.Callable 2015-02-27 15:14:34 +03:00
Mikhail Golubev 5a438555f1 Merge remote-tracking branch 'origin/master' into mikhail.golubev/py-attribute-inference 2015-02-20 21:31:01 +03:00
Mikhail Golubev fda04c7ae3 Add suggestions from IDEA-CR-1203 2015-01-21 19:18:47 +03:00
Ilya.Kazakevich 834b35ff54 PY-14216 Code completion for Model.objects does not work with Django 1.7.x
PY-14714 Unresolved attribute reference 'objects' for class 'Foo'

Docs added
2014-12-31 16:38:08 +03:00
Ilya.Kazakevich 3220e2bacd PY-14216 Code completion for Model.objects does not work with Django 1.7.x
PY-14714 Unresolved attribute reference 'objects' for class 'Foo'
2014-12-30 21:00:29 +03:00
Andrey Vlasovskikh 645bd3a1b2 If mro() is overridden in metaclass, use normal MRO + unresolved ancestor (PY-11401)
We cannot evaluate the result of an overridden mro() method, so we
don't know the actual MRO chain. Let's assume that MRO is almost the
same as without this override and add an element of uncertainty by
appending a fake unresolved ancestor type to the MRO chain. Doing so
results in, for example, the unresolved references inspection ignoring
unresolved references for such a class.
2014-12-23 18:05:48 +03:00
Andrey Vlasovskikh 41226d7f4b Use separate type eval context for code completion
We used to have context.allowLocalUsages() for permitting a code
analysis to guess types from file-local function calls. This analysis
mode came into conflict with the new structural types, since they both
provided types for function parameters. Another problem is that the user
used to see the types inferred from local calls in the documentation
pop-up and it was not clear where did they come from.

The solution is to introduce a new type eval context for code completion
only named TypeEvalContext.codeCompletion() and allow file-local call
based type inference only in this context.
2014-12-15 17:08:54 +03:00
Andrey Vlasovskikh 229c254abc Fixed collecting wrong '__contains__' attribute for structural types
The 'x in y' expression implies that 'y' has the '__contains__'
attribute, while our references in qualified expressions tell that
the 'x' references the name '__contains__'. In order to fix this we have
to treat the operators with a receiver on the right side of the
expression differently.
2014-12-12 15:58:23 +03:00
Alexey Kudravtsev a62aab7910 CharSequence instead of String 2014-12-04 14:22:14 +03:00
Ilya.Kazakevich a94093cec4 modification fix 2014-11-25 00:13:13 +03:00
Andrey Vlasovskikh c076beb8f3 Use getModificationCount() instead (PY-14376, PY-14496)
Because it is changed on every PSI modification, not on the external
interface of a modification.
2014-11-24 13:49:29 +03:00
Mikhail Golubev 8a75043458 Improve javadoc for PointInImport and clean up a bit in ResolveImportUtil 2014-11-14 16:25:30 +03:00
Andrey Vlasovskikh 6ec4f8954f Removed redundant PyQualifiedExpression.getRefernece() already present in PyReferenceOwner 2014-10-16 19:04:50 +04:00
Andrey Vlasovskikh e083779793 Updated copyright 2014-10-16 17:56:38 +04:00
Andrey Vlasovskikh bf58d9d3ca Added copyright 2014-10-16 17:54:28 +04:00
Andrey Vlasovskikh 7285a8830f Cleanup 2014-10-16 17:45:34 +04:00
Andrey Vlasovskikh c1d88fb64b Added TypeEvalConstraints.toString() 2014-10-16 17:45:08 +04:00
Andrey Vlasovskikh 05dd15fa9e Reformatted code 2014-10-16 17:42:57 +04:00
Ilya.Kazakevich 9c8ce8b94d PY-14081 Django: QuerySet.as_manager() code editing is really slow
Context cache added
2014-10-14 23:32:38 +04:00
Ilya.Kazakevich 550975842e PY-13180 Pycharm 3.4: Right mouse click on selected text inside unicode string hangs out IDE interface for 20-30 seconds
PY-13983 PyCharm hangs (~100% CPU) when right clicking highlighted text
TODO: Add tests (performance and modification)
2014-10-10 19:35:35 +04:00
Ilya.Kazakevich de5f5f0f76 PY-13740: Django 1.7 QuerySet.as_manager() code completion support 2014-10-06 21:37:51 +04:00
Ilya.Kazakevich e51beb2ff7 PY-13994 Apps in INSTALLED_APPS are not recognised when using new AppConfig method in Django 1.7
(todo: add tests, support default_app_config )
2014-09-27 00:33:10 +04:00
Ilya.Kazakevich 4f8f8948bd PY-13993 "settings.py" can't be found if website name differs from project folder name
(TODO: Add tests)
2014-09-25 01:59:03 +04:00
nik 2fee7db5c6 icon size reduced for Darcula and Retina icons (605K bytes in total) 2014-09-19 12:22:29 +04:00
Andrey Vlasovskikh f040abec0e Refactored getPresentation() for Python elements
Elements no longer inherit default presentation from
PyPresentableElementImpl. Most of the presentation logic has been moved
from PyStructureViewElement to getPresentation() of particular elements.
Added PyElementPresentation class that can be customized via
subclassing.
2014-09-03 19:11:30 +04:00
Andrey Vlasovskikh 1bb7350189 Merge branch 'typing' 2014-08-22 19:23:56 +04:00
Andrey Vlasovskikh b8d75dc401 Refactored PyAnnotation into a PyTypedElement 2014-08-19 00:14:18 +04:00
Andrey Vlasovskikh 184e12ec19 Added nullity annotations 2014-08-18 23:49:12 +04:00