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

FLWOR formatting issues while typing #74

Closed
malteseduck opened this Issue Nov 14, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@malteseduck
Contributor

malteseduck commented Nov 14, 2013

Some interesting behavior in the formatting while I am typing out FLWOR statements that are nested in indented constructs, but only while typing. If I run "Reformat Code..." then the formatter usually will format the code as I would expect. For example, this (correctly formatted):

(
    xdmp:current-dateTime(),
    for $i in (1 to 10)
    return
        $i
)

comes out like this while I am typing it:

(
    xdmp:current-dateTime(),
    for $i in (1 to 10)
        let $i := $i + 1
        return 
        $i
)

as I type it. Here is a different construct, but very similar. When I type it looks like this:

let $loop :=
for $i in (1 to 10)
let $i := $i + 1
return $i
return ()

After running the formatter it looks like this:

let $loop :=
    for $i in (1 to 10)
    let $i := $i + 1
    return
        $i
return ()

Another:

<element>
    <numbers>
        <number>{
            for $i in (1 to 10)
let $i := $i + 1
return
                $i            
        }</number>
    </numbers>
</element>

After running formatter:

<element>
    <numbers>
        <number>{
            for $i in (1 to 10)
            let $i := $i + 1
            return
                $i
        }</number>
    </numbers>
</element>

So it is nice that it formats correctly when explicitly running the formatter. It is disruptive when working on deeply nested structures to have my cursor jump all the way to the left when I hit the enter key while editing a FLWOR statement, though.

Anyway, thanks for writing this wonderful plugin. This kind of stuff is just the nit-picky stuff, but thank you for always resolving these issues.

@ligasgr

This comment has been minimized.

Show comment
Hide comment
@ligasgr

ligasgr Nov 14, 2013

Owner

Hi,

Thanks for raising the issue. Maybe it's not very serious issue but I know it can be very annoying.
I'll try fixing it in the nearest release. Thanks for very good test cases!

Owner

ligasgr commented Nov 14, 2013

Hi,

Thanks for raising the issue. Maybe it's not very serious issue but I know it can be very annoying.
I'll try fixing it in the nearest release. Thanks for very good test cases!

@ligasgr

This comment has been minimized.

Show comment
Hide comment
@ligasgr

ligasgr Nov 23, 2013

Owner

I believe I was able to fix these issues + some other ones. Please reopen if anything doesn't work as expected or if there are very similar cases which I've missed.
It's going to take some time before the release is ready so in the meanwhile you should be able to download and install (install plugin from disk) current version from master.
It's available under this link:
https://ligasgr.ci.cloudbees.com/job/intellij-xquery-master-prepare-distribution/ws/build/distributions/intellij-xquery.zip

Owner

ligasgr commented Nov 23, 2013

I believe I was able to fix these issues + some other ones. Please reopen if anything doesn't work as expected or if there are very similar cases which I've missed.
It's going to take some time before the release is ready so in the meanwhile you should be able to download and install (install plugin from disk) current version from master.
It's available under this link:
https://ligasgr.ci.cloudbees.com/job/intellij-xquery-master-prepare-distribution/ws/build/distributions/intellij-xquery.zip

@malteseduck

This comment has been minimized.

Show comment
Hide comment
@malteseduck

malteseduck Nov 26, 2013

Contributor

That is wonderful, thank you. I will give it a try.

From: ligasgr [mailto:notifications@github.com]
Sent: Friday, November 22, 2013 6:23 PM
To: ligasgr/intellij-xquery
Cc: Chris Cieslinski
Subject: Re: [intellij-xquery] FLWOR formatting issues while typing (#74)

I believe I was able to fix these issues + some other ones. Please reopen if anything doesn't work as expected or if there are very similar cases which I've missed.
It's going to take some time before the release is ready so in the meanwhile you should be able to download and install (install plugin from disk) current version from master.
It's available under this link:
https://ligasgr.ci.cloudbees.com/job/intellij-xquery-master-prepare-distribution/ws/build/distributions/intellij-xquery.zip


Reply to this email directly or view it on GitHub #74 (comment) .

Contributor

malteseduck commented Nov 26, 2013

That is wonderful, thank you. I will give it a try.

From: ligasgr [mailto:notifications@github.com]
Sent: Friday, November 22, 2013 6:23 PM
To: ligasgr/intellij-xquery
Cc: Chris Cieslinski
Subject: Re: [intellij-xquery] FLWOR formatting issues while typing (#74)

I believe I was able to fix these issues + some other ones. Please reopen if anything doesn't work as expected or if there are very similar cases which I've missed.
It's going to take some time before the release is ready so in the meanwhile you should be able to download and install (install plugin from disk) current version from master.
It's available under this link:
https://ligasgr.ci.cloudbees.com/job/intellij-xquery-master-prepare-distribution/ws/build/distributions/intellij-xquery.zip


Reply to this email directly or view it on GitHub #74 (comment) .

@malteseduck

This comment has been minimized.

Show comment
Hide comment
@malteseduck

malteseduck Dec 4, 2013

Contributor

It works wonderfully. It seems to work like I would expect for all those cases. I will continue to use it and let you know if any other cases pop up.

Thanks again.

Contributor

malteseduck commented Dec 4, 2013

It works wonderfully. It seems to work like I would expect for all those cases. I will continue to use it and let you know if any other cases pop up.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment