Snapshot idea/138.538 from git://git.jetbrains.org/idea/community.git
a18cb3f: fix CCE
d7d596e: Groovy: Remove extra spaces after deleted statements. So no extra line feed in Introduce Variable appears
25032fc: Groovy traits : abstract trait methods are not clashing
acf850e: IDEA-126013 fix SOE : maps and lists declared recursively should not fail type inference into recursion
75e06bf: clashing trait methods inspection
7ae9c94: TypesUtil.getQualifiedName(type) should return qname even if type is not resolved
beaa518: GrClassReferenceType.rawType() should return raw type even if type is not resolved
2e95615: Groovy: don't use type.getCanonicalText() to infer type qualified name since it can lead to inferring of type parameters and wasting time
08c6e63: Skipping Ant "After Compilation" task if compilation completed with errors (IDEA-125901)
1856d07: SoftWrapModelImpl refactoring. Mocking SoftWrapPainter to make tests platform-independent.
6246ee2: unlock under finally
9ab9a99: corrected 'contains' for library scopes for files from library sources
2e7fcc7: Merge remote-tracking branch 'origin/master'
5928bf7: Merge remote-tracking branch 'origin/master'
718a6a5: removed explicit virtual file inequality
08cab53: Fixed shebang formatting (PY-12775).
24be689: http://ea.jetbrains.com/browser/ea_problems/57321
bf4c84d: http://ea.jetbrains.com/browser/ea_problems/57321
65944db: Merge remote-tracking branch 'origin/master'
5106fdd: better name: reuseActivation -> reuseToolWindowActivation
e1c9f77: Merge pull request 191 from suman-ganta for IDEA-123890
b66574a: Karma auto-rerun tests shouldn't activate Run toolwindow
56409a9: Karma auto-rerun tests shouldn't activate Run toolwindow every time
880a4db: added test for SurroundWithQuotesAnnotationParameterValueFix that checks that char '\n' replaces by "\n" correctly
f6a393d: lambda: fix parameter types comparing order (IDEA-126056)
ccdc69a: method references: avoid double substitution (IDEA-126062)
e05cddc: JavaFx SceneBuilder b-14 fix
c4e8b2c: Merge remote-tracking branch 'origin/master'
879c23d: PY-13210 Unused star import in Django settings.py
a4351eb: platform: profiling actions overhauled
5ec97cf: IDEA-81568 (ignore FS events from /private unless asked explicitly)
236752e: unused library: use existing graph instead of custom dependency analysis
2a1a7c8: IDEA-126047 - Git Clouds: show commit dialog on deploy
d05243d: prefer junit/testng pattern configuration: detect multiple selection directly by context component (IDEA-126045)
27f10a6: check to prevent contradicted intersection type (IDEA-67600)
046b90c: IDEA-114252 WebStorm clipboard history conflicts with external clipboard manager (ClipMenu) Fix native hangup (steps: periodical "Paste action" update() for toolbar button during Drag&Drop in AppCode UI Designer)
885a24d: don't even schedule excluded files for update upon before contents changed events
122cd32: check for invaild file
de3bf99: optimisation: reduce instances of DirectoryScope created
e2efe2e: cleanup
000bd7a: cleanup
68a5b6e: performance
732238f: performance
2f08301: check for type param numbers in java 1.6 should not rise error if super methods have type params (IDEA-57338)
598f921: testdata for IDEA-61415
6deb5bb: testdata for IDEA-65473
9853fb6: suspicious removeAll: compare type arguments, not qualifiers
1dc83a9: Added ability to pass command-line args to Gradle on project sync/refresh.
e61c327: fix binary compatibility
ef92f2f: fix binary compatibility
40875a7: fix binary compatibility
79d53fd: IDEA-118400 Update Project dialog redesigned, IDEA-106435 ability to perform only update, IDEA-75768 checks saved for Update dialog
d218629: Remove 'zen coding' from emmet support configurable
150b674: HTML: ignore unknown filters
2fac634: @NotNull
99d5348: Emmet CSS completion
2989429: EA-57291 (severity reduced as the real reason is logged earlier)
491dc5f: contract inference initial
bc12a14: extract contract checking to a separatate inspection
75c4257: MethodContract.createConstraintArray
109906e: WEB-12316 PhpStorm performing awful when typing in HTML zones in PHP files
91b7c69: check file on updateExecutionPoint
1591844: WEB-11678 JavaScript debug: step into and step over do not change the line
ec43ad0: Merge remote-tracking branch 'origin/master'
e58ce76: try unnecessary module dependencies to support exported dependencies
a9c8a08: IDEA-125568 (possible NPE in some test setup paths fixed)
2fdb004: Merge remote-tracking branch 'origin/master'
39cc27d: suggest to restart IDEA if user accepted to enable/disable plugins from startup notification (IDEA-121369)
693bbf6: encapsulate fields: preserve comments inside (IDEA-124747)
fcaa3e2: add java specific debugger settings into common settings node
1a3c6c6: code cleanup optimization: run inspections over exactly one element
4c3bda0: Get rid of direct "dispose" call
539f90a: WI-23626 Breakpoint muting does not disable after run. Regression from 7.1.3 to EAP 8.
ffcf607: junit: accept custom matcher descriptions (IDEA-125942)
de7387f: provide remove assignment fix for silly assignment inspection (IDEA-125993)
54e38ee: IDEA-121664 Search Everywhere: results from different categories appear mixed
99adcfd: EA-55292 (NPE fixed)
a87bf9b: Unneeded exception dropped
128b05b: Merge remote-tracking branch 'origin/master'
abc4ba7: GWT builder: test added
f76fea5: test added
30fe2c4: invoke 'save' after 'mark root' action to update iml files immediately
9f6fa54: registering output-to-buildTarget mapping instead of output-to-source mapping to address cases when multiple sources compile into the same output (e.g. Kotlin)
f06f5a6: Handle '@' symbol in ssh username
c142a3c: OC-9609 [Refactoring: common approach for Non-DumbAware mode in folding] +review CR-OC-1561
e4dbc27: fix problem with extending sorted set by one and attempting to increase random access capacity in case of value removal
aa0e217: use more detailed path to file only when opened file name is not unique (IDEA-125958)
fe72975: Marking DuplicateIndex as PsiDependentIndex to attempt to avoid problems with unsaved document indexing being asynchronously committed (EA-36001)
22db3a8: get rid of RowSorters to fix a few exceptions. New Plugin UI has its own table header without swing's row sorters
e5541c8: deprecation inspection uses default serialization
24077b1: push 'change method return type' fix down when variable is checked
65ec59f: icon decoration for external annotations (IDEA-39633)
8f10d71: option to warn about members in deprecated classes (IDEA-112084)
27ec65a: optimize imports under progress (IDEA-125761)
14d3780: Cleanup (formatting)
e5fcad3: revert (java: minor optimization)
f8e2be2: do not recreate breakpoint highlighter if not requested implicitly, this fixes jumping breakpoints on several quick line insertions
44fc624: sql: better varchar and varchar2 completion
b5d09fe: getEqualityObject() fixed for JS debugger
dc3bd73: call applyInformation for all EditorBoundPass for each editor
47336a6: cleanup
67c4e4b: calculate default inspection name by trimming Inspection or InspectionBase
4a0d396: notnull
a3f3988: cleanup
c8337a2: cleanup
8ad9eb1: moved long-running tests into performance suite
395ae29: expand javadoc on PSI validity
48c2fc4: special PIEAE handling for NULL_PSI_ELEMENT (its getUserData throws exceptions)
f3fe82e: IDEA-114252 WebStorm clipboard history conflicts with external clipboard manager (ClipMenu)
3d7f7d2: IDEA-125820 DOM Generator: problem with XML element names matching default/generated imports CR-IC-5549
eadc889: build initial foldings in background (improvements as per CR-IC-5531)
350760c: rename: detect "field would hide local" conflict (IDEA-125934)
0de6aa9: move: do not convert classes to files before move
35005bc: IDEA-125947 not initialized final field should not be raised on any refs from inner classes
62f7acd: plugins: take into account already installed plugins during dependencies check (IDEA-123767)
a673a47: softReference to cache known plugin extensions
3995088: update info: link to the product home page (IDEA-124023)
aa9a7b1: move: filter out nested dirs/files on actionPerformed, update should be fast (IDEA-111413)
e887cc3: Merge remote-tracking branch 'origin/master'
24c1fab: fix thread crash in debug console after syntax error (PY-12600)
49b602b: java: minor optimization
f5f8124: java: helper method for Kotlin
e674dd1: fixed PY-13177 PyCharm hangs on adding incorrect interpreter (python3-pyinotify)
5c41c76: Maven: manifest generation fixes - use ApplicationNamesInfo#getFullProductName for "Created-By" attribute value, redundant code removed
d2752f1: invalidNames is a bit confusing, let's use existingNames; also small cleanup
7b282c4: lots of EA-57109 - PIEAE: LeafPsiElement.invalid. attempt 2.
cf78c48: External System + Gradle: support for running a task before launch of another configuration added. Related issue for Gradle: IDEA-113437 'Before Launch' should support running a Gradle task
6396cd8: IDEA-125900 (resolve of synthetic enum methods in class files fixed)
bb35b26: Cleanup (cached value manager instead of boilerplate)
6f417af: reuse LocalQuickFix because several instances can be handled badly
c44d318: IDEA-104484 Console ExceptionFilters are added twice for debugging java app
e67157d: IDEA-125470 While in editor, wild re-displaying occurs when soft wraps are enabled
2de7658: folding model implementation cleanup
c7a1fbb: fixed NPE in debuggers that do not use value markers
159a46b: JavaRearranger: fixed field caching in case of multiple classes in java file (IDEA-123733)
b3f67525: Added scope and file mask filter to reformat directory/project/module dialogs (IDEA-59850) [CR-IC-5534]
c3a1eb8: Merge remote-tracking branch 'origin/master'
9d5429e: remove variable: do not leave tailing loops/ifs (IDEA-124489)
d6c14fb: Delete LightLexerTestCase
83abbd0: fixing OOME in tests
fd0acc2: temp disable 6520348e0292c4bb47389cb12926dc83826796e7
22c687d: Merge remote-tracking branch 'origin/master'
9102909: use goto.nonProjectScopeDisabler EP to show/hide 'include non-project files' checkbox
0dca1c3: use goto.nonProjectScopeDisabler EP to show/hide non-project items checkbox
def9b6f: EP to disable using Non-project scope for IDEs where this doesn't make sence
6520348: lots of EA-57109 - PIEAE: LeafPsiElement.invalid
1ecc94f: don't set Darcula UI in search text field if it's already set
2357251: rollback NPE fix (found the real problem)
f52fccd: Cleanup (optimization; formatting)
5d85b2b: spped search by value in debugger trees
7e5f8a2: fixed VM leak in debugger tree listener
8771d61: fixed VM leak in object marks
b9abbfb: template ConstructorInsertHandler test (IDEA-101429)
6713978: start type template if at least object was inferred
8540bac: RefCountHolder: allow referenced files' ast to be gc-ed during highlighting
716aa5a: generate name for save scheme dialog
c86e3af: external annotation change should drop all psi cachedValues
ae0bd0f: cleanup
26af3f5: implement equals and hashCode to make two LocalQuickFix instances equal if they refer to one and the same IntentionAction
0ade045: IDEA-125645 On breakpoint hit, opens file in new tab in "active" split -- even if file is already open in tab in "inactive" split
1881ceb: test — auto expressions: filter out expression contained unresolved local variable
3677585: IDEA-103523 MethodMayBeStaticInspection replace qualified usages by class name (reused MakeMethodStaticProcessor)
89905f6: don't hold reference to PsiFile
83bc4af: move AddSpaceInsertHandler.java to lang-impl
769a599: WEB-12348 Quick fixes not always working in Inspection window
18b220c: IDEA-90008 (editor files are refreshed elsewhere, no need to watch)
894818e: Cleanup (deprecated code dropped)
aba3f2f: CreateSwitchIntention removed all operations with Document to exclude possible problems
4c6818a: removed from IdeaPlugin SurroundWithQoutesIntention
044671d: Merge remote-tracking branch 'origin/master'
a109c22: IDEA-121370 Failed Gradle task doesn't block the dependent run configurations
fbf4eb5: Merge remote-tracking branch 'origin/master'
89f5018: imports optimized
baa6389: SurroundWithQuotesAnnotationParameter: intention replaced by quick fix to the corresponding error
5f7a426: no later runnable for anonymous class creation template
05d13a3: Get rid of needless filtering
a8660f4: use "OS user" term
cb71334: fix NPE on linux
930235e: notnull and remove unused field
c7cd901: notnull
83d5484: Color & Fonts panel: generate new name when copy
6cc553f: cleanup
fa4e0deb: remove unused class
e291480: correct checking read-only status for CreateSwitchIntention
cdd07a4: CreateSwitchIntention checks language level and that file is witable
11adc57: Cleanup (warning; unneeded reflection)
b6b5bbd: start template when anonymous class is completed with Object params (need better heuristic)
f9a561c: enable change type signature for anonymous classes
d645cf9: optimize icon
b393a47: IDEA-125825 Surround with quotes annotation parameter value intention
f5f2f31: IDEA-99541 New run configuration type to run Ant Return back ProcessHandler.waitFor() for standard task execution (not Run Configuration)
4112da6: IDEA-125872 (avoid resetting mod. stamp)
4b93641: fix html parsing (big thanks to cdr)
0b6b37c: notnull
4ffddd7: IDEA-125829 ClassInheritorSearch should find traits
2fe5331: fix compilation
9ddfbc8: IDEA-125730 Declare explicit type: broken template should revert all its changes and move the caret back to the original position.
8f5e205: IDEA-125759 correct assert check
59aef31: IDEA-125781 ReadAction in GroovyTraitFieldSearcher
d946471: IDEA-125730 correct item order in ChooseTypeExpression
9c99488: JS debugger in Chrome: support breakpoint conditions, better support for 'log evaluated expression', non-strict column number comparison
6b9f4a4: goto related localizations for properties files
3c06c05: fixed truncated object id
ee5bba7: ResourceBundleEditor: subeditors without virtual spaces (part of IDEA-85572)
9e358f4: CR-IC-5505 (cleanup)
69b649e: Offer to launch vagrant on skeletons generation in popup balloon.
82b7f75: Merge remote-tracking branch 'origin/master'
86ada28: Don't show modal dialog about vagrant start from packages list (PY-12838).
af40fe8: DataPointHolderConversionIntention not supports fields without initializer for conflicts escapings
0455ae8: NPE
02ca2bd: PsiBundle: fix typo in bundle name, cleanup
cc8d259: don't cache language level in JavaDirectoryService
60cbfb0: allow to create java classes named pkg.Class (IDEA-125442, CR-IC-5537)
b673277: ensure canonical module order in CE modules.xml
1388cfb: BaseElementAtCaretIntentionAction extends BaseElementAtCaretIntentionAction
a777074: IDEA-125558 new debugger: double result in evaluate expression - updated fix
add5377: reverted fix for IDEA-125558
5ad334b: AddJavadocIntention moved to "Declaration" category
b4f899b: notnull
dd53334: allow com.intellij.openapi.roots.impl.ModuleRootManagerImpl#getFileIndex to work in upsource
a28c2f4: register ExternalResourceManagerExImpl
9aa5346: EA-53941 - assert: FileManagerImpl.getCachedPsiFile
3b946e3: Merge remote-tracking branch 'origin/master'
62eeced: show notification if power save mode is on on startup (IDEA-125847)
d13982b: most specific: do not start java 8 algorithm for provided type args (IDEA-125855)
12a99d8: virtual array by selection rule (IDEA-125862)
610b0ba: IDEA-125820 DOM Generator: problem with XML element names matching default/generated imports
80199b4: DBE-19 0xDBE: edit description at Settings / Passwords
85c5cf1: Merge remote-tracking branch 'origin/master'
3efe19e: added help id for evaluate dialog
8456e04: IDEA-123787 "No live templates selected" label in multiple selection
9ce90b8: IDEA-124362 No scrollbar in Settings | Code Style | General
c04939b: auto expressions: don't compute for nested values
56917b3: make it by default and look at the performance
f30498b: Merge remote-tracking branch 'origin/master'
adae926: Don't ask to start Vagrant in a modal dialog on skeleton generation (PY-12838).
1315295: watches in tasks
57f4bbf: IDEA-125462 Unable to execute simple platform test with IDEA Ultimate Plugin SDK
9a56986: do not evaluate values twice
b7b995b: IDEA-54137 All alarms in RBE deleted. Save to file on focus change
c3b697a: IDEA-39879 Background color and gutter stripe color for bookmarks should be configurable
b893466: close editors only
08d3b73: NPE fixed
37cb86b6: fixed Color object icon renderer
a1ecb55: fixed switching multiple suspended threads in java
0c7e893: correctly load old enabled state of debugger expressions
6847fc3: IDEA-119364 (not introduces case statements for enum)
673d730: wrong shortcut suggested in goto test popup (IDEA-125857)
6a73a71: IDEA-108141 reused code of FixDocCommentAction
d03289c: IDEA-85274 Tasks: the detached editors are not affected by context change
a375d1e: java: correct stub for enums compiled by Groovy
c4edd41: aware of debugger communication error on break event
fd6ccfc: IDEA-125678 ConvertInterfaceToClassIntention.moveExtendsToImplements improved
0b0873d: IDEA-58422 implemented in IPP
ef6b09a: more possible reasons for non-physical file invalidation
745c9b0: IDEA-68916 "Zoom" for Mac OS
5372371: cleanup
c1810c1: cleanup
24cc395: Merge remote-tracking branch 'origin/master'
fd72f3e: javac 6 workaround (from IDEA-16723)
19af1ec: refactoring (following CR-IC-5531)
784512b: enum constants access inside enum constant initializers fixed (IDEA-125816)
b1b3b1d: accept intersection types in foreach stmts (IDEA-125800)
f1d927b: Mac: add app-title if project-title is empty
08f4caf: fix sorting
4559c7f: IDEA-123189 Project wizard: tree entries text cutoff
90bd11d: javadoc
6a6fa53: cleanup
b8be4e2: IDEA-125805 (language level increase quickfix for switch on enum/string)
75a492a: Cleanup (less repeated checks; less parameter pinballing)
b159632: testdata for IDEA-57388
656ce72: testdata for IDEA-67578
88a9ace: old inference: take only EQUALS bounds from sibling param (IDEA-119757)
dc3b3a9: try 'generate missed tests' without names check (IDEA-125818)
1dfcabe: javadoc fix
9b09325: moved to psi, register more services
f3cc359: register find usage providers
a0f8840: moved to psi
25fe38e: javadoc fix
6f7574c: dfa: invalid type diagnostics (IDEA-125179)
c9dff24: don't advertise Quick Definition when completion doesn't contain psi items (IDEA-87208)
43c06cfc: always use forward slashes in copy reference (IDEA-125292)
3dd0451: IDEA-125442 Strip .java from classname when creating new class
571196f: IDEA-125749 Create New Class Dialog - Pressing 'e' in Kind selects 'Interface' instead of 'Enum'
7a71a4d: External system: code cleanup
a635296: fix popup width jumping
9ea2438: IDEA-125609 - Built-in Git SSH executable ignores IDEA http proxy settings
f894389: IDEA-122962 - Clouds: perform connection test in background - auto-reload in CloudFoundry run configuration
494fbfe: renamed and more factories
309e1b1: provide empty quick fix factories for upsource
b78b8d0: initialize and register stub serializers
da59ab8: IDEA-125498 Search Everywhere: sometimes after navigation the list of search results reappears in the left corner of the screen
6549903: External System: IDEA-123031 Import sources and docs for module level libraries
b8d02c9: isValid
c59fbba: Reimplement parameter info test
50e11e6: fixed PY-13150 Pyramid run configuration fails when specifing '--reload' in additional option
320ecac: IDEA-39879 Background color and gutter stripe color for bookmarks should be configurable
ab780e0: WEB-12346 Watches pane: Adding/removing variable not possible when dragged out
4cdca43: Merge remote-tracking branch 'origin/master'
347094c: Merge remote-tracking branch 'origin/master'
b75e6ed: fixed tests
ae2b6c6: testdata fixed
37b352f: changelist preselection for file fixed and refactored
982e039: fix rendering issues
4dbfccf: registry ui improvements
16ce85a: notnull
4568663: IDEA-114011 Github: work with HTTP, not only with HTTPS
8cb550e: ExternalResourceManagerImpl inlined, moved to psi
ecff152: moved to core
2ff189c: removed "new in" which are not that new anymore
8787917: toString
6afd4f4: build initial foldings in background
9a121b2: EA-57104 - assert: PsiFileImpl.navigate
1080da4: IDEA-77640 Warn if the current subscription license will not work with the new version in the Update Info dialog
478fc87: test fixes and code unification
fda1430: update inspection and quickfix
287c944: OC-9609 [Java doc only] +review CR-OC-1561
71594cc: OC-9609 broken based on AST-tree folding at project opening +review CR-OC-1561
80ea2b9: better name for static method newOne -> of
b97e528: suppress contract validation for wrong Logger.assertTrue
5d8ee45: IDEA-112222 Validate @Contract annotation is related to the code
b09762d: cache properties files by bundle name and module
f25f58e: fix invalid PsiTreeUtil contract
97e0bde: remove unused VfsUtil.virtualToIFile
1f4d0df: notify BuildManager only if file events affect opened and watched projects (second part of IDEA-122685)
c503439: quickfix for IDEA-125710 (Wrong selection behavior in file history window)
5318e0e: fix assertion / comments / better transformation policy of array of changes / sorted ints into bit set
edeb5d2: testdata for IDEA-57290
b1b3964: testdata for IDEA-58692
af3e413: testdata for IDEA-24496
ae57176: provide 'place' language level for convertible check to allow types from old libraries to be casted to primitives (IDEA-117684)
2f6d5c9: testdata for IDEA-118362
f55b7ff: equality asymmetry fixed (IDEA-118533)
fdcb20b: type distinct prover asymmetry fixed (IDEA-118533)
6b5c924: suspicious collections call: process removeAll (IDEA-108755)
e9e9523: IDEA-125414 DB keys/indices to columns navigation
756b77b: accumulate index changes into array and convert it into bitset as needed
29f2788: track index info when encountering duplicated inputId
5803a5f: to Peter: addAll for emptySet doesn't work
61dbfe9: Merge remote-tracking branch 'origin/master'
95bc1fb: some more @MagicConstant
c3c31bd: EA-57052 - assert: MasterKeyPasswordSafe.decryptPassword
e761dd8: @NotNull'ed for EA-56831 - NPE: RemoteProcessSupport.release
9463bb3: Merge remote-tracking branch 'origin/master'
ff49bd1: use VirtualFile.nameSequence for isProjectOrWorkspaceFile check
248d752: restore classes merge with fix of foreach processing
fedbba7: Merge remote-tracking branch 'origin/master'
a494959: WeakReference objects used for vfile->document mapping should not stay in memory forever
8110e0b: less allocations in FileBasedIndexImpl.getUnsavedDocuments
180df2c: completion: don't suggest true/false literals where boolean is not expected
76939c8: restore query mismatch inspection
fffde12: new inference: mark erased for type params/raw types compatibility (IDEA-122932)
a2615d0: new inference: accept raw equality
67daae0: leave capture during bound composition of unbounded wildcards (IDEA-125423)
01c9bba: old inference: ignore java 1.6 bug in new versions (IDEA-125744)
b7ab465: old inference: choose child type between types in subtypes constraint (IDEA-118536)
d311a4e: perform target.findUsages() if no psi found
98302cc: IDEA-125186 Shorten reference with an import even if there is a conflicting class from Groovy default packages
d47756d: show initial value only for strings and primitive types
13986db: IDEA-125693 Creating a project in dir '~/Desktop/test' creates the project in the dir '/Applications/IntelliJ IDEA 13 CE.app/bin/test'
ae7d190: NPE when using from UML
530189b: a little bit smarter methods matching
8150b8b: IDEA-125566 Start From Scratch: can't close Customize IDEA dialog
ab7b2a0: IDEA-122962 - Clouds: perform connection test in background - auto-reload in frameworks
1a7ab39: restore (wrong) Logger.assertTrue contracts
c12b68d: dumb-aware error dropping actions
ac9d1e8: get java language level from the root model when pushers haven't finished yet
bd93483: IDEA-125565 Start from Scratch: Customize IDEA dialog: UI Themes page looks bad on Linux
6ea44e9: Gradle: use module library level for local dependencies, update library name to contain groupId
7d4dae9: IDEA-125565 Start from Scratch: Customize IDEA dialog: UI Themes page looks bad on Linux
fb173cc: IDEA-124461 New Module (Maven, Gradle) created in Empty project don't get the specified jdk
be064c3: cleanup
89dc105: show mark for a stack frame executing a method from marked object
f48b9fa: Merge remote-tracking branch 'origin/master'
c4dc543: IDEA-125745 Controls on breakpoints dialog resize differently
a105b5b: IDEA-125736 new debugger: disabled all exceptions breakpoint stops at every exception even in mute mode
5fd6a23: IDEA-124082 default changelist for Commit dialog fixed when 'commit directory' called
3a9e539: IDEA-124347 Master Password prompt strategy changed for mercurial authentication
74d52dd: introduce CvsFilePath to prevent public api changes
a489967: fix typo
f2c14b5: Start plugins wizard #30 for Mac OS X should be "native" keymap by default
a16bfe6: External-system: IDEA-124927 Don't refresh projects on opening when auto-import is disabled
78ee0a2: IDEA-125551 Start From Scratch: Customize IDEA dialog: JBoss plugin should not appear in JavaFrameworks group
e276bfa: unregistering obsolete service components
fbb0f39: jasper validation tests: fixes and cleanup
0d5f295: clean up: - replaced 2 usages isAssociated method from ValueContainer with getValueAssociationPredicate() delegation - rewrote serialization of input ids to be independent from concrete input id set implementation via usage of int iterator - inlined saveInvalidateCommand in ValueContainermpl and added comments
7321069: ad text in 'go to' actions
b57a8ca: get python language level from the root model when pushers haven't finished yet
a30a74e8: fix dfa contract believing that nullable is always null
9c29b95: fix dfa contract IOOBE with varargs
31be027: relax time in MessageBusTest.testPostingPerformanceWithLowListenerDensityInHierarchy
4955009: remove mostly non-useful Integer.valueOf completion suggestions
41b974e: anonym -> lambda: disable if target SAM type is raw and methods are called on params with Object erasure (IDEA-125613)
032faad: EIAE
2f4d4fb: register container provider
ba6e884: initialize file types
2f3db6a: UOE
73bfc96: NPE
3a8647f: reverted changes blocking inner classes in libraries to work
b66623a: do not fail position manager if assert happened in one of the providers
6dc93a1: skip binary files earlier, no need to get psi for that
91f7c25: do not scan all files when trigram index is available
7d81587: register extension points
4489140: -contributor
5fe5352: rw detector
707e584: IDEA-125649
6a28780: notnull
a7d14fe: IDEA-107588 (Mismatched query and update of collection - include Collections.addAll())
39d4dfb: fix 'as Trait' result type
b1e9f66: EA-57003 - NPE: WatchInplaceEditor.doOKAction
2d0aa2a: BlockMarkerCommentsInspection changes after review
98954e2: EA-57004 - NPE: XBreakpointManagerImpl.createBreakpointDefaults
3b09eea: fix compilation
40f7150: low priority 'create getters/setters' quickfixes
a34a01d: duplicated code
c6d539f: disable assert for Groovy clients
7459b0b: cleanup
f008f98: IDEA-125584 Groovy: NPE at org.jetbrains.plugins.groovy.annotator.intentions.CreateMethodFromUsageFix.invokeImpl
93d7ac9: IDEA-125576 Groovy: 'Create trait' could be added to 'Create From Usage'
6975411: get rid of 'public' keyword in templates
53fbe15: IDEA-125556 New Groovy class dialog contains trait option IDEA-125577 new icons for Groovy traits
90ec82d: more diagnostics for gdsl scripts
60c7d6f: EA-57072 - IOOBE: EditorImpl.offsetToLogicalLine
5801886: External-system: IDEA-124927 Don't refresh projects on opening when auto-import is disabled
2b0a1b9: One more condition for go to actions history
3ab65e6: (EA-55107) case with empty parents in history fixed
d67e9b4: IDEA-118279 create constructor params: apply cleanup
11d1e29: one test rewritten in Kotlin
9b3b90d: EA-56987 - NPE: DebuggerTreeNodeImpl.updateCaches
91005a8: added a separator above annotate action
32874b1: renamed to PropertiesPlugin.xml to avoid conflict inside upsource jar
05191a3: renamed to GroovyPlugin.xml to avoid conflict inside upsource jar
08caf4f: add to watches action should work from evaluate and inspect
d85d443: more moves to groovy-psi
fadd451: moved properties to properties-psi
b9fa2ab: register folding builder in env
ab8b582: moved to psi
c1da4f3: moved away from openapi
4bf725a: moved away from java-impl
41f2d2c: moved to core
5366e96: moved to psi
cf298fc: ensure editor is released in EDT
5b09e28: EA-57008 (pair was good enough)
1144d7b: extend java-class instead of groovy-class (to migrate to Kotlin)
3b85f7c: removing obsolete extension point
7ac28ba: remove outdated action id
53ddc21: Simplify condition in go to actions history
2807e38: rerun failed: include concrete class if containing is abstract (IDEA-125425)
9758f97: return inside finally: stop at lambda (IDEA-125605)
b90111f: more reliable keeping of reference on stack (following CR-IC-5487)
203d7fb: remove unused code
75c7630: cleanup
dc11403: cleanup
9d2b9ae: maven compiler tests to use external compiler only
ff05505: standalone jps updated: load path variables specified in gant scripts
05c2f31: history for go to actions, initial
0918150: combine two classes into one to reduce duplication
806c8d2: more accurate collection query detection for method references
19bf6b9: add "stream" and "parallelStream" query names
c0a470f: EA-57015 - SOE: AbstractTreeUi.access$
48a01b0: add common actions to all variable views
0529ff5: NPE if a previous focus owner is null.
d27fd1e: plugin updater: accept older plugin versions for broken plugins (IDEA-125646)
eeca5a8: search for package everywhere again (IDEA-125688)
04a7434: EA-56966 - IAE: XRegularValuePresentation.<init>
f1b4acc: Enabling dialog based implementation because of always on top regression.
5ef4a59: fixing java compilers configuration UI
7322427: EA-56894 - AIOOBE: AppCodeDesignerEditor.findModule - for AppCode designer module don't needed
05e2292: IDEA-125684 appearance of JTextField component in disabled state
4660916: IDEA-125500 Terminal is not locale aware
e3c14f5: following review CR-IC-5487
80a7f69: IDEA-25183
80eba2a: IDEA-42954 Watches are not saved on restart of debug sessions
d174c22: refactoring - following review #525
535844a: IDEA-104441 Wrong auto-completion of closed XML tags: handling unbalanced xml psi
220964b: BlockMarkerCommentInspection moved to java-analysis-impl
6c6a682: Shortcut Promoter initial
dff9280: IDEA-93040
622c1df: NPE
8f1d011: reverted
31d0a47: moved to analysis
a518606: moved to psi
e0d0ffd: moved to core
282862d: moved to core
1ccdeb0: more moved to psi
5d21da5: added equals to LocalsControlFlowPolicy, notnull
15ecfbd: deleting old make implementation
fa243c5: IdePlugin fixed
0427d8e: change default action
487d93d: remove useless source roots
b5fb0b6: IDEA-100200 - Clouds: deployment to clouds ignores the http proxy settings - CloudBees
cef9a6c: IDEA-71997
05b1763: deleting old make implementation
29b98db: deleting old make implementation
f723b07: Tips added (PY-12484).
de95451: Merge remote-tracking branch 'origin/master'
2d108ef: Tips updated (PY-12982).
cc4b248: java: parsing of complex bounds in stub signatures fixed
66d70ab: Cleanup (unneeded concatenation)
259d59a: added dependency from devkit module to its jps-plugin
cff9f70: JPS: added method to process modules and libraries in order
36e275f: Gradle: handling of project build classpath resolving errors related issues: http://youtrack.jetbrains.com/issue/IDEA-125592 http://youtrack.jetbrains.com/issue/IDEA-124839
6e512d0: [ review #701 ] introduce field where required to avoid multiple objects creation
98edcf4: Ruby highlighting lexer refactored for upsource core environment
bbb4d67: removed jsf-iml
c8b081a: DevKit: Goto EP declaration in plugin.xml (IDEA-86100) CR-IC-5473
c96948d: show initial value in "set value" editor
758adbb: make sure document reference is cached reliably
19cd6d5: show progress for editors opening
311406c: select only required editor in window
68aadaf: init foldings for all opened editors (otherwise saved folding state will not be restored for them)
c0511af: remove dead code
e5708cd: open editors in EDT
ffcd49d: IDEA-41226 Reference debugger-marked objects in expressions
0034f61: Merge remote-tracking branch 'origin/master'
a7e0137: externalization: suppress unused to .xml compatibility
0f8912f: enforce string copying (trim substring() result for java 6)
152503a: new exception creation without args: completely ignore exceptions with only no param constructor (IDEA-125660)
d64d714: customizations: check group is included in correct root group; allow to invoke moved action group, e.g. Create Run Configurations group (IDEA-125484)
aaa01e4: fix module leaks via CompilerTester
1551266: Added output folders to ModuleExtendedModel.
9874668: IDEA-104441 Wrong auto-completion of closed XML tags
b71fe91: simplification & cleanup postfix templates
9835800: Maven: plexus-archiver lib added to licenses
a7aa0df: lambda: extract parameters incompatibility check
0fac1ec: Merge remote-tracking branch 'origin/master'
5eeea43: PY-13084 Variables passed to url kwargs are not suggested to template
8a3ad93: hide lang-api refactoring actions if no handlers present
86d0ff8: Merge branch 'fix4' of https://github.com/krasa/intellij-community into fix4
6b46fcf: dfa: contracts validation should not exclude notnull validation
0212832: Better comments
463a90c: force check for update on exception from non-bundled plugin
4e95814: nullify: to run on pooled thread without progress
90b27a4: IDEA-122929 Hg: remove unrelated urls paths from pull/push dialog.
e2e243b: CompositeFilter#forceUseAllFilters=false by default to restore previous behaviour Deprecated public fields in Filter#Result and getters to give warning about possible danger
aa83182: Merge branch 'python-fixes'
a9aaf0c: Maven: fix artifact layouts tests for added generated manifest.mf
a1d93e0: Use union of types of members as iteration type for tuples
06a130f: Interpret tuple default parameter value as a weak type (PY-10967)
24b18f8: IDEA-119804 second click on item in watches panel should toggle edit mode
a479d46: IDEA-81789 Expression Evaluation goes crazy when multiline expression is inserted
3f1d913: Merge remote-tracking branch 'origin/master'
1b010d0: PY-12981 django apps don't resolve when INSTALLED_APPS is set with '+='
846b42a: Nullity annotations and explicit TypeEvalContext for PyUnionType.excludeNull()
5352177: IDEA-97915 Mercurial incoming/outgoing widgets updated
e618345: EA-51820 check that root from mappings is a valid vcs root
2f5f8f9: IDEA-122562 - Warning from SettingsEditor#applyEditorTo prevents runconfig editor from closing
12272ec: cosmetic: "Remember on disk" -> "Save on disk" in all places
ef5ae1c: ensure rename is performed inside project only, do not search for a package inside libraries!
0dd4ead: generate missed tests intention (IDEA-90247; IDEA-122790)
8ee7f6d: ignore setup/teardown generation when methods already exist and additional methods are not expected
dc043ce: IDEA-121972 - Map help button of the Clouds page
71f507b: Cleanup
2322568: Don't suggest Python live templates inside parameter list (PY-12395)
9b96bc0: common style for expressions
f9685fd: Don't suggest Python live templates in string literals (PY-12349)
a554bba: Don't suggest Python live templates in comments (PY-13076)
511b7db: IDEA-125624 Run tool window does not have deployments list in debug mode
73dce39: Use 'Python' context for 'super' live template (PY-13080)
8e0bbd5: cover with tests
ce036b5: IDEA-125129 I would like to reopen IDEA-117698: regression fixed
2475299: IDEA-61480 DocBook5: complains about xlink:href in <link>
2fd7151: IDEA-125557 Start From Scratch: on Darcula selecting as UI Theme in the Customize IDEA wisard it is applied incorrectly
fa9f7fe: Fixed messy usage of colons in the Breakpoints window
6b7841e: format
f3c2fa2: IDEA-117949 Xml editor doesn't treat xml namespace correctly
08c14cb: Cleanup (optimization)
298bf22: Cleanup (formatting)
c026ff3: java: missing deprecated attribute on inner classes fixed
301b5e7: java: injected methods excluded from enum stub
06f261c: Maven: artifact's manifest generation support related issues: http://youtrack.jetbrains.com/issue/IDEA-82725 http://youtrack.jetbrains.com/issue/IDEA-91497 http://youtrack.jetbrains.com/issue/IDEA-47990
1913bdc: IDEA-119640 Problem with goto declaration of XML attribute defined in XSD: re-fixed, completion fixed
ee89d4f: cleanup
560924a: Merge remote-tracking branch 'origin/master'
80dbfb5: byte code viewer in same colors as editor
7fea4ff: fix failing tests: OverrideImplementTest.testEnumConstant ImplementMethodsTest.runSingle(EnumConstantWithoutClassInitializer.java)
590e025: add example to postfix templates tree
9457946: cleanup
9307a77: better colors for ctrl + shift + a
Change-Id: I63f543234051b4bfd5588e9307dad56cdff7aa1b
diff --git a/python/helpers/pycharm/pycharm_load_entry_point.py b/python/helpers/pycharm/pycharm_load_entry_point.py
index f03286c..ecf4f90 100644
--- a/python/helpers/pycharm/pycharm_load_entry_point.py
+++ b/python/helpers/pycharm/pycharm_load_entry_point.py
@@ -1,9 +1,9 @@
-import sys
+import os, sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
- name = sys.argv.pop()
- dist = sys.argv.pop()
+ dist = os.environ.get("PYCHARM_EP_DIST")
+ name = os.environ.get("PYCHARM_EP_NAME")
sys.exit(
load_entry_point(dist, "console_scripts", name)()
)
diff --git a/python/helpers/pydev/pydevconsole.py b/python/helpers/pydev/pydevconsole.py
index 7edf089..6c0640f 100644
--- a/python/helpers/pydev/pydevconsole.py
+++ b/python/helpers/pydev/pydevconsole.py
@@ -368,6 +368,45 @@
self.skip = 1
sys.stderr.write(data)
+ def showsyntaxerror(self, filename=None):
+ """Display the syntax error that just occurred."""
+ #Override for avoid using sys.excepthook PY-12600
+ type, value, tb = sys.exc_info()
+ sys.last_type = type
+ sys.last_value = value
+ sys.last_traceback = tb
+ if filename and type is SyntaxError:
+ # Work hard to stuff the correct filename in the exception
+ try:
+ msg, (dummy_filename, lineno, offset, line) = value.args
+ except ValueError:
+ # Not the format we expect; leave it alone
+ pass
+ else:
+ # Stuff in the right filename
+ value = SyntaxError(msg, (filename, lineno, offset, line))
+ sys.last_value = value
+ list = traceback.format_exception_only(type, value)
+ sys.stderr.write(''.join(list))
+
+ def showtraceback(self):
+ """Display the exception that just occurred."""
+ #Override for avoid using sys.excepthook PY-12600
+ try:
+ type, value, tb = sys.exc_info()
+ sys.last_type = type
+ sys.last_value = value
+ sys.last_traceback = tb
+ tblist = traceback.extract_tb(tb)
+ del tblist[:1]
+ lines = traceback.format_list(tblist)
+ if lines:
+ lines.insert(0, "Traceback (most recent call last):\n")
+ lines.extend(traceback.format_exception_only(type, value))
+ finally:
+ tblist = tb = None
+ sys.stderr.write(''.join(lines))
+
def consoleExec(thread_id, frame_id, expression):
"""returns 'False' in case expression is partialy correct
"""
diff --git a/python/main_pycharm_ce.iml b/python/main_pycharm_ce.iml
index 67303ad..8a72b6d 100644
--- a/python/main_pycharm_ce.iml
+++ b/python/main_pycharm_ce.iml
@@ -18,6 +18,7 @@
<orderEntry type="module" module-name="python-ide-community" />
<orderEntry type="module" module-name="platform-main" />
<orderEntry type="module" module-name="jira" />
+ <orderEntry type="module" module-name="ShortcutPromoter" />
</component>
</module>
diff --git a/python/openapi/src/com/jetbrains/python/packaging/PyExternalProcessException.java b/python/openapi/src/com/jetbrains/python/packaging/PyExternalProcessException.java
index 40d1f31..06e2337 100644
--- a/python/openapi/src/com/jetbrains/python/packaging/PyExternalProcessException.java
+++ b/python/openapi/src/com/jetbrains/python/packaging/PyExternalProcessException.java
@@ -16,6 +16,7 @@
package com.jetbrains.python.packaging;
import com.intellij.execution.ExecutionException;
+import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
@@ -34,6 +35,8 @@
@NotNull private List<String> myArgs;
@NotNull private String myMessage;
+ private Pair<String, Runnable> myHandler = null;
+
public PyExternalProcessException(int retcode, @NotNull String name, @NotNull List<String> args, @NotNull String message) {
super(String.format("External process error '%s %s':\n%s", name, StringUtil.join(args, " "), message));
myRetcode = retcode;
@@ -92,4 +95,18 @@
}
return StringUtil.join(result, "");
}
+
+ public PyExternalProcessException withHandler(@NotNull String name, @NotNull Runnable handler) {
+ myHandler = Pair.create(name, handler);
+ return this;
+ }
+
+
+ public boolean hasHandler() {
+ return myHandler != null;
+ }
+
+ public Pair<String, Runnable> getHandler() {
+ return myHandler;
+ }
}
diff --git a/python/pluginTestSrc/com/jetbrains/jython/PyJythonHighlightingTest.java b/python/pluginTestSrc/com/jetbrains/jython/PyJythonHighlightingTest.java
index 40330be..4ddef37 100644
--- a/python/pluginTestSrc/com/jetbrains/jython/PyJythonHighlightingTest.java
+++ b/python/pluginTestSrc/com/jetbrains/jython/PyJythonHighlightingTest.java
@@ -18,7 +18,7 @@
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.jetbrains.python.PythonTestUtil;
import com.jetbrains.python.inspections.PyCallingNonCallableInspection;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
/**
* @author yole
diff --git a/python/psi-api/src/com/jetbrains/python/PythonFQDNNames.java b/python/psi-api/src/com/jetbrains/python/PythonFQDNNames.java
new file mode 100644
index 0000000..364a6ad
--- /dev/null
+++ b/python/psi-api/src/com/jetbrains/python/PythonFQDNNames.java
@@ -0,0 +1,36 @@
+package com.jetbrains.python;
+
+import com.jetbrains.python.nameResolver.FQNamesProvider;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Python (not django) names
+ * @author Ilya.Kazakevich
+ */
+public class PythonFQDNNames implements FQNamesProvider {
+
+ /**
+ * dict()
+ */
+ public static final PythonFQDNNames DICT_CLASS = new PythonFQDNNames(true, "dict"); // TODO: Add other dict-like types
+
+ private final boolean myIsClass;
+ @NotNull
+ private final String[] myNames;
+
+ private PythonFQDNNames(final boolean isClass, @NotNull final String... names) {
+ myIsClass = isClass;
+ myNames = names;
+ }
+
+ @NotNull
+ @Override
+ public String[] getNames() {
+ return myNames.clone();
+ }
+
+ @Override
+ public boolean isClass() {
+ return myIsClass;
+ }
+}
diff --git a/python/psi-api/src/com/jetbrains/python/nameResolver/NameResolverTools.java b/python/psi-api/src/com/jetbrains/python/nameResolver/NameResolverTools.java
index e8d8f51..7fad933 100644
--- a/python/psi-api/src/com/jetbrains/python/nameResolver/NameResolverTools.java
+++ b/python/psi-api/src/com/jetbrains/python/nameResolver/NameResolverTools.java
@@ -1,14 +1,16 @@
package com.jetbrains.python.nameResolver;
+import com.intellij.openapi.util.Condition;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
-import com.jetbrains.python.psi.PyClass;
-import com.jetbrains.python.psi.PyElement;
-import com.jetbrains.python.psi.PyFunction;
-import com.jetbrains.python.psi.PyQualifiedNameOwner;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.jetbrains.python.psi.*;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
/**
* @author Ilya.Kazakevich
@@ -75,4 +77,38 @@
return false;
}
+ /**
+ * Looks for parent call of certain function
+ * @param anchor element to look parent for
+ * @param functionName function to find
+ * @return parent call or null if not found
+ */
+ @Nullable
+ public static PyCallExpression findCallExpParent(@NotNull final PsiElement anchor, @NotNull final FQNamesProvider functionName) {
+ final PsiElement parent = PsiTreeUtil.findFirstParent(anchor, new MyFunctionCondition(functionName));
+ if (parent instanceof PyCallExpression) {
+ return (PyCallExpression)parent;
+ }
+ return null;
+ }
+
+ /**
+ * Looks for call of some function
+ */
+ private static class MyFunctionCondition implements Condition<PsiElement> {
+ @NotNull
+ private final FQNamesProvider myNameToSearch;
+
+ MyFunctionCondition(@NotNull final FQNamesProvider name) {
+ myNameToSearch = name;
+ }
+
+ @Override
+ public boolean value(final PsiElement element) {
+ if (element instanceof PyCallExpression) {
+ return ((PyCallExpression)element).isCallee(myNameToSearch);
+ }
+ return false;
+ }
+ }
}
diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyImportedNameDefiner.java b/python/psi-api/src/com/jetbrains/python/psi/PyImportedNameDefiner.java
index 6d5626a..8758b85 100644
--- a/python/psi-api/src/com/jetbrains/python/psi/PyImportedNameDefiner.java
+++ b/python/psi-api/src/com/jetbrains/python/psi/PyImportedNameDefiner.java
@@ -20,5 +20,5 @@
*
* @author vlan
*/
-public interface PyImportedNameDefiner extends NameDefiner {
+public interface PyImportedNameDefiner extends NameDefiner, PyElement {
}
diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyStarImportElement.java b/python/psi-api/src/com/jetbrains/python/psi/PyStarImportElement.java
index 0fda47c..fc69a0f 100644
--- a/python/psi-api/src/com/jetbrains/python/psi/PyStarImportElement.java
+++ b/python/psi-api/src/com/jetbrains/python/psi/PyStarImportElement.java
@@ -20,5 +20,5 @@
* User: dcheryasov
* Date: Jul 28, 2008
*/
-public interface PyStarImportElement extends PyElement, PyImportedNameDefiner {
+public interface PyStarImportElement extends PyImportedNameDefiner {
}
diff --git a/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java b/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java
index ee0d0e5..21b9e44 100644
--- a/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java
+++ b/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java
@@ -165,11 +165,12 @@
script_params.addParameter(p);
}
}
- cmd.addParameters("Sphinx", "sphinx-quickstart");
cmd.setPassParentEnvironment(true);
setPythonIOEncoding(cmd.getEnvironment(), "utf-8");
setPythonUnbuffered(cmd.getEnvironment());
+ cmd.getEnvironment().put("PYCHARM_EP_DIST", "Sphinx");
+ cmd.getEnvironment().put("PYCHARM_EP_NAME", "sphinx-quickstart");
List<String> pathList = Lists.newArrayList(PythonCommandLineState.getAddedPaths(sdk));
pathList.addAll(PythonCommandLineState.collectPythonPath(module));
diff --git a/python/resources/liveTemplates/Python.xml b/python/resources/liveTemplates/Python.xml
index 96689b1..47928f8 100644
--- a/python/resources/liveTemplates/Python.xml
+++ b/python/resources/liveTemplates/Python.xml
@@ -4,8 +4,21 @@
<variable name="method" expression="pyFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="end" expression="" defaultValue="" alwaysStopAt="true" />
<context>
+ <option name="HTML_TEXT" value="false" />
+ <option name="HTML" value="false" />
+ <option name="XSL_TEXT" value="false" />
+ <option name="XML" value="false" />
+ <option name="Python" value="true" />
+ <option name="Django" value="false" />
+ <option name="CSS_PROPERTY_VALUE" value="false" />
+ <option name="CSS_DECLARATION_BLOCK" value="false" />
+ <option name="CSS_RULESET_LIST" value="false" />
+ <option name="CSS" value="false" />
+ <option name="JAVA_SCRIPT" value="false" />
<option name="TypeScript" value="false" />
+ <option name="SQL" value="false" />
<option name="CoffeeScript" value="false" />
+ <option name="OTHER" value="false" />
</context>
</template>
<template name="main" value="if __name__ == '__main__': $END$" description="if __name__ == '__main__'" toReformat="false" toShortenFQNames="true">
diff --git a/python/resources/tips/Interpreter.html b/python/resources/tips/Interpreter.html
index 3bc9c18..4f4c58f 100644
--- a/python/resources/tips/Interpreter.html
+++ b/python/resources/tips/Interpreter.html
@@ -6,7 +6,7 @@
<p>PyCharm allows configuring Python interpreters on the various stages of development: </p>
<ul>
<li>When a project is only being created (<span class="control">File | New Project</span>, or <span class="control">Create New Project</span> on the Welcome screen).</li>
-<li>In an already existing project (<span class="control">File | Settings - Python Interpreters</span>).</li>
+<li>In an already existing project (<span class="control">File | Settings - Project Interpreter</span>).</li>
</ul>
</body>
</html>
diff --git a/python/resources/tips/LiveTemplatesRestore.html b/python/resources/tips/LiveTemplatesRestore.html
new file mode 100755
index 0000000..dd09059
--- /dev/null
+++ b/python/resources/tips/LiveTemplatesRestore.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+<p>If you've changed a live template, it becomes blue. If you want to return to the
+original text, right-click such a blue template, and choose
+<span class="control">Restore defaults</span> on the context menu.
+</p>
+</body>
+</html>
diff --git a/python/resources/tips/Multicursor.html b/python/resources/tips/Multicursor.html
new file mode 100755
index 0000000..251d849
--- /dev/null
+++ b/python/resources/tips/Multicursor.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>In <span class="product">&productName;</span>, you can have multiple cursors.
+Having pressed <span class="shortcut">Alt</span>, click the left mouse button
+at the desired position to set additional cursors in the editor.</p>
+<p>Press <span class="shortcut">&shortcut:EditorEscape;</span> to remove all the additional cursors
+but one that resides at the line at caret.</p>
+<p class="image"><img src="images/multicursor.png"></p>
+
+
+</body>
+</html>
diff --git a/python/resources/tips/Multicursor1.html b/python/resources/tips/Multicursor1.html
new file mode 100755
index 0000000..21bf62f
--- /dev/null
+++ b/python/resources/tips/Multicursor1.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>Clone the cursor strictly upwards or downwards. To do that,
+press <span class="shortcut">&shortcut:GotoAction;</span> twice, type
+<span class="control">Clone caret</span>, and then choose the desired action.</p>
+<p class="image"><img src="images/multicursor1.png"></p>
+</body>
+</html>
diff --git a/python/resources/tips/QuickDocInSuggestionList.html b/python/resources/tips/QuickDocInSuggestionList.html
new file mode 100755
index 0000000..94d0e5a
--- /dev/null
+++ b/python/resources/tips/QuickDocInSuggestionList.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p>When choosing a live template from a suggestion list, press
+<span class="shortcut">&shortcut:QuickJavaDoc;</span> to view quick documentation -
+to be sure you make a right choice:</p>
+<p class="image"><img src="images/qdoc_live_template.png"></p>
+
+</body>
+</html>
diff --git a/python/resources/tips/QuickDocOnMouseMove.html b/python/resources/tips/QuickDocOnMouseMove.html
new file mode 100755
index 0000000..9499aea
--- /dev/null
+++ b/python/resources/tips/QuickDocOnMouseMove.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+<p>You don't need to invoke quick documentation explicitly
+(<span class="shortcut">&shortcut:QuickJavaDoc;</span>) - if you just move your mouse
+pointer over the desired symbol, the quick documentation pop-up window will show
+automatically.</p>
+<p>To enable this feature, select the check box <span class="control">Show quick doc on mouse move</span>
+in the editor settings.
+</p>
+</body>
+</html>
diff --git a/python/resources/tips/RemoteInterpreter.html b/python/resources/tips/RemoteInterpreter.html
index 83cdbe2..9373493 100644
--- a/python/resources/tips/RemoteInterpreter.html
+++ b/python/resources/tips/RemoteInterpreter.html
@@ -5,16 +5,9 @@
<body>
<p>Found yourself in a situation, when you want to use an interpreter located remotely? With
PyCharm it is quite easy.</p>
-
- <p>To configure a remote interpreter, press <span class="shortcut">&shortcut:ShowSettings;</span>, and
- under the <span class="control">Project Settings</span>. open the page <span class="control">Python Interpreters</span>.</p>
-<p>Then press <span class="shortcut">&shortcut:NewElement;</span>, and choose the option <span class="control">Remote</span>:</p>
-<p class="image"><img src="images/add_remote_interpreter.png" alt="add_remote_interpreter"/></p>
-
+<p>To configure a remote interpreter, press <span class="shortcut">&shortcut:ShowSettings;</span>, and
+under the <span class="control">Project Settings</span>. open the page <span class="control">Project Interpreter</span>.</p>
+<p>Then click the geat button, and choose the option <span class="control">Add Remote</span>:</p>
<p>You can use this remote interpreter for your project, or just leave it as one of the available interpreters.</p>
</body>
</html>
-<html>
-<head></head>
-<body></body>
-</html>
\ No newline at end of file
diff --git a/python/resources/tips/TerminalOpen.html b/python/resources/tips/TerminalOpen.html
new file mode 100755
index 0000000..bb96cee
--- /dev/null
+++ b/python/resources/tips/TerminalOpen.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+
+
+ <p><span class="product">&productName;</span> makes it possible to
+launch the embedded local terminal using keyboard only. Press
+<span class="shortcut">&shortcut:ActivateTerminalToolWindow;</span>,
+and see the terminal running.
+</p>
+</body>
+</html>
diff --git a/python/resources/tips/images/multicursor1@2x.png b/python/resources/tips/images/multicursor1@2x.png
new file mode 100755
index 0000000..2920846
--- /dev/null
+++ b/python/resources/tips/images/multicursor1@2x.png
Binary files differ
diff --git a/python/resources/tips/images/multicursor1@2x_dark.png b/python/resources/tips/images/multicursor1@2x_dark.png
new file mode 100755
index 0000000..04dbef3
--- /dev/null
+++ b/python/resources/tips/images/multicursor1@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/multicursor@2x.png b/python/resources/tips/images/multicursor@2x.png
new file mode 100755
index 0000000..d771d0a
--- /dev/null
+++ b/python/resources/tips/images/multicursor@2x.png
Binary files differ
diff --git a/python/resources/tips/images/multicursor@2x_dark.png b/python/resources/tips/images/multicursor@2x_dark.png
new file mode 100755
index 0000000..dd93320
--- /dev/null
+++ b/python/resources/tips/images/multicursor@2x_dark.png
Binary files differ
diff --git a/python/resources/tips/images/qdoc_live_template@2x-3.png b/python/resources/tips/images/qdoc_live_template@2x-3.png
new file mode 100755
index 0000000..ae79e7e
--- /dev/null
+++ b/python/resources/tips/images/qdoc_live_template@2x-3.png
Binary files differ
diff --git a/python/resources/tips/images/qdoc_live_template@2x_dark-3.png b/python/resources/tips/images/qdoc_live_template@2x_dark-3.png
new file mode 100755
index 0000000..6b077c6
--- /dev/null
+++ b/python/resources/tips/images/qdoc_live_template@2x_dark-3.png
Binary files differ
diff --git a/python/src/META-INF/IdeTipsAndTricks.xml b/python/src/META-INF/IdeTipsAndTricks.xml
index 7237331..e920175 100644
--- a/python/src/META-INF/IdeTipsAndTricks.xml
+++ b/python/src/META-INF/IdeTipsAndTricks.xml
@@ -108,5 +108,11 @@
<tipAndTrick file="CheckRegExp.html"/>
<tipAndTrick file="CtrlDotInLookups.html"/>
<tipAndTrick file="HorizontalScrolling.html"/>
+ <tipAndTrick file="LiveTemplatesRestore.html"/>
+ <tipAndTrick file="Multicursor.html"/>
+ <tipAndTrick file="Multicursor1.html"/>
+ <tipAndTrick file="QuickDocInSuggestionList.html"/>
+ <tipAndTrick file="QuickDocOnMouseMove.html"/>
+ <tipAndTrick file="TerminalOpen.html"/>
</extensions>
</idea-plugin>
\ No newline at end of file
diff --git a/python/src/META-INF/python-core.xml b/python/src/META-INF/python-core.xml
index dd93341..411fa6c 100644
--- a/python/src/META-INF/python-core.xml
+++ b/python/src/META-INF/python-core.xml
@@ -270,7 +270,7 @@
<localInspection language="Python" shortName="PyArgumentListInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.call.arguments" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyArgumentListInspection"/>
<localInspection language="Python" shortName="PyRedeclarationInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.redeclaration" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRedeclarationInspection"/>
- <localInspection language="Python" shortName="PyUnresolvedReferencesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unresolved.refs" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnresolvedReferencesInspection"/>
+ <localInspection language="Python" shortName="PyUnresolvedReferencesInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unresolved.refs" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection"/>
<localInspection language="Python" shortName="PyInterpreterInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.invalid.interpreter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyInterpreterInspection"/>
<localInspection language="Python" shortName="PyMethodParametersInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.problematic.first.parameter" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMethodParametersInspection"/>
<localInspection language="Python" shortName="PyUnreachableCodeInspection" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unreachable.code" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnreachableCodeInspection"/>
@@ -532,6 +532,7 @@
<extensionPoints>
<extensionPoint qualifiedName="Pythonid.importResolver" interface="com.jetbrains.python.psi.impl.PyImportResolver"/>
<extensionPoint qualifiedName="Pythonid.magicLiteral" interface="com.jetbrains.python.magicLiteral.PyMagicLiteralExtensionPoint"/>
+ <extensionPoint qualifiedName="Pythonid.unresolvedReferenceSkipper" interface="com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferenceSkipperExtPoint"/>
<extensionPoint qualifiedName="Pythonid.resolveResultRater" interface="com.jetbrains.python.psi.impl.PyResolveResultRater"/>
<extensionPoint qualifiedName="Pythonid.typeProvider" interface="com.jetbrains.python.psi.impl.PyTypeProvider"/>
<extensionPoint qualifiedName="Pythonid.pySuperMethodsSearch" interface="com.intellij.util.QueryExecutor"/>
diff --git a/python/src/com/jetbrains/python/codeInsight/imports/PyImportOptimizer.java b/python/src/com/jetbrains/python/codeInsight/imports/PyImportOptimizer.java
index 0ebcaca..5d24e3b 100644
--- a/python/src/com/jetbrains/python/codeInsight/imports/PyImportOptimizer.java
+++ b/python/src/com/jetbrains/python/codeInsight/imports/PyImportOptimizer.java
@@ -21,7 +21,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileSystemItem;
import com.jetbrains.python.formatter.PyBlock;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/python/src/com/jetbrains/python/codeInsight/liveTemplates/PythonTemplateContextType.java b/python/src/com/jetbrains/python/codeInsight/liveTemplates/PythonTemplateContextType.java
index 4ae7abe..1032cbd 100644
--- a/python/src/com/jetbrains/python/codeInsight/liveTemplates/PythonTemplateContextType.java
+++ b/python/src/com/jetbrains/python/codeInsight/liveTemplates/PythonTemplateContextType.java
@@ -17,11 +17,15 @@
import com.intellij.codeInsight.template.FileTypeBasedContextType;
import com.intellij.patterns.PsiElementPattern;
+import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.ProcessingContext;
import com.jetbrains.python.PyTokenTypes;
import com.jetbrains.python.PythonFileType;
+import com.jetbrains.python.psi.PyParameterList;
+import com.jetbrains.python.psi.PyStringLiteralExpression;
import org.jetbrains.annotations.NotNull;
import static com.intellij.patterns.PlatformPatterns.psiElement;
@@ -39,16 +43,20 @@
if (super.isInContext(file, offset)) {
final PsiElement element = file.findElementAt(offset);
if (element != null) {
- return !isAfterDot(element);
+ return !(isAfterDot(element) || element instanceof PsiComment || element instanceof PyStringLiteralExpression ||
+ isInsideParameterList(element));
}
}
return false;
}
+ private static boolean isInsideParameterList(@NotNull PsiElement element) {
+ return PsiTreeUtil.getParentOfType(element, PyParameterList.class) != null;
+ }
+
private static boolean isAfterDot(@NotNull PsiElement element) {
- ProcessingContext context = new ProcessingContext();
final PsiElementPattern.Capture<PsiElement> capture = psiElement().afterLeafSkipping(psiElement().whitespace(),
psiElement().withElementType(PyTokenTypes.DOT));
- return capture.accepts(element, context);
+ return capture.accepts(element, new ProcessingContext());
}
}
diff --git a/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java b/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java
index 6934a37..5df0a37 100644
--- a/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java
+++ b/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java
@@ -195,7 +195,7 @@
}
else if (type instanceof PyUnionType && allowUnions) {
if (type instanceof PyDynamicallyEvaluatedType || PyTypeChecker.isUnknown(type)) {
- result = new UnknownType(build(((PyUnionType)type).excludeNull(), true));
+ result = new UnknownType(build(((PyUnionType)type).excludeNull(myContext), true));
}
else {
result = new OneOf(
diff --git a/python/src/com/jetbrains/python/documentation/doctest/PyDocstringVisitorFilter.java b/python/src/com/jetbrains/python/documentation/doctest/PyDocstringVisitorFilter.java
index 4ea4f88..e79d52c 100644
--- a/python/src/com/jetbrains/python/documentation/doctest/PyDocstringVisitorFilter.java
+++ b/python/src/com/jetbrains/python/documentation/doctest/PyDocstringVisitorFilter.java
@@ -18,6 +18,7 @@
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.psi.PsiFile;
import com.jetbrains.python.inspections.*;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.PyFile;
import com.jetbrains.python.validation.DocStringAnnotator;
import com.jetbrains.python.validation.HighlightingAnnotator;
diff --git a/python/src/com/jetbrains/python/formatter/PyPreFormatProcessor.java b/python/src/com/jetbrains/python/formatter/PyPreFormatProcessor.java
index ee56016..af07fe8 100644
--- a/python/src/com/jetbrains/python/formatter/PyPreFormatProcessor.java
+++ b/python/src/com/jetbrains/python/formatter/PyPreFormatProcessor.java
@@ -84,6 +84,9 @@
String text = element.getText();
int commentStart = text.indexOf('#');
if (commentStart != -1 && (commentStart + 1) < text.length()) {
+ if (text.charAt(commentStart+1) == '!') {
+ return; //shebang
+ }
String commentText = StringUtil.trimLeading(text.substring(commentStart + 1));
String newText = "# " + commentText;
diff --git a/python/src/com/jetbrains/python/inspections/quickfix/AddIgnoredIdentifierQuickFix.java b/python/src/com/jetbrains/python/inspections/quickfix/AddIgnoredIdentifierQuickFix.java
index 23e0b2e..22c1a26 100644
--- a/python/src/com/jetbrains/python/inspections/quickfix/AddIgnoredIdentifierQuickFix.java
+++ b/python/src/com/jetbrains/python/inspections/quickfix/AddIgnoredIdentifierQuickFix.java
@@ -21,7 +21,7 @@
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.psi.PsiElement;
import com.intellij.util.Consumer;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.intellij.psi.util.QualifiedName;
import org.jetbrains.annotations.NotNull;
diff --git a/python/src/com/jetbrains/python/inspections/quickfix/PyMakeFunctionFromMethodQuickFix.java b/python/src/com/jetbrains/python/inspections/quickfix/PyMakeFunctionFromMethodQuickFix.java
index e578bdd..4c5a714 100644
--- a/python/src/com/jetbrains/python/inspections/quickfix/PyMakeFunctionFromMethodQuickFix.java
+++ b/python/src/com/jetbrains/python/inspections/quickfix/PyMakeFunctionFromMethodQuickFix.java
@@ -28,7 +28,7 @@
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.PyNames;
import com.jetbrains.python.codeInsight.imports.AddImportHelper;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.refactoring.PyRefactoringUtil;
import org.jetbrains.annotations.NonNls;
diff --git a/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferenceSkipperExtPoint.java b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferenceSkipperExtPoint.java
new file mode 100644
index 0000000..d64d9a9
--- /dev/null
+++ b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferenceSkipperExtPoint.java
@@ -0,0 +1,25 @@
+package com.jetbrains.python.inspections.unresolvedReference;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.jetbrains.python.psi.PyImportedNameDefiner;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Inject this point to ask "unused reference" inspection to skip some unused references.
+ * For example in Django you may import "I18N" to your "settings.py". It is not used in "settings.py", but used by Django
+ * and should not be marked as "unused".
+ *
+ * @author Ilya.Kazakevich
+ */
+public interface PyUnresolvedReferenceSkipperExtPoint {
+ @NotNull
+ ExtensionPointName<PyUnresolvedReferenceSkipperExtPoint> EP_NAME = ExtensionPointName.create("Pythonid.unresolvedReferenceSkipper");
+
+ /**
+ * Checks if some unused import should be skipped
+ *
+ * @param importNameDefiner unused import
+ * @return true if should be skipped
+ */
+ boolean unusedImportShouldBeSkipped(@NotNull PyImportedNameDefiner importNameDefiner);
+}
diff --git a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
similarity index 95%
rename from python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java
rename to python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
index d416f1b..fbe2680 100644
--- a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java
+++ b/python/src/com/jetbrains/python/inspections/unresolvedReference/PyUnresolvedReferencesInspection.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jetbrains.python.inspections;
+package com.jetbrains.python.inspections.unresolvedReference;
import com.google.common.collect.ImmutableSet;
import com.intellij.codeInspection.*;
@@ -45,6 +45,7 @@
import com.jetbrains.python.console.PydevConsoleRunner;
import com.jetbrains.python.documentation.DocStringParameterReference;
import com.jetbrains.python.documentation.DocStringTypeReference;
+import com.jetbrains.python.inspections.*;
import com.jetbrains.python.inspections.quickfix.*;
import com.jetbrains.python.packaging.PyPIPackageUtil;
import com.jetbrains.python.packaging.PyPackageManager;
@@ -68,6 +69,7 @@
import javax.swing.*;
import java.util.*;
+import java.util.HashSet;
import static com.jetbrains.python.inspections.quickfix.AddIgnoredIdentifierQuickFix.END_WILDCARD;
@@ -78,7 +80,8 @@
*/
public class PyUnresolvedReferencesInspection extends PyInspection {
private static Key<Visitor> KEY = Key.create("PyUnresolvedReferencesInspection.Visitor");
- public static final Key<PyUnresolvedReferencesInspection> SHORT_NAME_KEY = Key.create(PyUnresolvedReferencesInspection.class.getSimpleName());
+ public static final Key<PyUnresolvedReferencesInspection> SHORT_NAME_KEY =
+ Key.create(PyUnresolvedReferencesInspection.class.getSimpleName());
public JDOMExternalizableStringList ignoredIdentifiers = new JDOMExternalizableStringList();
@@ -125,7 +128,7 @@
public static class Visitor extends PyInspectionVisitor {
private Set<PsiElement> myUsedImports = Collections.synchronizedSet(new HashSet<PsiElement>());
- private Set<NameDefiner> myAllImports = Collections.synchronizedSet(new HashSet<NameDefiner>());
+ private Set<PyImportedNameDefiner> myAllImports = Collections.synchronizedSet(new HashSet<PyImportedNameDefiner>());
private final ImmutableSet<String> myIgnoredIdentifiers;
private volatile Boolean myIsEnabled = null;
@@ -285,10 +288,10 @@
private void processInjection(@Nullable PsiLanguageInjectionHost node) {
if (node == null) return;
- final List<Pair<PsiElement,TextRange>>
+ final List<Pair<PsiElement, TextRange>>
files = InjectedLanguageManager.getInstance(node.getProject()).getInjectedPsiFiles(node);
if (files != null) {
- for (Pair<PsiElement,TextRange> pair : files) {
+ for (Pair<PsiElement, TextRange> pair : files) {
new PyRecursiveElementVisitor() {
@Override
public void visitPyElement(PyElement element) {
@@ -478,7 +481,7 @@
addAddSelfFix(node, expr, actions);
PyCallExpression callExpression = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
if (callExpression != null && (!(callExpression.getCallee() instanceof PyQualifiedExpression) ||
- ((PyQualifiedExpression)callExpression.getCallee()).getQualifier() == null)) {
+ ((PyQualifiedExpression)callExpression.getCallee()).getQualifier() == null)) {
actions.add(new UnresolvedRefCreateFunctionQuickFix(callExpression, expr));
}
PyFunction parentFunction = PsiTreeUtil.getParentOfType(element, PyFunction.class);
@@ -780,8 +783,9 @@
if (decoratorList != null) {
for (PyDecorator decorator : decoratorList.getDecorators()) {
final PyExpression callee = decorator.getCallee();
- if (callee != null && PyNames.CLASSMETHOD.equals(callee.getText()))
+ if (callee != null && PyNames.CLASSMETHOD.equals(callee.getText())) {
isClassMethod = true;
+ }
}
}
for (PyTargetExpression target : containedClass.getInstanceAttributes()) {
@@ -926,8 +930,20 @@
}
List<PsiElement> result = new ArrayList<PsiElement>();
- Set<NameDefiner> unusedImports = new HashSet<NameDefiner>(myAllImports);
+ Set<PyImportedNameDefiner> unusedImports = new HashSet<PyImportedNameDefiner>(myAllImports);
unusedImports.removeAll(myUsedImports);
+
+ // Remove those unsed, that are reported to be skipped by extension points
+ final Set<PyImportedNameDefiner> unusedImportToSkip = new HashSet<PyImportedNameDefiner>();
+ for (final PyImportedNameDefiner unusedImport : unusedImports) {
+ if (importShouldBeSkippedByExtPoint(unusedImport)) { // Pass to extension points
+ unusedImportToSkip.add(unusedImport);
+ }
+ }
+
+ unusedImports.removeAll(unusedImportToSkip);
+
+
Set<String> usedImportNames = new HashSet<String>();
for (PsiElement usedImport : myUsedImports) {
if (usedImport instanceof NameDefiner) {
@@ -942,7 +958,8 @@
QualifiedName packageQName = null;
List<String> dunderAll = null;
- for (NameDefiner unusedImport : unusedImports) {
+ // TODO: Use strategies instead of pack of "continue"
+ for (PyImportedNameDefiner unusedImport : unusedImports) {
if (packageQName == null) {
final PsiFile file = unusedImport.getContainingFile();
if (file instanceof PyFile) {
@@ -1014,7 +1031,7 @@
return result;
}
- private static boolean areAllImportsUnused(PyImportStatementBase importStatement, Set<NameDefiner> unusedImports) {
+ private static boolean areAllImportsUnused(PyImportStatementBase importStatement, Set<PyImportedNameDefiner> unusedImports) {
final PyImportElement[] elements = importStatement.getImportElements();
for (PyImportElement element : elements) {
if (!unusedImports.contains(element)) {
@@ -1034,4 +1051,17 @@
}
}
+ /**
+ * Checks if one or more extension points ask unused import to be skipped
+ * @param importNameDefiner unused import
+ * @return true of one or more asks
+ */
+ private static boolean importShouldBeSkippedByExtPoint(@NotNull final PyImportedNameDefiner importNameDefiner) {
+ for (final PyUnresolvedReferenceSkipperExtPoint skipper : PyUnresolvedReferenceSkipperExtPoint.EP_NAME.getExtensions()) {
+ if (skipper.unusedImportShouldBeSkipped(importNameDefiner)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/python/src/com/jetbrains/python/inspections/unresolvedReference/package-info.java b/python/src/com/jetbrains/python/inspections/unresolvedReference/package-info.java
new file mode 100644
index 0000000..512a8ca
--- /dev/null
+++ b/python/src/com/jetbrains/python/inspections/unresolvedReference/package-info.java
@@ -0,0 +1,7 @@
+/**
+ *
+ * Inspection that reports unresolved and unused references.
+ * You can inject logic to mark some unused imports as used. See extension points in this package.
+ * @author Ilya.Kazakevich
+ */
+package com.jetbrains.python.inspections.unresolvedReference;
\ No newline at end of file
diff --git a/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java b/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
index 0b65e70..4a4f016 100644
--- a/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
+++ b/python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
@@ -52,6 +52,7 @@
import com.intellij.remote.RemoteFile;
import com.intellij.remote.RemoteSdkAdditionalData;
import com.intellij.remote.RemoteSdkCredentials;
+import com.intellij.remote.VagrantNotStartedException;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.intellij.util.PathMappingSettings;
@@ -98,6 +99,9 @@
public static final int ERROR_EXECUTION = -6;
public static final int ERROR_INTERRUPTED = -7;
+ public static final int ERROR_VAGRANT_NOT_LAUNCHED = 101;
+ public static final int ERROR_REMOTE_ACCESS = 102;
+
public static final String PACKAGE_PIP = "pip";
public static final String PACKAGE_DISTRIBUTE = "distribute";
public static final String PACKAGE_SETUPTOOLS = "setuptools";
@@ -121,6 +125,7 @@
public static final String SETUPTOOLS = PACKAGE_SETUPTOOLS + "-" + SETUPTOOLS_VERSION;
public static final String PIP = PACKAGE_PIP + "-" + PIP_VERSION;
+ private static final String LAUNCH_VAGRANT = "launchVagrant";
private List<PyPackage> myPackagesCache = null;
private Map<String, Set<PyPackage>> myDependenciesCache = null;
@@ -790,12 +795,37 @@
if (sdkData instanceof PyRemoteSdkAdditionalDataBase) { //remote interpreter
RemoteSdkCredentials remoteSdkCredentials;
try {
- remoteSdkCredentials = ((RemoteSdkAdditionalData)sdkData).getRemoteSdkCredentials();
+ remoteSdkCredentials = ((RemoteSdkAdditionalData)sdkData).getRemoteSdkCredentials(false);
}
catch (InterruptedException e) {
LOG.error(e);
remoteSdkCredentials = null;
}
+ catch (final ExecutionException e) {
+ if (e.getCause() instanceof VagrantNotStartedException) {
+ throw new PyExternalProcessException(ERROR_VAGRANT_NOT_LAUNCHED, helperPath, args, "Vagrant instance is down. <a href=\"" +
+ LAUNCH_VAGRANT +
+ "\">Launch vagrant</a>").withHandler(LAUNCH_VAGRANT, new Runnable() {
+ @Override
+ public void run() {
+ final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
+ if (manager != null) {
+
+ try {
+ manager.runVagrant(((VagrantNotStartedException)e.getCause()).getVagrantFolder());
+ clearCaches();
+
+ }
+ catch (ExecutionException e1) {
+ throw new RuntimeException(e1);
+ }
+ }
+ }
+ });
+ } else {
+ throw new PyExternalProcessException(ERROR_REMOTE_ACCESS, helperPath, args, e.getMessage());
+ }
+ }
final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
if (manager != null && remoteSdkCredentials != null) {
final List<String> cmdline = new ArrayList<String>();
diff --git a/python/src/com/jetbrains/python/packaging/ui/PyInstalledPackagesPanel.java b/python/src/com/jetbrains/python/packaging/ui/PyInstalledPackagesPanel.java
index 0fdbc53..e0c0e30 100644
--- a/python/src/com/jetbrains/python/packaging/ui/PyInstalledPackagesPanel.java
+++ b/python/src/com/jetbrains/python/packaging/ui/PyInstalledPackagesPanel.java
@@ -125,7 +125,22 @@
}
final boolean hasPackagingTools = myHasPip && myHasSetuptools;
allowCreateVirtualEnv &= !hasPackagingTools;
+
+ if (externalProcessException.hasHandler()) {
+ final String key = externalProcessException.getHandler().first;
+ myNotificationArea.addLinkHandler(key,
+ new Runnable() {
+ @Override
+ public void run() {
+ externalProcessException.getHandler().second.run();
+ myNotificationArea.removeLinkHandler(key);
+ updateNotifications(selectedSdk);
+ }
+ }
+ );
+ }
}
+
if (text == null) {
if (!myHasSetuptools) {
text = "Python package management tools not found. <a href=\"" + INSTALL_SETUPTOOLS + "\">Install 'setuptools'</a>";
@@ -186,7 +201,7 @@
protected boolean canUninstallPackage(InstalledPackage pkg) {
if (!myHasPip) return false;
if (PythonSdkType.isVirtualEnv(getSelectedSdk()) && pkg instanceof PyPackage) {
- final String location = ((PyPackage) pkg).getLocation();
+ final String location = ((PyPackage)pkg).getLocation();
if (location != null && location.startsWith(PyPackageManagerImpl.getUserSite())) {
return false;
}
diff --git a/python/src/com/jetbrains/python/psi/PyUtil.java b/python/src/com/jetbrains/python/psi/PyUtil.java
index 1700a49..877da8d 100644
--- a/python/src/com/jetbrains/python/psi/PyUtil.java
+++ b/python/src/com/jetbrains/python/psi/PyUtil.java
@@ -67,6 +67,7 @@
import com.jetbrains.python.magicLiteral.PyMagicLiteralTools;
import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.psi.impl.PyPsiUtils;
+import com.jetbrains.python.psi.impl.PythonLanguageLevelPusher;
import com.jetbrains.python.psi.types.*;
import com.jetbrains.python.refactoring.classes.PyDependenciesComparator;
import com.jetbrains.python.refactoring.classes.extractSuperclass.PyExtractSuperclassHelper;
@@ -775,7 +776,8 @@
// Most of the cases should be handled by this one, PyLanguageLevelPusher pushes folders only
final VirtualFile folder = virtualFile.getParent();
if (folder != null) {
- final LanguageLevel level = folder.getUserData(LanguageLevel.KEY);
+ LanguageLevel level = folder.getUserData(LanguageLevel.KEY);
+ if (level == null) level = PythonLanguageLevelPusher.getFileLanguageLevel(project, virtualFile);
if (level != null) return level;
}
else {
@@ -1521,7 +1523,7 @@
public static List<PyParameter> getParameters(@NotNull Callable callable, @NotNull TypeEvalContext context) {
PyType type = context.getType(callable);
if (type instanceof PyUnionType) {
- type = ((PyUnionType)type).excludeNull();
+ type = ((PyUnionType)type).excludeNull(context);
}
if (type instanceof PyCallableType) {
final PyCallableType callableType = (PyCallableType)type;
diff --git a/python/src/com/jetbrains/python/psi/impl/PyBlockEvaluator.java b/python/src/com/jetbrains/python/psi/impl/PyBlockEvaluator.java
index f23ed3a..36e67a1 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyBlockEvaluator.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyBlockEvaluator.java
@@ -17,6 +17,7 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.QualifiedName;
import com.jetbrains.python.PyNames;
import com.jetbrains.python.psi.*;
import org.jetbrains.annotations.NotNull;
@@ -148,19 +149,21 @@
myDeclarations.putAll(importEvaluator.myDeclarations);
}
else {
- for (PyImportElement element : node.getImportElements()) {
- Object value = importEvaluator.myNamespace.get(element.getName());
- String name = element.getAsName();
- if (name == null) {
- name = element.getName();
+ for (final PyImportElement element : node.getImportElements()) {
+ final String nameOfVarInOurModule = element.getVisibleName();
+ final QualifiedName nameOfVarInExternalModule = element.getImportedQName();
+ if ((nameOfVarInOurModule == null) || (nameOfVarInExternalModule == null)) {
+ continue;
}
- myNamespace.put(name, value);
- List<PyExpression> declarations = importEvaluator.getDeclarations(name);
- if (myDeclarations.containsKey(name)) {
- myDeclarations.get(name).addAll(declarations);
+
+ final Object value = importEvaluator.myNamespace.get(nameOfVarInExternalModule.toString());
+ myNamespace.put(nameOfVarInOurModule, value);
+ final List<PyExpression> declarations = importEvaluator.getDeclarations(nameOfVarInOurModule);
+ if (myDeclarations.containsKey(nameOfVarInOurModule)) {
+ myDeclarations.get(nameOfVarInOurModule).addAll(declarations);
}
else {
- myDeclarations.put(name, declarations);
+ myDeclarations.put(nameOfVarInOurModule, declarations);
}
}
}
diff --git a/python/src/com/jetbrains/python/psi/impl/PyEvaluator.java b/python/src/com/jetbrains/python/psi/impl/PyEvaluator.java
index d4300be..dea9296 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyEvaluator.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyEvaluator.java
@@ -16,21 +16,27 @@
package com.jetbrains.python.psi.impl;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.python.PyNames;
import com.jetbrains.python.PyTokenTypes;
+import com.jetbrains.python.PythonFQDNNames;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.resolve.PyResolveContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.*;
/**
* TODO: Merge PythonDataflowUtil, {@link com.jetbrains.python.psi.impl.PyConstantExpressionEvaluator} and {@link com.jetbrains.python.psi.impl.PyEvaluator} and all its inheritors and improve Abstract Interpretation
+ *
* @author yole
*/
public class PyEvaluator {
private Set<PyExpression> myVisited = new HashSet<PyExpression>();
private Map<String, Object> myNamespace;
private boolean myEvaluateCollectionItems = true;
+ private boolean myEvaluateKeys = true;
public void setNamespace(Map<String, Object> namespace) {
myNamespace = namespace;
@@ -40,7 +46,15 @@
myEvaluateCollectionItems = evaluateCollectionItems;
}
- public Object evaluate(PyExpression expr) {
+ /**
+ * @param evaluateKeys evaluate keys for dicts or not (i.e. you wanna see string or StringLiteralExpressions as keys)
+ */
+ public void setEvaluateKeys(final boolean evaluateKeys) {
+ myEvaluateKeys = evaluateKeys;
+ }
+
+ @Nullable
+ public Object evaluate(@Nullable PyExpression expr) {
if (expr == null || myVisited.contains(expr)) {
return null;
}
@@ -76,6 +90,7 @@
/**
* Evaluates some sequence (tuple, list)
+ *
* @param expr seq expression
* @return evaluated seq
*/
@@ -83,12 +98,8 @@
PyExpression[] elements = expr.getElements();
if (expr instanceof PyDictLiteralExpression) {
Map<Object, Object> result = new HashMap<Object, Object>();
- for (PyKeyValueExpression keyValueExpression : ((PyDictLiteralExpression)expr).getElements()) {
- Object dictKey = evaluate(keyValueExpression.getKey());
- if (dictKey != null) {
- PyExpression value = keyValueExpression.getValue();
- result.put(dictKey, myEvaluateCollectionItems ? evaluate(value) : value);
- }
+ for (final PyKeyValueExpression keyValueExpression : ((PyDictLiteralExpression)expr).getElements()) {
+ addRecordFromDict(result, keyValueExpression.getKey(), keyValueExpression.getValue());
}
return result;
}
@@ -130,6 +141,7 @@
return null;
}
+ @Nullable
protected Object evaluateCall(PyCallExpression call) {
final PyExpression[] args = call.getArguments();
if (call.isCalleeText(PyNames.REPLACE) && args.length == 2) {
@@ -145,6 +157,54 @@
}
}
}
+
+ // Support dict([("k": "v")]) syntax
+ if (call.isCallee(PythonFQDNNames.DICT_CLASS)) {
+ final Collection<PyTupleExpression> tuples = PsiTreeUtil.findChildrenOfType(call, PyTupleExpression.class);
+ if (!tuples.isEmpty()) {
+ final Map<Object, Object> result = new HashMap<Object, Object>();
+ for (final PyTupleExpression tuple : tuples) {
+ final PsiElement[] tupleElements = tuple.getChildren();
+ if (tupleElements.length != 2) {
+ return null;
+ }
+ final PyExpression key = PyUtil.as(tupleElements[0], PyExpression.class);
+ final PyExpression value = PyUtil.as(tupleElements[1], PyExpression.class);
+ if ((key != null)) {
+ addRecordFromDict(result, key, value);
+ }
+ }
+ return result;
+ }
+ }
+
+
return null;
}
+
+ /**
+ * Adds record for map when working with dict
+ *
+ * @param result map to return to user
+ * @param key dict key
+ * @param value dict value
+ */
+ private void addRecordFromDict(@NotNull final Map<Object, Object> result,
+ @NotNull final PyExpression key,
+ @Nullable final PyExpression value) {
+ result.put(myEvaluateKeys ? evaluate(key) : key, myEvaluateCollectionItems ? evaluate(value) : value);
+ }
+
+ /**
+ * Shortcut that evaluates expression with default params and casts it to particular type (if possible)
+ *
+ * @param expression exp to evaluate
+ * @param resultType expected type
+ * @param <T> expected type
+ * @return value if expression is evaluated to this type, null otherwise
+ */
+ @Nullable
+ public static <T> T evaluate(@Nullable final PyExpression expression, @NotNull final Class<T> resultType) {
+ return PyUtil.as(new PyEvaluator().evaluate(expression), resultType);
+ }
}
diff --git a/python/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java b/python/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java
index 70e3ecf..de8b517 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java
@@ -83,6 +83,7 @@
return element != null ? element.getName() : null;
}
+ @Override
@Nullable
public String getVisibleName() {
final PyImportElementStub stub = getStub();
diff --git a/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java b/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
index f38937d..bf792fe 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
@@ -239,7 +239,7 @@
final PyType type = context.getType(defaultValue);
if (type != null && !(type instanceof PyNoneType)) {
if (type instanceof PyTupleType) {
- return PyTypeParser.getTypeByName(this, "collections.Iterable");
+ return PyUnionType.createWeakType(type);
}
return type;
}
diff --git a/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java
index 060c39c..545e8e8 100644
--- a/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java
+++ b/python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java
@@ -208,7 +208,7 @@
final PyAssignmentStatement assignment = (PyAssignmentStatement)nextParent;
final PyExpression value = assignment.getAssignedValue();
if (value != null) {
- final PyType assignedType = context.getType(value);
+ final PyType assignedType = PyTypeChecker.toNonWeakType(context.getType(value), context);
if (assignedType instanceof PyTupleType) {
final PyType t = getTypeFromTupleAssignment((PyTupleExpression)parent, (PyTupleType)assignedType);
if (t != null) {
@@ -386,6 +386,14 @@
}
}
}
+ else if (iterableType instanceof PyTupleType) {
+ final PyTupleType tupleType = (PyTupleType)iterableType;
+ final List<PyType> memberTypes = new ArrayList<PyType>();
+ for (int i = 0; i < tupleType.getElementCount(); i++) {
+ memberTypes.add(tupleType.getElementType(i));
+ }
+ return PyUnionType.union(memberTypes);
+ }
else if (iterableType instanceof PyUnionType) {
final Collection<PyType> members = ((PyUnionType)iterableType).getMembers();
final List<PyType> iterationTypes = new ArrayList<PyType>();
diff --git a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
index 132e657..c3fd23b 100644
--- a/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
+++ b/python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
@@ -20,7 +20,7 @@
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
-import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.*;
@@ -85,14 +85,19 @@
}
public LanguageLevel getImmediateValue(@NotNull Project project, @Nullable VirtualFile file) {
+ return getFileLanguageLevel(project, file);
+ }
+
+ public static LanguageLevel getFileLanguageLevel(Project project, VirtualFile file) {
if (ApplicationManager.getApplication().isUnitTestMode() && LanguageLevel.FORCE_LANGUAGE_LEVEL != null) {
return LanguageLevel.FORCE_LANGUAGE_LEVEL;
}
if (file == null) return null;
- final Module module = ModuleUtil.findModuleForFile(file, project);
+ final Module module = ModuleUtilCore.findModuleForFile(file, project);
if (module != null) {
- return getImmediateValue(module);
+ final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
+ return PythonSdkType.getLanguageLevelForSdk(sdk);
}
final Sdk sdk = findSdk(project, file);
if (sdk != null) {
diff --git a/python/src/com/jetbrains/python/psi/types/PyDynamicallyEvaluatedType.java b/python/src/com/jetbrains/python/psi/types/PyDynamicallyEvaluatedType.java
index 1743947..85624b1 100644
--- a/python/src/com/jetbrains/python/psi/types/PyDynamicallyEvaluatedType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyDynamicallyEvaluatedType.java
@@ -49,7 +49,7 @@
@Override
public String getName() {
- PyType res = excludeNull();
+ PyType res = excludeNull(TypeEvalContext.codeInsightFallback());
return res != null ? res.getName() : PyNames.UNKNOWN_TYPE;
}
}
diff --git a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java
index cbdeb16..f4a5236 100644
--- a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java
+++ b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java
@@ -215,6 +215,17 @@
return false;
}
+ @Nullable
+ public static PyType toNonWeakType(@Nullable PyType type, @NotNull TypeEvalContext context) {
+ if (type instanceof PyUnionType) {
+ final PyUnionType unionType = (PyUnionType)type;
+ if (unionType.isWeak()) {
+ return unionType.excludeNull(context);
+ }
+ }
+ return type;
+ }
+
public static boolean hasGenerics(@Nullable PyType type, @NotNull TypeEvalContext context) {
final Set<PyGenericType> collected = new HashSet<PyGenericType>();
collectGenerics(type, context, collected, new HashSet<PyType>());
diff --git a/python/src/com/jetbrains/python/psi/types/PyUnionType.java b/python/src/com/jetbrains/python/psi/types/PyUnionType.java
index 8572b72..d94eb75 100644
--- a/python/src/com/jetbrains/python/psi/types/PyUnionType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyUnionType.java
@@ -184,7 +184,7 @@
* @return union with excluded types
*/
@Nullable
- public PyType exclude(PyType type, TypeEvalContext context) {
+ public PyType exclude(@Nullable PyType type, @NotNull TypeEvalContext context) {
final List<PyType> members = new ArrayList<PyType>();
for (PyType m : getMembers()) {
if (type == null) {
@@ -202,8 +202,8 @@
}
@Nullable
- public PyType excludeNull() {
- return exclude(null, null);
+ public PyType excludeNull(@NotNull TypeEvalContext context) {
+ return exclude(null, context);
}
private static PyType unit(@Nullable PyType type) {
diff --git a/python/src/com/jetbrains/python/refactoring/introduce/IntroduceHandler.java b/python/src/com/jetbrains/python/refactoring/introduce/IntroduceHandler.java
index 618cf00..29fc441 100644
--- a/python/src/com/jetbrains/python/refactoring/introduce/IntroduceHandler.java
+++ b/python/src/com/jetbrains/python/refactoring/introduce/IntroduceHandler.java
@@ -283,7 +283,8 @@
}
element1 = PyRefactoringUtil.getSelectedExpression(project, file, element1, element2);
- if (element1 == null) {
+ final PyComprehensionElement comprehension = PsiTreeUtil.getParentOfType(element1, PyComprehensionElement.class, true);
+ if (element1 == null || comprehension != null) {
showCannotPerformError(project, editor);
return;
}
@@ -401,10 +402,6 @@
if (decorator != null && PsiTreeUtil.isAncestor(decorator.getCallee(), element, false)) {
return false;
}
- final PyComprehensionElement comprehension = PsiTreeUtil.getParentOfType(element, PyComprehensionElement.class, true);
- if (comprehension != null) {
- return false;
- }
return PsiTreeUtil.getParentOfType(element, PyParameterList.class) == null;
}
@@ -413,6 +410,10 @@
if (call != null && PsiTreeUtil.isAncestor(call.getCallee(), element, false)) {
return false;
}
+ final PyComprehensionElement comprehension = PsiTreeUtil.getParentOfType(element, PyComprehensionElement.class, true);
+ if (comprehension != null) {
+ return false;
+ }
return true;
}
diff --git a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
index a7a96a0..b904b55 100644
--- a/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
+++ b/python/src/com/jetbrains/python/remote/PythonRemoteInterpreterManager.java
@@ -91,7 +91,7 @@
public abstract PySkeletonGenerator createRemoteSkeletonGenerator(@Nullable Project project,
@Nullable Component ownerComponent,
@NotNull Sdk sdk,
- String path);
+ String path) throws ExecutionException;
public abstract boolean ensureCanWrite(@Nullable Object projectOrComponent, RemoteSdkCredentials data, String path);
@@ -170,6 +170,10 @@
@Nullable
public abstract RemoteCredentials getVagrantRemoteCredentials(VagrantBasedCredentialsHolder data) throws IOException;
+ public abstract boolean checkVagrantStatus(String vagrantFolder, boolean runIfDown);
+
+ public abstract void runVagrant(String vagrantFolder) throws ExecutionException;
+
public abstract void checkVagrantStatus(VagrantBasedCredentialsHolder data);
public abstract RemoteCredentials getCredentialsBySftpServerId(String id);
diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
index d3301da..a51d8e2 100644
--- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java
+++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java
@@ -15,12 +15,17 @@
*/
package com.jetbrains.python.sdk;
+import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.process.ProcessOutput;
import com.intellij.facet.Facet;
import com.intellij.facet.FacetConfiguration;
import com.intellij.facet.FacetManager;
import com.intellij.ide.DataManager;
+import com.intellij.notification.Notification;
+import com.intellij.notification.NotificationListener;
+import com.intellij.notification.NotificationType;
+import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
@@ -53,6 +58,7 @@
import com.intellij.reference.SoftReference;
import com.intellij.remote.RemoteSdkCredentials;
import com.intellij.remote.RemoteSdkCredentialsHolder;
+import com.intellij.remote.VagrantNotStartedException;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Consumer;
import com.intellij.util.NullableConsumer;
@@ -76,6 +82,7 @@
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.io.File;
import java.io.FilenameFilter;
@@ -551,7 +558,15 @@
}
catch (InvalidSdkException e) {
// If the SDK is invalid, the user should worry about the SDK itself, not about skeletons generation errors
- if (!isInvalid(sdk)) {
+ if (isRemote(sdk)) {
+ notifyRemoteSdkSkeletonsFail(e, new Runnable() {
+ @Override
+ public void run() {
+ setupSdkPaths(project, ownerComponent, sdk, sdkModificator);
+ }
+ });
+ }
+ else if (!isInvalid(sdk)) {
LOG.error(e);
}
}
@@ -563,6 +578,42 @@
return sdkPathsUpdated;
}
+ public static void notifyRemoteSdkSkeletonsFail(final InvalidSdkException e, @Nullable final Runnable restartAction) {
+ NotificationListener notificationListener;
+
+ if (e.getCause() instanceof VagrantNotStartedException) {
+ notificationListener =
+ new NotificationListener() {
+ @Override
+ public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
+ final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
+ if (manager != null) {
+ try {
+ manager.runVagrant(((VagrantNotStartedException)e.getCause()).getVagrantFolder());
+ }
+ catch (ExecutionException e1) {
+ throw new RuntimeException(e1);
+ }
+ }
+ if (restartAction != null) {
+ restartAction.run();
+ }
+ }
+ };
+ }
+ else {
+ notificationListener = null;
+ }
+
+ Notifications.Bus.notify(
+ new Notification(
+ SKELETONS_TOPIC, "Couldn't refresh skeletons for remote interpreter", e.getMessage() + "\n<a href=\"#\">Launch vagrant and refresh skeletons</a>",
+ NotificationType.WARNING,
+ notificationListener
+ )
+ );
+ }
+
/**
* In which root type built-in skeletons are put.
*/
@@ -595,7 +646,8 @@
addSdkRoot(sdkModificator, path);
}
}
- } else {
+ }
+ else {
addRemoteLibrariesRoot(sdkModificator, sdkHome);
}
diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java
index a964fa9..f583ebb 100644
--- a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java
+++ b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java
@@ -113,7 +113,15 @@
updateSdk(project, sdk);
}
catch (InvalidSdkException e) {
- if (!PythonSdkType.isInvalid(sdk)) {
+ if (PythonSdkType.isRemote(sdk)) {
+ PythonSdkType.notifyRemoteSdkSkeletonsFail(e, new Runnable() {
+ @Override
+ public void run() {
+ updateActiveSdks(project, delay);
+ }
+ });
+ }
+ else if (!PythonSdkType.isInvalid(sdk)) {
LOG.error(e);
}
}
diff --git a/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java b/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
index 07c8e1c..ec255b5 100644
--- a/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
+++ b/python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
@@ -181,11 +181,11 @@
}
@Nullable
- protected static String getVersionFromOutput(String sdkHome, String version_opt, String version_regexp) {
- String run_dir = new File(sdkHome).getParent();
- final ProcessOutput process_output = PySdkUtil.getProcessOutput(run_dir, new String[]{sdkHome, version_opt});
+ protected static String getVersionFromOutput(String sdkHome, String versionOpt, String versionRegexp) {
+ String runDirectory = new File(sdkHome).getParent();
+ final ProcessOutput processOutput = PySdkUtil.getProcessOutput(runDirectory, new String[]{sdkHome, versionOpt}, 10000);
- return getVersionFromOutput(version_regexp, process_output);
+ return getVersionFromOutput(versionRegexp, processOutput);
}
@Nullable
diff --git a/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java b/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java
index 28d8e51..13202d7 100644
--- a/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java
+++ b/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java
@@ -18,6 +18,7 @@
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
+import com.intellij.execution.ExecutionException;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationListener;
import com.intellij.notification.NotificationType;
@@ -198,7 +199,12 @@
mySkeletonsPath = skeletonsPath;
final PythonRemoteInterpreterManager remoteInterpreterManager = PythonRemoteInterpreterManager.getInstance();
if (PySdkUtil.isRemote(sdk) && remoteInterpreterManager != null) {
- mySkeletonsGenerator = remoteInterpreterManager.createRemoteSkeletonGenerator(myProject, ownerComponent, sdk, getSkeletonsPath());
+ try {
+ mySkeletonsGenerator = remoteInterpreterManager.createRemoteSkeletonGenerator(myProject, ownerComponent, sdk, getSkeletonsPath());
+ }
+ catch (ExecutionException e) {
+ throw new InvalidSdkException(e.getMessage(), e.getCause());
+ }
}
else {
mySkeletonsGenerator = new PySkeletonGenerator(getSkeletonsPath(), mySdk, folder);
diff --git a/python/testData/blockEvaluator/external_module.py b/python/testData/blockEvaluator/external_module.py
new file mode 100644
index 0000000..9371c18
--- /dev/null
+++ b/python/testData/blockEvaluator/external_module.py
@@ -0,0 +1,4 @@
+SOME_VARIABLE = "42"
+SOME_LIST = ['a', 'b']
+
+
diff --git a/python/testData/blockEvaluator/my_module.py b/python/testData/blockEvaluator/my_module.py
new file mode 100644
index 0000000..b726b47
--- /dev/null
+++ b/python/testData/blockEvaluator/my_module.py
@@ -0,0 +1,9 @@
+__author__ = 'Ilya.Kazakevich'
+from external_module import SOME_VARIABLE, SOME_LIST
+from some_package import VARIABLE_IN_PACKAGE
+from some_package.module_in_package import *
+from some_package.another_module_in_package import VARIABLE_IN_PACKAGE_MODULE_2 as MY_RENAMED_VAR
+
+
+SOME_LIST += ['c', 'd']
+
diff --git a/python/testData/blockEvaluator/some_package/__init__.py b/python/testData/blockEvaluator/some_package/__init__.py
new file mode 100644
index 0000000..7acfca7
--- /dev/null
+++ b/python/testData/blockEvaluator/some_package/__init__.py
@@ -0,0 +1,2 @@
+__author__ = 'Ilya.Kazakevich'
+VARIABLE_IN_PACKAGE = "foo"
\ No newline at end of file
diff --git a/python/testData/blockEvaluator/some_package/another_module_in_package.py b/python/testData/blockEvaluator/some_package/another_module_in_package.py
new file mode 100644
index 0000000..a8ef7c9
--- /dev/null
+++ b/python/testData/blockEvaluator/some_package/another_module_in_package.py
@@ -0,0 +1,2 @@
+__author__ = 'Ilya.Kazakevich'
+VARIABLE_IN_PACKAGE_MODULE_2 = "foo"
diff --git a/python/testData/blockEvaluator/some_package/module_in_package.py b/python/testData/blockEvaluator/some_package/module_in_package.py
new file mode 100644
index 0000000..1ed3bcb
--- /dev/null
+++ b/python/testData/blockEvaluator/some_package/module_in_package.py
@@ -0,0 +1,2 @@
+__author__ = 'Ilya.Kazakevich'
+VARIABLE_IN_PACKAGE_MODULE = "foo"
diff --git a/python/testData/formatter/shebang.py b/python/testData/formatter/shebang.py
new file mode 100644
index 0000000..44f7725
--- /dev/null
+++ b/python/testData/formatter/shebang.py
@@ -0,0 +1 @@
+#!/usr/bin/python3
\ No newline at end of file
diff --git a/python/testData/formatter/shebang_after.py b/python/testData/formatter/shebang_after.py
new file mode 100644
index 0000000..44f7725
--- /dev/null
+++ b/python/testData/formatter/shebang_after.py
@@ -0,0 +1 @@
+#!/usr/bin/python3
\ No newline at end of file
diff --git a/python/testSrc/com/jetbrains/python/PyBlockEvaluatorTest.java b/python/testSrc/com/jetbrains/python/PyBlockEvaluatorTest.java
index 3fd0a0a..368c055 100644
--- a/python/testSrc/com/jetbrains/python/PyBlockEvaluatorTest.java
+++ b/python/testSrc/com/jetbrains/python/PyBlockEvaluatorTest.java
@@ -20,7 +20,9 @@
import com.jetbrains.python.psi.PyFile;
import com.jetbrains.python.psi.PyFunction;
import com.jetbrains.python.psi.PyStringLiteralExpression;
+import com.jetbrains.python.psi.PyUtil;
import com.jetbrains.python.psi.impl.PyBlockEvaluator;
+import org.junit.Assert;
import java.util.ArrayList;
import java.util.Arrays;
@@ -64,42 +66,60 @@
public void testDict() {
PyBlockEvaluator eval = doEvaluate("a={'b': 'c'}");
- Map map = (Map) eval.getValue("a");
+ Map map = (Map)eval.getValue("a");
assertEquals(1, map.size());
assertEquals("c", map.get("b"));
}
public void testDictNoEvaluate() {
PyBlockEvaluator eval = doEvaluate("a={'b': 'c'}", true);
- Map map = (Map) eval.getValue("a");
+ Map map = (Map)eval.getValue("a");
assertEquals(1, map.size());
assertTrue(map.get("b") instanceof PyStringLiteralExpression);
}
public void testDictAssign() {
PyBlockEvaluator eval = doEvaluate("a={}\na['b']='c'");
- Map map = (Map) eval.getValue("a");
+ Map map = (Map)eval.getValue("a");
assertEquals(1, map.size());
assertEquals("c", map.get("b"));
}
public void testDictAssignNoEvaluate() {
PyBlockEvaluator eval = doEvaluate("a={}\na['b']='c'", true);
- Map map = (Map) eval.getValue("a");
+ Map map = (Map)eval.getValue("a");
assertEquals(1, map.size());
assertTrue(map.get("b") instanceof PyStringLiteralExpression);
}
public void testDictUpdate() {
PyBlockEvaluator eval = doEvaluate("a={}\na.update({'b': 'c'})");
- Map map = (Map) eval.getValue("a");
+ Map map = (Map)eval.getValue("a");
assertEquals(1, map.size());
assertEquals("c", map.get("b"));
}
+ /**
+ * Ensures module has any vars imported from external modules
+ */
+ public void testImport() {
+ myFixture.copyDirectoryToProject("blockEvaluator", "");
+ final PyFile file = PyUtil.as(myFixture.configureByFile("my_module.py"), PyFile.class);
+ assert file != null : "Failed to read file";
+ final PyBlockEvaluator sut = new PyBlockEvaluator();
+ sut.evaluate(file);
+
+ Assert.assertEquals("Failed to read var from package module", "foo", sut.getValueAsString("VARIABLE_IN_PACKAGE_MODULE"));
+ Assert.assertEquals("Failed to read var from package", "foo", sut.getValueAsString("VARIABLE_IN_PACKAGE"));
+ Assert.assertEquals("Failed to read list from another module", Arrays.asList("a", "b", "c", "d"), sut.getValueAsList("SOME_LIST"));
+ Assert.assertEquals("Failed to read var from another module", "42", sut.getValueAsString("SOME_VARIABLE"));
+ Assert.assertEquals("Failed to read var from another module with alias", "foo", sut.getValueAsString("MY_RENAMED_VAR"));
+ }
+
public void testFunction() {
PyBlockEvaluator eval = new PyBlockEvaluator();
- PyFile file = (PyFile)PsiFileFactory.getInstance(myFixture.getProject()).createFileFromText("a.py", PythonFileType.INSTANCE, "def foo(): return 'a'");
+ PyFile file = (PyFile)PsiFileFactory.getInstance(myFixture.getProject())
+ .createFileFromText("a.py", PythonFileType.INSTANCE, "def foo(): return 'a'");
PyFunction foo = file.findTopLevelFunction("foo");
eval.evaluate(foo);
assertEquals("a", eval.getReturnValue());
diff --git a/python/testSrc/com/jetbrains/python/PyFormatterTest.java b/python/testSrc/com/jetbrains/python/PyFormatterTest.java
index 3983689..3680544 100644
--- a/python/testSrc/com/jetbrains/python/PyFormatterTest.java
+++ b/python/testSrc/com/jetbrains/python/PyFormatterTest.java
@@ -398,6 +398,10 @@
doTest();
}
+ public void testShebang() { //PY-12775
+ doTest();
+ }
+
private void doTest() {
doTest(false);
}
diff --git a/python/testSrc/com/jetbrains/python/PyQuickFixTest.java b/python/testSrc/com/jetbrains/python/PyQuickFixTest.java
index fde0c2e..c36372d 100644
--- a/python/testSrc/com/jetbrains/python/PyQuickFixTest.java
+++ b/python/testSrc/com/jetbrains/python/PyQuickFixTest.java
@@ -23,6 +23,7 @@
import com.jetbrains.python.documentation.PyDocumentationSettings;
import com.jetbrains.python.fixtures.PyTestCase;
import com.jetbrains.python.inspections.*;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.LanguageLevel;
import org.jetbrains.annotations.NonNls;
diff --git a/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java b/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
index 9c238be..1eab5f2 100644
--- a/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
+++ b/python/testSrc/com/jetbrains/python/PySuppressInspectionsTest.java
@@ -18,7 +18,7 @@
import com.intellij.codeInsight.intention.IntentionAction;
import com.jetbrains.python.fixtures.PyTestCase;
import com.jetbrains.python.inspections.PyInspection;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.inspections.PyUnusedLocalInspection;
import java.util.List;
diff --git a/python/testSrc/com/jetbrains/python/PyTypeTest.java b/python/testSrc/com/jetbrains/python/PyTypeTest.java
index cfa2966..81b4aa4 100644
--- a/python/testSrc/com/jetbrains/python/PyTypeTest.java
+++ b/python/testSrc/com/jetbrains/python/PyTypeTest.java
@@ -805,6 +805,20 @@
"expr = iter(xs).next()\n");
}
+ // PY-10967
+ public void testDefaultTupleParameterMember() {
+ doTest("int",
+ "def foo(xs=(1, 2)):\n" +
+ " expr, foo = xs\n");
+ }
+
+ public void testTupleIterationType() {
+ doTest("int | str",
+ "xs = (1, 'a')\n" +
+ "for expr in xs:\n" +
+ " pass\n");
+ }
+
private static TypeEvalContext getTypeEvalContext(@NotNull PyExpression element) {
return TypeEvalContext.userInitiated(element.getContainingFile()).withTracing();
}
diff --git a/python/testSrc/com/jetbrains/python/inspections/Py3UnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/Py3UnresolvedReferencesInspectionTest.java
index ee37eab..fe019c6 100644
--- a/python/testSrc/com/jetbrains/python/inspections/Py3UnresolvedReferencesInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/Py3UnresolvedReferencesInspectionTest.java
@@ -20,6 +20,7 @@
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.testFramework.LightProjectDescriptor;
import com.jetbrains.python.fixtures.PyTestCase;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.LanguageLevel;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFile;
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
index 546795e..2141736 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java
@@ -16,6 +16,7 @@
package com.jetbrains.python.inspections;
import com.jetbrains.python.fixtures.PyInspectionTestCase;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.psi.LanguageLevel;
import org.jetbrains.annotations.NotNull;
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnusedImportTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnusedImportTest.java
index e02afa1..018d75e 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyUnusedImportTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyUnusedImportTest.java
@@ -16,6 +16,7 @@
package com.jetbrains.python.inspections;
import com.jetbrains.python.fixtures.PyTestCase;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import org.jetbrains.annotations.NotNull;
/**
diff --git a/python/testSrc/com/jetbrains/python/quickFixes/AddFieldQuickFixTest.java b/python/testSrc/com/jetbrains/python/quickFixes/AddFieldQuickFixTest.java
index c93553d..21ada79 100644
--- a/python/testSrc/com/jetbrains/python/quickFixes/AddFieldQuickFixTest.java
+++ b/python/testSrc/com/jetbrains/python/quickFixes/AddFieldQuickFixTest.java
@@ -18,7 +18,7 @@
import com.intellij.testFramework.TestDataPath;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.PyQuickFixTestCase;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
import com.jetbrains.python.inspections.PyUnusedLocalInspection;
/**
diff --git a/python/testSrc/com/jetbrains/python/quickFixes/AddMethodQuickFixTest.java b/python/testSrc/com/jetbrains/python/quickFixes/AddMethodQuickFixTest.java
index bde22a9..6bc3571 100644
--- a/python/testSrc/com/jetbrains/python/quickFixes/AddMethodQuickFixTest.java
+++ b/python/testSrc/com/jetbrains/python/quickFixes/AddMethodQuickFixTest.java
@@ -18,7 +18,7 @@
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.PyQuickFixTestCase;
import com.jetbrains.python.inspections.PyClassHasNoInitInspection;
-import com.jetbrains.python.inspections.PyUnresolvedReferencesInspection;
+import com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection;
/**
* User: ktisha