Commit Graph

4588 Commits

Author SHA1 Message Date
Alexey Kudravtsev
c83ce9390f tests: cleanup
GitOrigin-RevId: 4c0abf48343a2ad6c4ebfea78c20d66cd981c02b
2024-09-04 12:03:32 +00:00
Alexey Kudravtsev
7040e8e2ae fix testThrowingExceptionFromInspectionMustPropagateUpToTheLogger():
- sometimes an exception could be wrapped in TestAssertionError by Logger - expect both
- avoid data race when thread 1 does "progress.cancel(); save exception" and the other thread does "progress.checkCanceled(); catch (PCE) { get saved exception }"
- unify saved exception storage in the DPI

GitOrigin-RevId: cc960addac3c9eb71522fc6c63edf8248c90ca71
2024-09-03 17:45:46 +00:00
Alexey Kudravtsev
b96b50d09c fix test: do not call super.visit() because it set the "info must be removed" too soon
GitOrigin-RevId: ee5bf56bb2a68353aae153a3ea7d94c2e9fdf3ff
2024-09-02 17:00:27 +00:00
Alexey Kudravtsev
121f917f61 IJPL-161270 Semantic highlighting is still visible after disabling
GitOrigin-RevId: 0af6e1899921ffaf613240ce0865d13d607d86c5
2024-09-02 15:44:59 +00:00
Alexey Kudravtsev
baa254d5eb IJPL-160883 Apply ChangeLocalityDetector even if PSI reference or declaration is changed
do not disable ChangeLocalityDetector produced scope when the reference was changed in languages other than Java/Kotlin, because the rules might be different there. Instead, move that logic inside the java/kotlin ChangeLocalityDetectors

GitOrigin-RevId: 4aafa966186fe038c25e0a2512c80ba1b1d93eeb
2024-08-26 17:04:03 +00:00
Max Medvedev
c4476fce2c IJPL-160728 SuppressDetectingInspection can be non-dumb aware
GitOrigin-RevId: e76b9fb448e6a38d23249684dc77b4e44d8911a9
2024-08-24 22:33:25 +00:00
Alexey Kudravtsev
05ca25248d IJPL-160136 Blinking highlighting on refactoring TS code
Rework the "when to remove highlighters for invalid PSI" heuristic.
Instead of removing them immediately for dirty document regions, recycle them all, in the hope that some languages with poor incremental reparse support will reuse them, event in the dirty regions, e.g. during massive refactorings.
If after some short time (500ms currently, highlighting.delay.invalid.psi.info.kill.ms) these invalid psi highlighters are not reclaimed, kill them to improve responsiveness of removing outdated infos.

GitOrigin-RevId: b5b52c72d7fac0eaab18a5a696b32ae74096ff89
2024-08-22 14:25:38 +00:00
Alexey Kudravtsev
9e7a3e5152 tests: fix "Access from EDT is not allowed" exception when waitForTermination() tries to steal work from FJP in EDT
GitOrigin-RevId: 28e17546ff435975b87066cb8ba77574042229ac
2024-08-20 12:02:17 +00:00
Alexey Kudravtsev
877dee4f7e more correct test: manifest error dialog sooner, before the next highlighting does that implicitly
GitOrigin-RevId: 87351941264a1e2447431d476a257a55b85e9196
2024-08-20 12:02:17 +00:00
Max Medvedev
771364b2e4 don't instantiate all inspections in dumb mode
IJPL-574, IJPL-160462

GitOrigin-RevId: c47be295416b50cf08aa013e818e1bfae4cc607e
2024-08-19 09:23:00 +00:00
Alexey Kudravtsev
6652280052 rewrite file-level highlighters to make them behave just like regular ones
, to fix problems when many file-level infos with always changing descriptions are generated by one tool, e.g. when LargeFileAnnotator generates a different file-level highlighter on every typing

GitOrigin-RevId: f68527d9f3767535247b3680eaa8b26892f940bf
2024-08-13 19:37:41 +00:00
Alexey Kudravtsev
b7e62ca44a fix incorrect assertions, cleanup
GitOrigin-RevId: a24d7f7b859c58c4932519d69d6ec04e294aa630
2024-08-13 15:05:29 +00:00
Alexey Kudravtsev
62b88e8fe3 fix fileStatusMap.getCompositeDocumentDirtyRange() optimization which sometimes returned whole file always
GitOrigin-RevId: af444762564d2fe8fe3d6915db7fa35861546657
2024-08-12 13:10:04 +00:00
Alexey Kudravtsev
c806c607c9 IJPL-159317 IDE highlights syntax in the comment
rework the HighlightInfoUpdater to avoid obsolete error elements stuck in the markup
The problem was in the several highlighting sessions overlapping each other when the one session was canceled but still lingered on while the other started and progressed far enough.
The two sessions called setHighlightersInRange() in HighlightInfoUpdater in reentrant fashion which could lead to some highlighters to be forgotten by HighlightInfoUpdater internal data structures. The fix is to refactor HighlightInfoUpdater to guarantee that the highlighters registered there are always contained in the markup and vice versa.
Several testcases added to DaemonRespondToChangesTest where the test invokes typing, then waits for the daemon to start, then proceed to another typing, effectively canceling the daemon process very frequently to induce the session overlappings and then checking that no error element highlighters are left in the markup

GitOrigin-RevId: 9b72068d71b28d940c3e9fdb98574c78e4776800
2024-08-12 11:27:32 +00:00
Max Medvedev
70c0a3c550 IJPL-574 run inspections in dumb mode
GitOrigin-RevId: 303e9eb0d08645854be047d2630add0b7ed04be2
2024-08-09 20:25:06 +00:00
Alexey Kudravtsev
7e84bf94d4 highlighting: pass toolId correctly to HighlightInfos from various sources
GitOrigin-RevId: 43afc5944671ad1eb211a29269e008613722b8c7
2024-08-08 14:23:57 +00:00
Alexey Kudravtsev
6a9966fdda get rid of all incrementality in todo highlighting because of the TODO API limitations; to fix IJPL-159012 todo coloring disappears by typing
GitOrigin-RevId: 3d4f0efb17d535806f759eb23f88494b79443e06
2024-07-25 14:00:01 +00:00
Alexandr Trushev
291a54cc98 IJPL-158885 Migrate highlighting grave to Necromancer API
GitOrigin-RevId: ced652528104a7f7d8a0fd8a354b8f2eb712433e
2024-07-23 19:03:05 +00:00
Nikita Kudrin
cdf91bf213 [benchmarks] Renaming PerformanceTest* => Benchmark*
GitOrigin-RevId: 9963b84d51e1062acc262a8d3d3de1409a708e3b
2024-07-23 18:20:01 +00:00
Alexey Kudravtsev
65d4f96daa make JobLauncher work even with low cpu count, (e.g. on teamcity agent to be able to run testHighlightVisitorsMustRunIndependentlyAndInParallel()), better compensate for blocking thread waiting for ApplierCompleter
GitOrigin-RevId: 10aef9dab739b0d74c6ab9901ee2f9053a1a9dc4
2024-07-23 16:27:31 +00:00
Alexey Kudravtsev
fd52528d9a fixes to restore ability to cherry-pick to 242
GitOrigin-RevId: a8caf4d3c0cebf250b75c0de61f6bf06437aec53
2024-07-23 13:26:54 +00:00
Alexey Kudravtsev
291ac0c4f4 WEB-67866 Highlighting flashes on typing
- ensure HighlighterRecycler disposes RangeHighlighter only when it removed from HighlightInfoUpdaterImpl data structures
- for that, make HighlighterRecycler usages more structural
- In order to avoid flickering of invalid PSI elements highlighting (caused by poor PSI incremental reparse), do not remove highlighting of invalid PSI elements right away, but recycle RH instead, until the GHP/LIP finished
- After that, to avoid annoying pause removing highlighting of invalid PSI elements on typing, caused by increased latency due to RH recycling above, introduce new heuristic:
  1) when the document change was near these PSI elements, remove the corresponding highlighting immediately: it most probably was typing over these PSI elements, the chance they'll survive is small
  2) when the document change was outside these PSI elements, e.g. in the other corner of the file, recycle these RH until the GHP ended, since these probably were artifacts of poor incremental reparse, chances are high these RH will reappear at the same place
 - to get the "document dirty range", add document listener to FileStatusMap which combines/maintains document events until the highlighting is done

GitOrigin-RevId: 0961deb12999760a7bce0a2322c9d535feb5408f
2024-07-19 11:51:43 +00:00
Mikhail Pyltsin
0b30038602 [java-highlighting] IDEA-356470 Support jep 455. Generate true and false cases for boolean selector
GitOrigin-RevId: fbd879f172639f3db1b0d9c12f98fcb3868fa1a9
2024-07-18 20:11:33 +00:00
Alexey Kudravtsev
bc618f7793 fix test: avoid calling analyze() for each PIS element, production doesn't do that
GitOrigin-RevId: 88e9e2968688ec42a3f6dd1fb1d06390b30b83f9
2024-07-16 11:17:29 +00:00
Alexey Kudravtsev
a1fa3b8c52 test for IJPL-28717 Todo line lose coloring
GitOrigin-RevId: 3bfd42b1ec593b955cfb4244edebe17b60185601
2024-07-16 11:17:29 +00:00
Tagir Valeev
de8b87911f Unnecessary semicolon; other warning fixes
GitOrigin-RevId: 764ae6527647fe0d665d4f6c645693125ff70995
2024-07-09 16:13:25 +00:00
Tagir Valeev
e1b597714c [intention-actions] IJPL-157866 Fix all error messages doesn't always work in injected files
GitOrigin-RevId: d05e12a6544901c7a88ba9588527fa043be5a2ec
2024-07-05 19:36:03 +00:00
Tagir Valeev
180afa6fe6 [intention-actions] Apply 'fix offset' correctly in injections
Fixes IDEA-355696 Sometimes insert semicolon action inserts in the wrong place in injections

GitOrigin-RevId: 6a8e35bdd0f28b8cb9f123fd6112f78152c3bd22
2024-07-05 11:13:08 +00:00
Mikhail Pyltsin
f90bd8b6f1 [java-inspections] IDEA-355790 JEP 477. Suppress for class doesn't work
- These changes disable suppressions for implicit classes

GitOrigin-RevId: ff2fac065c092f257548bbfec5c799d48e116cac
2024-07-03 22:08:48 +00:00
Tagir Valeev
0a7c79a9b8 [java-intention] IDEA-355627 Insert semicolon action fails in injection
GitOrigin-RevId: b43046d97bb73f7fa17eedef5575271b7ddbf28f
2024-06-28 17:23:07 +00:00
Tagir Valeev
2909ce4932 [java-intentions] RemoveAllUnusedImportsFix: support static imports; tests
Fixes IDEA-353352 "Remove unused imports" does nothing for static imports

GitOrigin-RevId: ae20983342012414568af9ca68db67994832443c
2024-06-28 11:03:18 +00:00
Vladimir Krivosheev
e725a62891 IJPL-796 refactor HighlightingMarkupGrave
GitOrigin-RevId: ff1087bac8b556dd801bf75b63c986741e3c0c47
2024-06-17 08:18:07 +00:00
Vladimir Krivosheev
28a4004c72 IJPL-796 store DaemonCodeAnalyzerImpl in PRODUCT_WORKSPACE_FILE
GitOrigin-RevId: 936619ce815ba0f31a6e5c117f9e18102e143aca
2024-06-15 19:18:55 +00:00
Vladimir Krivosheev
a2b39c12f4 IJPL-796 reduce calls to isEditorLoaded
GitOrigin-RevId: c89f849d5cd98b542435ed9e069cf71011ed3596
2024-06-15 19:18:55 +00:00
Tagir Valeev
9766de10a4 [java-analysis] NullableNotNullManagerImpl: more robust tracking of updated defaults
GitOrigin-RevId: bb75619bbd246d8dcbd3538f5e99122a9da25fe4
2024-06-14 18:18:48 +00:00
Tagir Valeev
567e0b0d05 [java-intentions] IDEA-270206 Nullability annotation at type parameter/wildcard: add a quick-fix to move it to the bound
GitOrigin-RevId: e8e56c2d27a77414045064c784f48ff712ad0d2d
2024-06-14 16:05:02 +00:00
Alexey Kudravtsev
6dde033c9b make LocalQuickFixes, supplied by dumb annotators in dumb mode, dumbaware (part of IJPL-404 Show intention actions while indexing)
GitOrigin-RevId: bd94f11d417830f0eefbd92ef8f5ea4e1c9ce2fe
2024-06-12 16:58:26 +00:00
Maxim.Kolmakov
71168cb8a9 IJ-CR-135039 Replace usages of PlatformTestUtil.newPerformanceTest with PerformanceTestUtil.newPerformanceTest
GitOrigin-RevId: 4edcfadc23f7305d68b8c08cd6ae634ee4869a2e
2024-06-03 10:14:22 +00:00
Alexey Kudravtsev
9fc02f8fc0 do not remove line marker highlighter only because it's outside current highlight bounds to fix IJPL-150354 Line marker on PsiFile keeps disappearing after file editing
GitOrigin-RevId: 39d88a628abc3d227b24cb8224659e675a017504
2024-05-24 18:10:42 +00:00
Alexey Kudravtsev
9a8ffeebcd refactor out line marker tests from DaemonRespondToChangesTest (to DaemonLineMarkersRespondToChangesTest)
GitOrigin-RevId: 048958370d3252b58ffa3bb2c2751667178f1d6d
2024-05-24 18:10:39 +00:00
Alexey Kudravtsev
dd83f65ffb show plain intentions (not just quick fixes) in dumb mode if they are dumbaware (part of IJPL-404 Show intention actions while indexing)
GitOrigin-RevId: 2b9c7ecbbeccc265a90978641cc531f478f3a92a
2024-05-23 01:01:32 +00:00
Alexey Kudravtsev
ef7a6fe109 delegate "dumb aware" flag in all sorts of intention action wrappers correctly (part of IJPL-404 Show intention actions while indexing)
GitOrigin-RevId: b934b9c8e3e5d8ccdf0c003775740f530370087c
2024-05-22 21:13:38 +00:00
Alexey Kudravtsev
eec4e7570a cleanup
GitOrigin-RevId: b1e6b562d6f7911579103d2ff33e977ad7ac3483
2024-05-22 18:34:40 +00:00
Alexey Kudravtsev
54226c6bf4 fix testModificationInExcludedFileDoesNotCauseRehighlight
GitOrigin-RevId: 1772ffdda123d4b97d0e7f80db18b30a113b29a9
2024-05-21 16:23:20 +00:00
Alexey Kudravtsev
12fe9dde02 handle one other type of PSI change (part of KTIJ-27988 K2 IDE: used/unused declaration highlighting is not updated in Kotlin source on editing Java source)
GitOrigin-RevId: d2e7d4c9801d50df41cffa33eedb22a1db1ac7cf
2024-05-21 16:23:10 +00:00
Alexey Kudravtsev
c84e273956 rehighlight the entire file whenever the reference was changed in some other place, even inside codeblock, to correctly update unused declarations, to fix KTIJ-27988 K2 IDE: used/unused declaration highlighting is not updated in Kotlin source on editing Java source
GitOrigin-RevId: d4025dde88ed3a997a515cb859077fb2a4348d5d
2024-05-17 13:50:18 +00:00
Alexey Kudravtsev
49e238388a add javadoc
GitOrigin-RevId: 94d964a41969a5bf84ee49c9b71ad53640557952
2024-05-17 13:50:11 +00:00
Alexey Kudravtsev
6e9810de00 cleanup
GitOrigin-RevId: 2637d96e86e2a210fcdf6d1b390f914770e91842
2024-05-15 19:01:10 +00:00
Alexey Kudravtsev
aa2f8c054b fix duplicate file level highlights; add test
GitOrigin-RevId: 6013b05627aab37e043f445484922a62317fa361
2024-05-14 18:34:24 +00:00
Alexey Kudravtsev
b66d4897fa fix test: in case of limited CPUs on TeamCity worker, ForkJoinPool may crash or freeze with thread exhaustion symptoms
GitOrigin-RevId: d417464eebfb7227bc2e0742fa36fc30ed754d52
2024-05-14 15:53:28 +00:00