Make folded multiline comment show first line - intellij-idea

I have a question regarding IntelliJ's comment folding.
I have the following comment:
/**
* compileNews() converts the text of TextCompiler.soundAlarm() to audio as speech.mp3
*
* #throws Exception
*/
When I fold it, it looks like:
/**...*/
Is there any way that I can get it to fold and show the first line of the comment?
such like:
/**compileNews() converts the text of TextCompiler.soundAlarm() to audio as speech.mp3*/

The text shown as a placeholder for a folded code fragment is controlled by the IDE; it cannot be changed by the user. See https://youtrack.jetbrains.com/issue/IDEA-144788 for a related YouTrack issue.

Related

TestCafe does not write in text input field

I'm using TestCafe for test automation of a web application based on the Wicket framework. I try to type text into a text input field ... well, actually it is a dropdown list, where a text input field appears, so that the user can search for certain codes. The HTML fragment is as follows:
HTML fragment
And here is the corresponding screenshot (text field above "001"):
Text input field with dropdown
The user can type some characters and the list below is automatically filtered (I did this manually):
Text input field with some text
My TestCafe test tries this:
.click( productcodeList )
.expect( productcodeInputField.visible ).ok()
.click( productcodeInputField )
.typeText( productcodeInputField, 'ABW' )
i.e.
Click on the drop down list.
Assume that the text input field is now visible (works fine).
Click on the text input field (this should not be necessary, since typeText() is supposed to do this anyway).
Type the text "ABW" into the text input field ==> This does not work.
I'm sure that my Selector works, since the assertion (expect) is successful and when I debug the test run after the second click (on the text input field), I see the following:
TestCafe screenshot
I.e. the cursor is directly on the text field, but somehow TestCafe cannot write the text into the field.
Some additional information: The Selector for the input field is created as follows:
productcodeInputField = Selector('span').withAttribute('class', /select2-dropdown.*/ ).child('span').withAttribute('class', /select2-search.*/ ).child('input').withAttribute('class', 'select2-search__field' );
More information: I'm using the same logic on the same page:
kurzbezeichnungField = Selector('input').withAttribute('name', /.*aeAbbreviation.*/);
...
await t.click( kurzbezeichnungField )
.typeText( kurzbezeichnungField, 'xxxWWW' )
and this works fine.
Node.js version: v10.16.3
Testcafe version: 1.5.0
This issue looks like a bug. However, I cannot say it precisely without an example that demonstrates the problem.
My team would really appreciate it if you share your project or sample to demonstrate the issue.
Please create a separate issue in the TestCafe github repository using the following template and provide as much additional information as possible.

Birt export in pdf does not wordwrap long lines

My reports preview is ok.
But now, I need to export to pdf...and I've got an issue : the content of some cells are truncated to the witdh of the column.
For instance, 1 cell should display "BASELINE"...in the preview it's ok...but in pdf, it displays "BASEL".
I've been looking for a solution the whole day and did not find anything...
Of course : I don't want to fit the width of the column on the length of this word "BASELINE" because the content is dynamic...
Instead, I want to fix the column width and then, the cell should display something like that :
BASEL
INE
Any idea ?
Thanks in advance (am a little bit desperated...)
The solution is trivial in BIRT v4.9 if you've integrated the engine into your java code. Just set the PDF rendering options.
RenderOption options = new PDFRenderOption();
options.setOutputStream(out);
options.setOutputFormat("pdf");
options.setOption(PDFRenderOption.PDF_WORDBREAK, true);
options.setOption(PDFRenderOption.PDF_TEXT_WRAPPING, true);
task.setRenderOption(options);
You have to set a special PDF emitter option:
PDFRenderOption options = new PDFRenderOption();
options.setOption(PDFRenderOption.PDF_HYPHENATION, true);
This is if you integrated BIRT into your Java program.
For the viewer servlet, it is possible to set such options, too, AFAIK, but I don't know how; maybe on the URL or using environment variables.
I had the same issue. I found a very good topic about that : http://developer.actuate.com/community/forum/index.php?/topic/19827-how-do-i-use-word-wrap-in-report-design/?s=173b4ad992e47395e2c8b9070c2d3cce
This will split the string in the given number of character you want :
The function to add in a functions.js (for example). To let you know, I create some folder in my report project : one for the reports, one for the template, one for the libraries, another for the resources, I added this js file in the resources folder.
/**
* Format a long String to be smaller and be entirely showed
*
*#param longStr
* the String to split
*#param width
* the character number that the string should be
*
*#returns the string splited
*/
function wrap(longStr,width){
length = longStr.length;
if(length <= width)
return longStr;
return (longStr.substring(0, width) + "\n" + wrap(longStr.substring(width, length), width));
}
You will have to add this js file in the reports : in the properties -> Resources -> Javascript files
This is working for me.
Note: you can add this function in your data directly if you need only once...
The disadvantage of this : you will have to specify a max length for your character, you can have blank spaces in the column if you specify a number to small to fill the column.
But, this is the best way I found. Let me know if you find something else and if it's working.

How can I get special characters using elm-html module?

Disclaimer: I'm brand new to Elm
I'm fiddling around with the online Elm editor and I've run into an issue. I can't find a way to get certain special characters (copyright, trademark, etc.) to show up. I tried:
import Html exposing (text)
main =
text "©"
All that showed up was the actual text ©. I also tried to use the unicode character for it \u00A9 but that ended up giving me a syntax error:
(line 1, column 16): unexpected "u" expecting space, "&" or escape code
The only way I found was to actually go to someone's website and copy/paste their copyright symbol into my app:
import Html exposing (text)
main =
text "©"
This works, but I would much rather be able to type these characters out quickly instead of having to hunt down the actual symbols on other websites. Is there a preferred/recommended method of getting non-escaped text when returning HTML in Elm?
Edit:
Specifically for Mac:
option+g gives you ©
option+2 gives you ™
option+r gives you ®
All tested in the online editor and they worked. This still doesn't attack the core issue, but it's just something nice to note for these specific special characters.
Why this is (intentionally) not so easy
The "makers" of Elm are understandably reluctant to give us a way to insert "special" characters into HTML text. Two main reasons:
This would open a "text injection" hole where a malicious user could insert any HTML tags, even JavaScript code, into a Web page. Imagine if you could do that in a forum site like Stack Overflow: you could trick anyone reading your contribution into executing code of your choosing in their browser.
Elm works hard to produce optimal DOM updates. This only works with the content of tags that Elm is aware of, not with text that happens to contain tags. When people insert text containing HTML tags in an Elm program, there end up being parts of the DOM that can't be optimized.
How it's possible anyway
That said, the Elm user community has found a loophole that affords a workaround. For the reasons above, it's not recommended, especially not if your text is non-constant, i.e. comes from a source outside your program. Still, people will be wanting to do this anyway so I'm going to document it to save others the trouble I had digging everything up and getting it working:
If you don't already have it,
import Json.Encode exposing (string)
This is in package elm-lang/core so it should already be in your dependencies.
Similarly,
import Html.Attributes exposing (property)
Finally, create a tag having a property "innerHTML" and a JSON-Value representation of your text, e.g.:
span [ property "innerHTML" (string " ") ] []
I found, that there is a better solution:
you can convert special characters from Unicode to char, and then create a string from char:
resString = String.fromChar (Char.fromCode 187)
You can use directly the unicode escape code in Elm strings and chars:
We have a util module containing all our special chars like:
module Utils.SpecialChars exposing (noBreakSpace)
noBreakSpace : Char
noBreakSpace = '\x00A0'
Which can be used as:
let
emptyLabel = String.fromChar noBreakSpace
in
label []
[ span [ ] [ text emptyLabel ]
]
This will render a <span> </span>
I recently created an Elm package that solves this. If you use text' "©" it'll render the copyright symbol © instead of the escape code. Also works with "©" and "©". Hope this helps!
You don't need to hunt the symbols, you can get them from a list like this one.
If it's too bothersome to copy & paste, you can also create a helper function that you can use with your escaped characters like this:
import Html exposing (..)
import String
htmlDecode str =
let
replace (s1, s2) src= String.join s2 <| String.split s1 src
chrmap =
[ ("®", "®")
, ("©", "©" )
]
in
List.foldl replace str chrmap
main = text <| htmlDecode "hello ©"

How do I configure IntelliJ to insert <p> tags into existing javadoc?

I have configured my Android Studio (IntelliJ) to insert <p> characters on empty new lines in javadoc by checking the check box in Preferences > Code Style > Java > JavaDoc.
However, when I apply my formatter to my existing code base (Code > Reformat Code...), the <p> tags are not inserted.
My question is, how do I get the IDE to apply the formatter successfully for javadoc newline <p> tokens?
If you have JavaDoc like this:
/**
* Text
* <- no tag will be added here
* #author foo
*/
The <p/> tag will not be inserted between Text and #author, because it would serve no purpose there. The tags will only be inserted between lines of the description (the first part of the JavaDoc):
/**
* Text 1
* <- <p/> will be inserted on this line after reformat
* Text 2
* <- no tag will be inserted here
* #author foo
*/
I'm not certain if this is the problem you're experiencing. Let me know in the comments if it works for you with multiline description as in the second example or if it doesn't work at all.

Doxygen Alias to Ignore Line

In an effort to adapt a company-wide header format to doxygen, I would like to create some custom tags that will be ignored by doxygen. I think I can do this with an alias, but so far have only been able to replace tags with others. What I am trying to accomplish:
/**
* #company Company Name
**/
with an alias like #company="". Unfortunately, this just prints the text with no section name.
Any ideas?
You could use HTML style comments to hide parts, i.e.
/** Show this <!-- but hide this --> and show this again */
Or you could use #if...#endif
/** Show this #if VISIBILE but hide this #endif and show this again */
To save typing you could define a pair of aliases
ALIASES = hide="#if VISIBLE" endhide="#endif"
and then write
/** Show this #hide but hide this #endhide and show this again */