Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Formatter "messing up" indention on cut/paste, on newline? #42
I don't know if this is a bug or not, but it seems that many times when I cut and paste XQuery code to various places the format of the XQuery is lost. Here is a simple example:
xquery version "3.0"; let $test as xs:string := "test" return ( fn:concat( "this ", "is ", "a ", $test ) )
If I type a comma after the closing ")" for the fn:concat() function and hit the return key then the cursor moves to beginning of the line on the new line instead of being indented to match the current indentation.
When I cut and paste this over itself (or anywhere else) then the "fn:concat(" and the closing ")" for that function lose their indentation. I had a whole block of XQuery I pasted somewhere and had to re-indent it all (not your fault, that is what I get for using the working version).
There are some cases where I move the the cursor to the new line and it adds another indentation level when you wouldn't think it should. I will try to reproduce it and create another issue if I can.
Thanks for raising this issue. I'm still trying to find out a good resource on xquery code style (I'll probably try to make formatter rules to resemble http://xqdoc.org/xquery-style.pdf in the future).
Have you got any suggestions around formatting style or a good resources?
I have usually used that document you mention for code style. Here is one by Micah Dubinko: http://developer.marklogic.com/blog/xquery-coding-guidelines. Those two are the main ones I have seen.