Skip to content

feat(queries): add multi-line queries support #33

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yoyossef
Copy link

Should close #12

Features some refactoring to support this feature, to remove the
dependency of compiling a complex reg-exp I preferred keeping the
output of the findQueries function untransformed, so we can use that
string to find and replace the query with the serialized query.

It adds a boolean to check if we are capturing a multi-line query or not, and
some logic to complete the feature.

I've tested both multi-line and single-line queries to ensure that I did
not break basic functionality.

As a new user I would appreciate further regression tests if there are some to fix.

Features some refactoring to support this feature, to remove the
dependency of compiling a complex reg-exp I preferred keeping the
output of the findQueries function untransformed, so we can use that
string to find and replace the query with the serialized query.

It adds a boolean to check if we are capturing a multi-line query or not, and
some logic to complete the feature.

I've tested both multi-line and single-line queries to ensure that I did
not break basic functionality.
Reflects some of the changes on the refactoring done, as well as simply
demonstrating an example of a multi-line query.
Plumbs the code a bit to avoid duplicate queries detection issues.

I was encountering duplicate serialized queries, so I am trying this
method to make it more robust, the hash is done on the trimmed version
of the query. I have not encountered issues since this change.
Everytime I would update a document that has the Dataview serialization
queries, it would insert an additional newline at the end of the
serialization.

If you do the modification several times, the document would create a
lot of useless newlines, so I just suggest to remove it and keep the
document clean.
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.

Add support for multi-line queries
1 participant