I want to improve my work productivity with Rubymine (Jetbrains) by adding autocomplete to most common words:
like if I type b and enter , it will auto populate Byebug, for Example.
Not sure I've got what you mean by 'most common words'... there is a 'hippie completion' feature (Alt+slash) that allows completing words already entered in file.
Yopu can also use Live Templates to expand certain abbreviations into words
Related
SUMMARY:
I need the most efficient workflow to individually edit over 200 files, and have them automatically disappear from the search results as they are updated.
DETAILS:
I am in the process of adding logging throughout a legacy system, and need to update over 200 files, each with their own custom code. I need to edit them one by one, and would like for the updated files to automatically disappear from my working search results after I have completed each one. The idea is to know how many and which ones still need to be updated as I slowly work through them all.
I already had to do something similar a few months ago, but on a much smaller scale, and I used an old-school HACK to do it. I did a search and replace for my keyword, and intentionally misspelled it. I then used the misspelled keyword for my search, and corrected it when editing each file, hence automatically removing it from the list. It "works", but is obviously a TOTAL HACK.
I recently started using IntelliJ IDEA, and am not yet familiar with the more advanced features like Find in File Scopes, Search Structurally, Search Templates, etc., but I am sure there HAS to be a "correct" way to do this in IntelliJ, and I just don't know how.
I am currently using "Find in Files" to work through the list, and recently found "All Changed Files" in the Scope list, which is actually the EXACT OPPOSITE of what I need. Is there a way to show "All UNCHANGED Files"??? That would work PERFECTLY in a pinch! But really, I would rather learn the CORRECT way to do this in IntelliJ.
Thanks!
I'm trying to create a "dynamic" Live Template for PyCharm and am hitting a road block (I'm able to create simple templates with variable insertion, no problem). I'm beginning to believe that what I'm trying to accomplish may not be possible. I'm not tied to Groovy Script, but it looks to be the most promising alternative to what I'm trying to accomplish. I'm not able to provide a minimal, reproducible example beyond a simple description. Here's what I'm trying to accomplish:
Whatever is typed after hitting TAB and before hitting Enter is passed to the template, formatted and written back to the Editor. My goal is to have the resulting string be a specified length, but that's less important for the time being. It's really more about how to get keyboard input to the template and back out again.
For example:
"blk" TAB "Hello world" Enter becomes # ==================== Hello world ====================
Is this possible with Live Templates?
EDIT: To be clear, the question here is on how to reformat the typed input and return the formatted input to the output of the template. For example, using the above -- have the resulting "Hello world" line always be 80 characters long.
EDIT2: converting previous comment to an answer to close the loop on this question. Happy to reopen if new information comes to light.
Yes, it should be possible with such a template:
# ==================== $MY_TEXT$ ====================
Where $MY_TEXT$ is just an empty custom user template variable.
I have confirmed with Jet Brains that the thing I'm specifically trying to accomplish--dynamically formatting typed input to a live template--is not possible within the current IDE (as of version 2020.3).
Instead, they suggest it will require a custom plugin with specific features related to com.intellij.codeInsight.template.postfix.templates.PostfixTemplate.
A few years back i worked in a company where i could press CTRL+T and a TODO-comment was generated - say my ID to be identified by other developers was xy45 then the generated comment was:
//TODO (xy45):
Is something available from within Intellij 14 Ultimate or did they write their own plugin for it?
What i tried: Webreserach, Jetbrais documentations - it looks like its not possible out of the box (i however ask before i write a plugin for it) or masked by the various search results regarding the TODO-view (due to bad research skills of mine).
There is no built-in feature in IntelliJ IDEA to generate such comments, so it looks like they did write their own plugin.
Found something that works quite similar but is not boundable to a shortcut:
File -> Settings -> Live Templates
I guess the picture says enoth to allow customization (consult the Jetbrains documentation for more possibilities). E.g. browse to the Live Template section within the settings, add a new Live Template (small green cross, upper right corner in the above picture) and set the context where this Live Template is applicable.
Note: Once you defined the Live Template to be applicable within Java (...Change in the above image where the red exclamation marks are shown) context you can just type "t", "todo" and hit CTRL+Space (or the shortcut you defined for code completion).
I suggest to reconsider using that practice at all. Generally you should not include redundant information which is easily and more reliably accessible through your Version Control System (easily available in Idea directly in editor using Annotate feature). It is similiar to not using javadoc tag #author as the information provided with it is often outdated inaccurate and redundant. Additionaly, I don´t think author of TODO is that much valuable information. Person who will solve the issue will often be completly different person and the TODO should be well documented and descriptive anyway. When you find your own old TODO, which is poorly documented, you often don't remember all the required information even if you were the author.
However, instead of adding author's name, a good practice is to create a task in you issue management system and add identifier of this task to the description of the todo. This way you have all your todos in evidence at one place, you can add additional information to the task, track progress, assign it etc. My experience is that if you don´t use this, todos tend to stay in the code forever and after some time no one remembers clearly the details of the problem. Additionaly, author mentioned in the todo is often already gone working for a different company.
Annotated TODO with issue ID
I use Vimperator, but one thing I struggle with is being able to efficiently select and navigate a link that has (or is) just a number. This happens quite a lot in various generated web pages use where the links are numerical or are dates.
Using just f to enter hints mode doesn't work, as typing a number will naturally send you to that hint.
I’m not very familiar with Vimperator, but in its fork and further development – Pentadactyl, you can use backslash to make following digits be treated as link inner text, not number. I. e. use f\21 to narrow the search to the links with text starting from / contains¹ 21.
¹ Depending on your preferences, 'hintmatching' option to be precise.
I want to check whether a possibly mandatory field is filled in using selenium. I would very much prefer to do this using the IDE rather than exporting to code.
To be more specific, I want to make sure that a post code field is filled in if the value of the country drop down list is 'United Kingdom'. The post code field can be left blank if the drop down list is set to anything else.
If the consensus is that I have to export and do the test in code, then I will, but I would be a lot happier if I could sort this out just through the IDE.
Unfortunately, Selenium-IDE does not offer any flow control functionality by default. However, the Flow Control plugin introduces a few new commands - while, gotoIf, label and the ...andWait variants. Using these, you should be able to check the currently selected value in the dropdown menu, and jump past a verify command if the value is not "United Kingdom".
Fair warning; it's not the easiest thing in the world to work with. For anything beyond very basic flow control, you'd probably be better off exporting to code anyway. But, it's an option for when you really want to push the IDE!