Commit Graph

458 Commits

Author SHA1 Message Date
Nikita Kudrin
cdf91bf213 [benchmarks] Renaming PerformanceTest* => Benchmark*
GitOrigin-RevId: 9963b84d51e1062acc262a8d3d3de1409a708e3b
2024-07-23 18:20:01 +00:00
Nikita Katkov
c7ef524aae [json] IJPL-157032 Disabled merging test
To fix it, we should make MatchResult store schemas in a set to avoid equal objects from being present in the resolve result. But this for some reason breaks ancient anyOf validation. The related code seems really hard to debug, so the merging test is currently disabled. The corresponding change is reverted in the previous commit.

GitOrigin-RevId: 08e7fd02cb6556044c3a80863bd29fa1d770155f
2024-06-24 00:51:36 +00:00
Nikita Katkov
9ad4797fbf [json] IJPL-157032 Implemented InheritedObjectView and specified which exactly methods should and should not be inherited
Inherited works as follows:
- it wraps parent and child JsonSchemaObjects
- it delegates composed schema access to child object (oneOf, anyOf, allOf, not, if-else)
- it combines other properties and prefers children's one if the property is present in both objects

This helps solve dynamicAnchor and dynamicRef problem where an anchor declared in a base schema could be overridden in the dependent one. References to the anchor must resolve to the overridden anchor location -> we have to keep track of both declarations via inheritance mechanics.

GitOrigin-RevId: f26f14735ff937326cd559ae05288d369477e1a6
2024-06-24 00:51:36 +00:00
Nikita Katkov
b29ca8a465 [json] IJPL-63554 Introduced new tests for the updated JSON schema versions support
- if-then-else tests for smart and basic completion with different resolve logic
- dynamic anchors with overridden values
- unevaluated properties
- prefix items
- dependent schemas
- various new validations tests
- yaml and json coverage

GitOrigin-RevId: 63ec3d8176ef368a8c80ebcd3687fb3732412df3
2024-06-18 20:26:11 +00:00
Alexandr Trushev
1e4e505e16 IJPL-797 intellij.platform.editor review internal API
GitOrigin-RevId: 514591f43e57749b752d8399d08b2cfd79fb34ea
2024-06-17 22:06:02 +00:00
Anton Lobov
3fa9e2e014 [json schema] nested completion refactoring - add a test for the broken case of in between properties and fix it
GitOrigin-RevId: 80f79dbee93de3f498a7d5fb94094a2272659f1c
2024-06-11 17:45:27 +00:00
Anton Lobov
7465b4dc98 [json schema] nested completion refactoring - tests for amperlang
GitOrigin-RevId: 6972c123e6ec06bc4361aed9ec1d5bb2e5b3cc85
2024-06-11 17:45:27 +00:00
Anton Lobov
d84e3af47b [json schema] nested completion refactoring - getting rid of precomputed hasValue and insertComma
GitOrigin-RevId: 61409bf5eab295ae24dc6bef78ca78e7eaac450d
2024-06-11 17:45:27 +00:00
Anton Lobov
ebe0d4b74b [json schema] nested completion refactoring - add nested tests to json schema suite
GitOrigin-RevId: 6afd1c0c2e3bdea43507ab603c0260876fa34a6a
2024-06-11 17:45:27 +00:00
Anton Lobov
0726a3b90f [json schema] nested completion refactoring - add tests for pure json
GitOrigin-RevId: 99bc912cd49c91f1961163b4598780d7fbd73f90
2024-06-11 17:45:27 +00:00
Joffrey.Bion
bfe78c3f59 [yaml] IJPL-150017 Support commas for missing property fix in YAML hash mappings
The IncorrectOperationException was just a red herring. It's a symptom caused by
the invalidity of the YAML produced by the quick fix when automatically adding
multiple properties.

Basically, when adding several properties in a hash mapping (or "flow mapping"
in the spec terms - the ones with braces that look like JSON objects), the
separator between the properties was an EOL, but it's supposed to be an actual
comma. This led to a broken syntax after the first property insertion.

This was fixed by properly supporting commas for hash mappings.

GitOrigin-RevId: 84056029147a74c397493cc62a1baa58b5616125
2024-06-05 13:24:18 +00:00
Tagir Valeev
c773b5989e [json] SuggestEnumValuesFix: ModCommand
Also: tests; tests for injection; fix escaping bug in JsonStringLiteralManipulator

GitOrigin-RevId: 5d080937faa801c42dbc69d5c1a88a39301febbe
2024-06-05 10:42:25 +00:00
Tagir Valeev
26b4805668 [json] RemoveProhibitedPropertyFix: handle last element; more tests
GitOrigin-RevId: 1186bd81d5be09e88afb67865d2851d6a8fb4e85
2024-06-05 10:42:18 +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
Yuriy Artamonov
a7a91506ba [tests] IJPL-148944 Enable isIconRequired in tests
GitOrigin-RevId: c15b2e5e2ac70f21371cd610a666ad8d87e52053
2024-05-05 17:43:32 +00:00
Yuriy Artamonov
66bdcd58fe [performance] IJPL-148944 Test access to PSI from icon providers for JSON and YAML
GitOrigin-RevId: 627766e1bdc5e53ae9df368298ccaf7753422752
2024-04-27 22:43:53 +00:00
Nikita Katkov
b532cb861a [json] IDEA-347253 Do not try to trick performance test by configuring fixture outside of the test body
GitOrigin-RevId: 75768fc28ca2a0dbb84fc33dc31ac8062775cb35
2024-02-26 21:59:27 +00:00
Stanislav Utikeev
4264ef0924 [json, AMPER-23, AMPER-341] Allow marking enums in JSON schema as order sensitive to enforce the completion order
GitOrigin-RevId: b82cfe8516e897e5dbb44eb2b93b56a2036f5327
2024-02-19 13:44:31 +00:00
Nikita Katkov
f1bb58169e [json] Performance highlighting test that checks both JsonSchemaObject implementations
GitOrigin-RevId: a7457c8734eac788e45dd361b16dba10e25301a6
2024-02-08 13:30:18 +00:00
Nikita Katkov
c5c109615a [json] Made azure highlighting test to be executed against both new and old implementations of JsonSchemaObject
GitOrigin-RevId: 4bacdc2021d2d73e9d01bc639ba72f041703136e
2024-02-08 13:30:08 +00:00
Nikita Kudrin
3dce2dce2f [unit perf tests] AT-644 Renaming
GitOrigin-RevId: 464b77181de9f1e0cc6de2623201635c405ee4c3
2024-02-08 11:21:41 +00:00
Nikita Katkov
46967b586c [json] IJ-CR-124164 Review fixes
- Use virtual file as a key in schema storage map
- Prefer KFMap instead of lazy properties
- Fix various minor code-style problems

GitOrigin-RevId: 20825456c5b98f654e3957eb9783badb21a6d433
2024-02-07 18:29:11 +00:00
Nikita Kudrin
b143fe1540 [unit perf tests] AT-644 Removed expected time from the tests
GitOrigin-RevId: a53f40c1721a46c7833018346dc622dec1f1b80a
2024-02-07 16:11:29 +00:00
Sergey Simonchik
ea002ba69f json: reduce expected duration of JsonFormattingTest.testHugeJsonFile
GitOrigin-RevId: d4cd8e7320e643a85bb15662186254a92855ba5f
2024-01-29 13:56:17 +00:00
Sergey Simonchik
f0a354d4f6 json: fix JsonFormattingTest.testHugeJsonFile test data (WEB-64448)
GitOrigin-RevId: 018ca324938649cc7bb3374c41960acd1650ae84
2024-01-29 03:14:14 +00:00
Vladimir Krivosheev
a920a363f7 IJPL-326 remove getCoroutineScope
GitOrigin-RevId: 071d852d71a7b6a6e5a24088a9bd987fe487f407
2024-01-24 19:51:13 +00:00
Nikita Katkov
80a17985c5 [amper + json] IJ-CR-123483 Review fixes: naming, references in the comments, code style
GitOrigin-RevId: beea860ae411b8d8158c79c6bc7859947a24aae1
2024-01-24 19:18:27 +00:00
Nikita Katkov
8ba2f5ebe7 [json] IDEA-339628 Introduced schema reading and merging tests
These tests are temporary and should be removed along with the old JsonSchemaObject implementation. Their goal is to ensure that both implementations of the schema object and schema merger are producing exactly the same output during schema reading and in-schema resolve

GitOrigin-RevId: bb91ba2e3ff440bae4e8591363852590a78068fc
2024-01-16 20:26:54 +00:00
Nikita Katkov
76de112858 [json] IDEA-339628 Refactored nested completions logic
Primarily used by the Amper yaml files, this functionality provided great value but using incorrect approach at the same time. Previously stored inside a JsonSchemaObject, instances of NestedCompletionsRoot are now provided during json schema-based completion via the corresponding extension point. Caching of nested completion roots is now a responsibility of implementors. SchemaObject instances are no more mutated by this API, extension interface itself is simplified too and does not depend on a particular schema object instance - instead it assumes that the provided completions tree is always constructed for the very inspected file root

GitOrigin-RevId: e8ab13ab6af569f50525f37a1291d670595a7fe6
2024-01-16 20:26:07 +00:00
Nikita Katkov
3f1026375a [json] IDEA-339628 Added highlighting test for large real life schema file (azure)
GitOrigin-RevId: 0bc69fd3c2cd20a1d19f290b04f1dc0a6610a7b4
2024-01-16 20:26:01 +00:00
Nikita Katkov
9743bb5f48 [json] IDEA-339628 Test data updates
- The new schema parsing mechanism requires schema files to be valid -> accidentally invalid schemas in test data were fixed
- Explicit warning message text was added in some old-fashioned tests to make debugging experience easier

GitOrigin-RevId: 05d45d770d768a7aa70c554294434a731e9228ba
2024-01-16 20:25:54 +00:00
wout.werkman
3a442efa8b [IDEA-331564][JsonSchema] Changed tests to not care about expected completion variant order.
The current alphabetic ordering was annoying to use, and it didn't actually assert anything the user could see anyways.

GitOrigin-RevId: e5e95c5877e85a6f3fe05cd1ec26094734ef9dde
2023-09-12 14:45:34 +00:00
wout.werkman
beb535f524 [IDEA-331564][JsonSchema] Changed forgotten .yaml extension to .json
GitOrigin-RevId: 7ed5518ed4da4f64bc793fd2415846e4fe6e709d
2023-09-12 14:45:30 +00:00
wout.werkman
7819e14687 [IDEA-331564][JsonSchema] Made Yaml's nested completions assert completion variants by rendered text
It makes what you read in the tests closer to what the user experiences. Additionally, it also asserts the rendered behavior.

GitOrigin-RevId: e15be753a157945c988246db7bd3bd4473ce970c
2023-09-12 14:45:27 +00:00
wout.werkman
31c9b04b18 [IDEA-331835][JsonSchema] Implemented smarter auto-completion for conditional properties
GitOrigin-RevId: eb256eb4088ba829b77bc8997f9778f3b45da150
2023-09-08 19:34:35 +00:00
wout.werkman
58f6c49ddb [IDEA-331835][Json Schema] Minor tests clean up
GitOrigin-RevId: 9152ee3d7c49a05b0d18d8b02d2ad6f2b4108c25
2023-09-08 19:34:32 +00:00
wout.werkman
edce85de1e [IDEA-331564][JsonSchema] Implemented nested completions
GitOrigin-RevId: b12f614b5fc54c26d1717b5c24ae3fd699e67c05
2023-09-08 19:33:57 +00:00
Nikita Katkov
9c49b47de2 [http-client + yaml + json] IJ-CR-112452 Review fixes
- Made intention preview available
- Merged subsequent read actions
- Made isAvailable work very fast
- Tried to set the same id to all commands to achieve single redo for the entire request, but that didn't work out yet

GitOrigin-RevId: 54f4a3458bb05d1a03729483a95b269fbf2875e0
2023-08-09 19:36:19 +00:00
Nikita Katkov
8eb846230d [json + yaml] IDEA-327166 Added ability to get default property value from the example field of a JSON-schema
Consider support of examples field as well, since they are both valid in the latest schema version

GitOrigin-RevId: cd65bc3c3bd19334fbf6ea42e545a8a349e9f236
2023-08-07 15:31:51 +00:00
Nikita Katkov
545c237944 [yaml + json] IDEA-324659 Tests
GitOrigin-RevId: 566f6223899f47e2bb8a04dc16c582020bf08d1d
2023-08-03 21:32:36 +00:00
Nikita Katkov
08b50249f6 [json + yaml] IDEA-257980 Adjust test data highlighting ranges
GitOrigin-RevId: 366ca407a02b409be80784ea872bd5a50a510651
2023-08-01 15:38:31 +00:00
Nikita Katkov
c667562a02 [json] IDEA-257980 Adjust highlighted text range in case a top level yaml mapping or json property has errors
To avoid having an entire file highlighted, we explicitly narrow the erroneous text range to the first child's one -> UX does not suffer much

GitOrigin-RevId: ef6b849fa1e57d26166415924f583ff6d4269c09
2023-08-01 15:38:21 +00:00
Piotr Tomiak
1d3e210cc4 LexerTestCase: add missing @NotNull annotations to improve interoperability with Kotlin
GitOrigin-RevId: e98b6523585f4659687abca687c8b42618dfd8bc
2023-07-13 10:11:07 +00:00
Sergey Simonchik
ddc91500ef json: support "Sort properties alphabetically" intention when caret is after last symbol
GitOrigin-RevId: d51665f0e1a1cc8f20af8df39525afd48c438869
2023-06-30 19:45:11 +00:00
Alex Bashkatov
6a32b6c8e5 Merge remote-tracking branch 'origin/master' into bashkatov/WEB-53334-jsonc-format-support
# Conflicts:
#	community/json/resources/intellij.json.xml

GitOrigin-RevId: 3a05279ebb0dc6b83b8714e605617a99f71911a2
2023-06-27 16:44:33 +00:00
Alex Bashkatov
635a04ce33 WEB-53334: useless filetype removed; jsonc compliance problems test added
GitOrigin-RevId: c8c46880e28686595db3249c375d0ffb8f89cd00
2023-06-27 16:39:12 +00:00
Alex Bashkatov
62f4e8bf36 WEB-53334: jsonc format support added
GitOrigin-RevId: 0f15f853209a7da0f00a04e2034e18a94c020cbd
2023-06-16 09:39:45 +00:00
Yuriy Artamonov
09003c4c66 [jsonpath] IDEA-321687 Extract JsonPath plugin
GitOrigin-RevId: 322f27fa98def5b2adb4eba0dbbc16be147ebb15
2023-06-11 15:47:57 +00:00
Sergey Simonchik
d6d9b071b6 json: improve finding JSON Schemas from catalog by file relative path (IDEA-317341, IDEA-308234)
GitOrigin-RevId: 7f6a66d7510e10ea372402b25996e3424bfebbb3
2023-04-10 00:42:34 +00:00
Yuriy Artamonov
94db6cfc86 [spelling] Fix flaky tests on spelling of JSON and YAML
GitOrigin-RevId: 444fc73f998c5ed3e2640f8b575b022cd2befa31
2023-03-02 17:40:27 +00:00