Skip to content

Completion of if/then patterns for every if nested in blocks #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

diyaayay
Copy link
Collaborator

@diyaayay diyaayay commented Jun 1, 2024

Resolves #12

using currentProperty does not for now recognize "if" in nested blocks. So, the current approach could be changed accordingly which identifies "if" at all positions.

image
WhatsApp Image 2024-06-01 at 15 01 59_645d4a0f

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The completion.js file is going to get huge as we add more and more completions. Is there a way we can separate the $schema completion and the if completion? I think we should be able to do something similar to what we're doing for diagnostics using the pubsub pattern.

@diyaayay
Copy link
Collaborator Author

diyaayay commented Jun 5, 2024

The completion.js file is going to get huge as we add more and more completions. Is there a way we can separate the $schema completion and the if completion? I think we should be able to do something similar to what we're doing for diagnostics using the pubsub pattern.

Right, I've tried to do it the way diagnostics are handled in deprecated.js and validation-errors.js

@jdesrosiers jdesrosiers force-pushed the completion-of-if/then-patterns branch 2 times, most recently from 0a7e190 to 1026f9c Compare June 8, 2024 02:44
@jdesrosiers
Copy link
Collaborator

That force-push was just me rebasing on top of the refactor that I just pushed. The only change was the usage of findNodeByOffset.

@jdesrosiers jdesrosiers force-pushed the completion-of-if/then-patterns branch from 1026f9c to 2ad1588 Compare June 8, 2024 03:19
@jdesrosiers
Copy link
Collaborator

I rebased to get dependency updates to and get the change from hyperjump-io/json-schema#65

At this point I think we just need to remove the comments and get the indentation/formatting of the completion string to look right.

@jdesrosiers
Copy link
Collaborator

I found the Snippet Syntax that allows us to define tab completion functionality for this snippet.

@jdesrosiers
Copy link
Collaborator

I removed the true/false completion options. That kind of completion option applies for any location that accepts a schema, so I'd like to address that separately.

@diyaayay
Copy link
Collaborator Author

diyaayay commented Jun 9, 2024

I removed the true/false completion options. That kind of completion option applies for any location that accepts a schema, so I'd like to address that separately.

Right, makes more sense. I should've kept that in mind.

@jdesrosiers jdesrosiers merged commit 10c4d40 into hyperjump-io:main Jun 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server - Completion for if/then patterns
2 participants