Commit Graph

177 Commits

Author SHA1 Message Date
Vladimir Krivosheev
2d5aaf391b IJ-MR-162467 don't export intellij.xml.psi
GitOrigin-RevId: d4ca928b7dc468451c0047bd35f1f60c1199207a
2025-06-05 14:33:17 +00:00
Vladimir Krivosheev
65fe061584 IJ-MR-162467 don't export intellij.platform.analysis
GitOrigin-RevId: fcbcb68010b58cb507fee2c47473758b999e471b
2025-06-04 11:16:33 +00:00
Alexander Koshevoy
8f18164915 [path-annotations] Replace custom QuickFix implementations with AddAnnotationModCommandAction
Refactored PathAnnotationInspection to use the unified AddAnnotationModCommandAction for handling path annotation quick fixes, reducing code duplication and improving maintainability.

GitOrigin-RevId: 36536b1859861095ded37a0abb22c77c0de75634
2025-05-19 18:42:00 +00:00
Alexander Koshevoy
adcd5b2528 [path-annotations] Chore: move tests from base test class to its subclass
Moved path annotation tests from the base test class to a dedicated test file for clarity and maintainability.

GitOrigin-RevId: 0f6a440caff8aaf3c74c092334c771cf20404e6d
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
5c5f36cec9 [path-annotations] Add virtual path annotation support and associated tests
Implemented a registry for virtual `@LocalPath` annotations to associate path semantics with methods without modifying them directly. Updated `PathAnnotationInspection` to handle these virtual annotations and added comprehensive unit tests to validate the behavior.

GitOrigin-RevId: 10b8d9f5af3fe6f707aa275f6e0546a082ede71e
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
1d7c287edc [path-annotations] Update inspection warnings for path annotation return types
Updated the inspection logic to properly warn about mismatched or missing annotations in return types, such as `@NativePath`, `@LocalPath`, `@MultiRoutingFileSystemPath`, and `@Filename`. This ensures consistent validation for annotated method return values.

GitOrigin-RevId: 496a217dfd22b477eac3927850e3384a7721d268
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
104a7249dd [path-annotations] Refactor path annotation checks and streamline quick-fix logic
Simplified path annotation inspection by introducing a unified `PathAnnotationInfo` structure with quick-fix mappings. Replaced verbose `when` conditions with a cleaner compatibility map for annotation checks, improving readability and maintainability. Updated associated tests to reflect the refined logic and new message structure.

GitOrigin-RevId: bd19014a0f951cd0fd5a7043b098638eab547085
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
757c0e7f21 [path-annotations] Update PathAnnotationInspection to improve validation checks
Expanded validation to handle return expressions and added stricter checks for mismatched path annotations. Introduced quick fixes for missing annotations and extended test cases to reflect the new behaviors, ensuring comprehensive coverage.

GitOrigin-RevId: 0a77c6ccba44d0bf925755be69efa5688623d057
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
04ad6eb20d [path-annotations] Add tests for PathAnnotationInspection parameter and return types
Introduce comprehensive tests to validate the correct handling of method parameters and return types for various path annotations, including @MultiRoutingFileSystemPath, @NativePath, @LocalPath, and @Filename. Ensure proper interactions and warnings for incompatible annotation usage.

GitOrigin-RevId: ad0aa2a6ef309ddd4a82993c09626f81378dc7c3
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
4dfc003d94 [path-annotations] Refactor path inspection for broader system property support
Updated the inspection logic to handle additional absolute path-related system properties (`java.home`, `user.home`, `user.dir`, `java.io.tmpdir`).

GitOrigin-RevId: 3ee26bf4e3e08f5bb5c8b9805e3ede1402ebda18
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
6ee23de7f1 [path-annotations] Refactor Path.toString() handling in PathAnnotationInspection
Updated PathAnnotationInspection to improve handling of `Path.toString()` calls by using `getUCallExpression` for better resolution. Enhanced test coverage to include cases with inlined `Path.toString()` calls, ensuring no unnecessary warnings are produced.

GitOrigin-RevId: 9a1ef8f82475dec1b182e5a8efd412081772149b
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
d1aa236ffd [path-annotations] Add handling for Path.toString() and System.getProperty("user.home")
Enhanced `PathAnnotationInspection` to recognize `Path.toString()` as `@MultiRoutingFileSystemPath` and `System.getProperty("user.home")` as `@LocalPath`. Added tests to validate the new behavior, ensuring compatibility and correctness in these scenarios.

GitOrigin-RevId: b0f845f9e57dbe8c41270c3c96cb94b68a344b6d
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
5bbf9ebced [path-annotations] Refactor path annotation inspection and relax validation rules
* Simplify path validation by consolidating first and subsequent argument checks
* Allow `@LocalPath` annotation to be used directly in `Path.of()`
* Make error messages more specific about required annotations
* Reduce code duplication in validation logic

GitOrigin-RevId: 03e09d19dd17b374e921b0a387fa5cf19dfed5df
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
13e69d0530 [path-annotations] Enhance annotation fixes with class reference shortening and add corresponding tests
Introduce `doTestQuickFix` to streamline testing of quick fixes by automating setup, application, and result verification.

GitOrigin-RevId: 9c97298d992be5e4734de3aa119bfec310267dba
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
57f42efc07 [path-annotations] Add tests for PathAnnotationInspection with Paths.get usage
Introduce tests to validate correct behavior of PathAnnotationInspection when using `Paths.get`. Verify proper highlighting of non-annotated strings as first arguments and ensure no false positives for correctly annotated or valid usage scenarios.

GitOrigin-RevId: 0d7956531ae5c5679c00016325e8a78130f13864
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
45f91f58bf [path-annotations] Refactor and add tests for PathAnnotationInspection
Removed the `testMixedParameterTypes` test and replaced it with new focused test cases in `PathAnnotationInspectionPathOfTest`. The new tests cover scenarios for the `Path.of` constructor with annotated and non-annotated arguments to ensure proper inspection behavior.

GitOrigin-RevId: a4b26c0980d5dbbcfec4f0d360d50a6966d672d7
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
9bffa0b592 [path-annotations] Improve support of java.nio.file.Path type in PathAnnotationInspection
Updated `PathAnnotationInspection` to properly handle parameters of type `java.nio.file.Path`. Introduced logic to bypass validation for such parameters in methods like resolve, `resolveSibling`, `startsWith`, and `endsWith`. Added comprehensive tests to ensure correct behavior with mixed parameter types and scenarios.

GitOrigin-RevId: 77a468a2399cdc126d8e52a7687e5d066268be77
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
a8844c05c0 [path-annotations] chore: Use bundled messages in path annotations inspections and fixups tests
GitOrigin-RevId: 1bf2d05ac16277b3ca54d5915f558e37212208ef
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
ef7f39e22a [path-annotations] Add support for @LocalPath annotation in inspections
Extend PathAnnotationInspection to handle @LocalPath annotations, ensuring proper validation and highlighting of incorrect usages. Introduced relevant quick fixes and tests to validate the behavior, including scenarios involving `Path.of`, `Path.resolve`, and `FileSystem.getPath`.

GitOrigin-RevId: ab1154185a151f0c6add29321f4b91ea638ff9d1
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
4f85f5b28f [path-annotations] Enhance Path.resolve() inspection for valid filenames
Add support to recognize valid string literals and constant initializers representing filenames in `Path.resolve()`. Update inspection logic and test cases to exclude warnings for such cases, improving annotation handling and reducing false positives.

Generated by Junie.

GitOrigin-RevId: b8293d0c5f29a010ec34dcc4329551d5839e2be5
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
be67983841 [path-annotations] Add tests for PathAnnotationInspection quick fixes
Introduce unit tests to verify quick fixes in PathAnnotationInspection. These include tests for adding annotations like `@MultiRoutingFileSystemPath` and `@NativePath` to resolve warnings and errors. Ensure proper functionality of related inspections and fixes.

Generated by Junie.

GitOrigin-RevId: 15e7033203a78e3a221d8825b896054bc0867570
2025-05-19 18:41:59 +00:00
Alexander Koshevoy
51865104af [path-annotations] Fix test data in PathAnnotationInspectionJavaTest to make it pass
Reorganized imports in `PathAnnotationInspectionJavaTest.kt` for clarity and consistency. Adjusted warning descriptors to improve readability in annotated string path scenarios.

GitOrigin-RevId: 96b9df9cc62ba7b5aa7f0d713621b9afd23b9478
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
f540f99481 [path-annotations] Add support for validating filenames in path annotations
Refactored `PathAnnotationInspection` to handle string literals and constant variables representing valid filenames. Introduced checks to identify valid filenames in `Path.of()` and `FileSystem.getPath()` methods, avoiding unnecessary warnings. Added related test cases to ensure correct behavior and extended validation coverage.

Generated by Junie.

GitOrigin-RevId: bcb7313bb4d2001f369c4b2b26b72d167c07599b
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
4d52c5461b [path-annotations] Add inspections for Path.of() argument annotations
Enhanced `Path.of()` to validate argument annotations properly. Introduced checks for `@MultiRoutingFileSystemPath` and `@Filename` in 'more' parameters while ensuring accurate error reporting for invalid or missing annotations.

Generated by Junie.

GitOrigin-RevId: f2c68b79e982f5a97b8f0749725b4c271fd86285
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
0985a7045c [path-annotations] Refine PathAnnotationInspection for FileSystem.getPath()
Add checks to ensure arguments of FileSystem.getPath() are annotated correctly. First argument must use @NativePath, while additional arguments can be annotated with @NativePath or @Filename. Updated tests verify proper inspections and error reporting.

Generated by Junie.

GitOrigin-RevId: f89d99fc8b4783763c875c0445aa083aeb4d51eb
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
2876f7c4e4 [path-annotations] Add support for @Filename annotation in PathAnnotationInspection
Extend PathAnnotationInspection to recognize and handle @Filename annotations, ensuring strings representing filenames are correctly annotated. Updated tests to validate behavior with both @Filename and existing annotations like @MultiRoutingFileSystemPath.

Generated by Junie.

GitOrigin-RevId: e749093e30cc0a6976aeb96a7bd112006d27fb50
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
8b4fd8e401 [path-annotations] Correct PathAnnotationInspection to make testNonAnnotatedStringInPathResolve pass
GitOrigin-RevId: 90a75488a3a126a9db824ccfaba2570a91bbdcc1
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
f25d956d8f [path-annotations] Add path annotation checks for Path.of() and Path.resolve() usage
Introduced inspections to warn about non-annotated strings in `Path.of()` and `Path.resolve()` contexts. Updated tests to cover these scenarios and added `@NativePath` annotation to relevant parameters in the Docker CLI functionality.

Generated by Junie to highlight `Path.of()` calls with not annotated strings as normal warnings and add highlighting of `Path.resolve()` with not annotated strings as weak warnings.

GitOrigin-RevId: fb55c1716e3c007b35428320f58c5cf7afce5b5f
2025-05-19 18:41:58 +00:00
Alexander Koshevoy
58fbc8f1a4 [path-annotations] Add PathAnnotationInspection for verifying path annotation usage
Introduced `PathAnnotationInspection` to detect incorrect usage of `@NativePath` and `@MultiRoutingFileSystemPath` annotations. Added corresponding tests and test resources to validate the inspection functionality. Updated DevKit messages and inspection metadata for integration.

GitOrigin-RevId: 759c0fda9da795e0ec2f9ceab1cbd70f3ce835b7
2025-05-19 18:41:58 +00:00
Vladimir Krivosheev
7cf9ef2b29 update bazel files
GitOrigin-RevId: e78f86bd17affd7892fd1af8e157f033906b1865
2025-05-09 15:36:06 +00:00
Vladimir Krivosheev
644a6b2e81 IJ-MR-162467 don't export intellij.platform.editor.ui
GitOrigin-RevId: 8894abe16fb347de7649bfb2d7888b6e6fe0232c
2025-05-09 14:20:40 +00:00
Vladimir Krivosheev
e86c98dfd7 fix JavaeeJmxAdminServerBase$JmxOperation visibility
GitOrigin-RevId: f487a8f04a61e15fe49c3d16097b8f3d869a9928
2025-02-19 08:33:02 +00:00
Vladimir Krivosheev
1a14b193f7 fix MavenSimpleNode visibility
GitOrigin-RevId: 9f5f93df9aea38aa90ac8bc2149e0ef2ca9e436b
2025-02-19 08:33:02 +00:00
Vladimir Krivosheev
0ba6685810 fix JavaStatementsModCommandSurrounder visibility
GitOrigin-RevId: 69ab5cc5c27bcc99dc493e1db51a4e631b4a0edf
2025-02-19 08:33:02 +00:00
Vladimir Krivosheev
6eca2cc6ff fix ResolveException visibility
GitOrigin-RevId: 84472bde22e92af95e5e9aeee4ebb70cb5a40532
2025-02-19 08:33:02 +00:00
Vladimir Krivosheev
28ba7c357d update bazel files
GitOrigin-RevId: 0ae6a208a70207c0db3697cde1d1dba065d0c5ad
2025-01-21 04:29:08 +00:00
Yuriy Artamonov
ef1a727d2d [spellchecker] IJPL-33983 DevKit: Allow for mnemonics when spellchecking .properties files
GitOrigin-RevId: 82239852c0a5eb741e9226802673d9aaa8ab33aa
2025-01-19 20:55:21 +00:00
Vladimir Krivosheev
5503ee3763 don't export assertJ
GitOrigin-RevId: b656ea7185064cb52d6d2444d5b0fd493aab99a0
2024-12-31 12:04:06 +00:00
Vladimir Krivosheev
a522f96d66 do not export deps blindly (part 3)
GitOrigin-RevId: 7277ece9ded25f1111febc8dccaba9ac8cc75c21
2024-12-22 20:28:42 +00:00
Vladimir Krivosheev
edcd74ca8e do not export deps blindly (part 3)
GitOrigin-RevId: 63cc056df570011dd65422f212f7ff7c33111e06
2024-12-21 22:49:44 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Yann Cébron
e05b30b818 [devkit] DOM: move Anchor to AddToGroup
GitOrigin-RevId: 3d88aad127499035b276074b0949c01fde8de553
2024-12-10 14:05:07 +00:00
Vladimir Krivosheev
0a6e06b2b7 do not export devkit.core
GitOrigin-RevId: f608ade0f8705b504494923a3aa121631b85b43b
2024-11-29 10:54:18 +00:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Karol Lewandowski
0f2f3780b5 IJPL-162560: IncorrectProcessCanceledExceptionHandlingInspection: Rename to IncorrectCancellationExceptionHandlingInspection
GitOrigin-RevId: cfad09299a8124eea5747dd36d5472ae27e3c9ab
2024-09-20 12:12:43 +00:00
Karol Lewandowski
2beb8da5c2 Rename ReadOrWriteActionInServiceInitializationInspection to PotentialDeadlockInServiceInitializationInspection
GitOrigin-RevId: bcf700c2c1a8c7afa9d3d257f010413e6a0e95fb
2024-09-13 17:25:06 +00:00
Yann Cébron
96090e5b02 [devkit] adjust "Must override ActionGroup.canBePerformed [...]" inspection (IJPL-116447)
GitOrigin-RevId: 02077deb11ed9d0a63dcb064192ed16f1dcff1dd
2024-09-12 15:15:07 +00:00
Yann Cébron
e2fa26c890 [devkit] new inspection: JComponent must use UiDataProvider (IDEA-355274)
rewrite to UAST

GitOrigin-RevId: 3579db2e2f0416ea30ceeddb8f0416efe53c5831
2024-08-06 11:37:08 +00:00
Yann Cébron
1d0ac8c33e [devkit] "Extension class should not be public": show dedicated hint for services (IJPL-115185)
GitOrigin-RevId: 8ddceed617020cacc5e5c2cd3dfab5d3b0fbd8ad
2024-06-20 14:27:35 +00:00
Vladislav Rassokhin
78e0059e89 [platform] move isIdeaProject to a dedicated class in intellij.platform.ide.core as it's widely used
GitOrigin-RevId: 73c43defd45327b2beb761cd3a2d027d04754d7c
2024-06-20 13:09:26 +00:00