This question already has answers here:
IDEA: How to suppress warnings for spelling typos?
(7 answers)
Closed 3 months ago.
I have this Kotlin code in IntelliJ IDEA 2021.2.3 (Community Edition)
Build #IC-212.5457.46, built on October 12, 2021:
// noinspection SpellCheckingInspection
#SuppressWarnings("SpellCheckingInspection")
private const val API_KEY = "aabbcc123" // noinspection SpellCheckingInspection
Clearly, "aabbcc" is not in any dictionary, so IntelliJ flags it as a typo. I generally want to keep spellcheck, I just want to disable it for that particular line. I don't want to add "aabbcc" to the dictionary as it would be a typo elsewhere.
After a web search, I tried the comments and annotation above, but IntelliJ still flags the typo.
When I hit Alt+Enter on the typo, it only offers to add it to the dictionary, but it doesn't offer to ignore this instance.
How can I disable spell check per source line?
According to this answer it sounds like this may not be possible. Your only option may be to add the word to your dictionary.
Related
This question already has an answer here:
pycharm does not warn for unused variables and import
(1 answer)
Closed 2 months ago.
I have a huge selenium project which we update on a day to day basis. Sometimes we miss to remove locators which are no longer in use. Is there any way to do it?
Most IDE providing this feature.
For example PyCharm IDE indicates unused stuff as following:
IntelliJ IDE provides the following usage indications:
I believe all the modern IDE tools providing such indications.
Going off the documentation here are Modules and other Geb DSL not expected to be recognized within a Spock Spec with IntelliJ? This makes using Geb with IntelliJ a bit cumbersome with no DSL reference. I noticed from this question that the asker did some custom work to get IntelliJ to wrap and notice the Geb DSL.
My questions is am I doing something wrong or is this expected and has there been any progress on getting the Geb DSL recognized by IntelliJ?
If not does anyone have a workaround for this issue/limitation and or another IDE that does recognized the Geb DSL?
IntelliJ has support for Geb DSL, I've been using it for years and there are even tests in IntelliJ's codebase that confirm it's there.
If you could share how your code looks like and what exactly does not work for you then maybe we can find a problem with your setup or expectations. It would also be good to know whether you are using community edition or professional edition.
Please note that the issue discussed in the question you linked to has been fixed by me in this PR and is no longer present since IntelliJ 2018.2.
EDIT:
After reading your comments under my response I now understand what the problem is. Your expectation is that IntelliJ will be able to figure out what the page type at runtime is and provide you with autocompletion. I'm afraid that is simply not possible - you need to track current page instance in your code for IntelliJ to be able to infer types.
Note that tests in geb-example-gradle are written in the very concise, yet dynamic style which means that IntelliJ is not able to infer types. What you need to do is to use the strongly typed style as described in the documentation. That section of the docs could do with a bit of improvement because it's not precise - I've created a Github issue to track that.
Essentially, if you tweak GebishOrgSpec from geb-example-gradle to:
class GebishOrgSpec extends GebSpec {
def "can get to the current Book of Geb"() {
when:
def homePage = to GebishOrgHomePage
and:
homePage.manualsMenu.open()
then:
homePage.manualsMenu.links[0].text().startsWith("current")
when:
homePage.manualsMenu.links[0].click()
then:
at TheBookOfGebPage
}
}
then IntelliJ will provide you with autocompletion.
I would like to use IntelliJ's feature, which converts Java code to Kotlin by simply copy-pasting from Java file to Kotlin file. It is working fine, but when I turn on IdeaVim plugin, it refuses to work anymore. I know Vim decently and I that's not the problem with my misunderstanding Vim edit modes. I am aware of How can I convert a part of Java source file to Kotlin? and answer by #yole saying that there is no other tool to do that.
But that answer was made over 3 months ago, and maybe some other tool appeared. So, my question is if someone found workaround to make IdeaVim plugin cooperate with Java to Kotlin conversion. I've already made a ticket on YouTrack: https://youtrack.jetbrains.com/issue/VIM-1103 but frankly, I am not so sure if it will be resolved.
Ok, guy from JetBrains answered my issue. The obvious workaround (which I didn't figure out) is to copy and paste from context menu. Then conversion question shows up. IMO it seems unlikely that IdeaVim plugin will support this feature by yanking and putting (Vim's copying and pasting), as from:
Running IDE actions on copy and paste might be a good idea, but we're not sure it wouldn't disrupt the workflow of the current users.
The vim plugin takes over the clipboard and past functions. When you type :actionlist you get a list of idea actions you can use in your .ideavimrc file to map keymaps to idea actions. Use :action COMMAND to execute the command.
I.e.:
norepmap <C-w>q :action VimWindowClose<cr>
closes the current window.
Furthermore, you can search for a particular action with :actionlist Past.
This lists
EditorPast <C-V> <S-ins>
among other things.
If you want to check if EditorPast ist the right command you can test it using :action EditorPaste.
Another way to make this work is to let idea handle the <C-v> shortcut. This can be archieved with the Settings -> Other Setting -> Vim Emulation settings. The handler (vim or idea) can be defined with that setting.
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
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
In Xcode (3.2 on Snow Leopard) when I start to type out a function such as
-(void)myFunctionName {
}
When I first start typing the code hint is
-(voidPtr
What is the difference between void and voidPtr? I assume that voidPtr is a pointer of some kind, what cases call for its use? Do I want to be using voidPtr instead of void?
Can I change a preference in the editor that will default to void and then I can type P and tab complete to voidPtr if I want?
Is there a general way to configure or prioritize code hints so that common hints show up before more obscure code hints?
Can I create code hint shortcuts? Where I type a couple of characters and a command to expand common boilerplate code?
What are some recommended practice tutorials for getting really productive in Xcode editing?
Update: Based on Darren's suggestion it looks like voidPtr comes from
CarbonCore/Threads.h
...
/*
The following ProcPtrs cannot be interchanged with UniversalProcPtrs because
of differences between 680x0 and PowerPC runtime architectures with regard to
the implementation of the Thread Manager.
*/
typedef void * voidPtr;
I am running Xcode on a fresh vanilla install of Snow Leopard. And I have not done anything exotic with my projects. Just starting some very basic tutorials on Xcode and Objective C. Any experienced Objective C folks have useful background info here?
Update: This was a bug in older versions of Xcode. Bug #7256749 has been fixed. I just tried with the newest version of Xcode, and everything is roses.
Historical Info: (for Xcode versions prior to the release of Xcode 4.0)
If you start typing a C-style function declaration:
void SomeFunc(...
Then "void" will appear as the first suggestion. Xcode's code sense applies different rules depending on the surrounding syntax, and when you are creating an Objective-C function declaration, it appears to exclude all of the built in types, including void.
I have filed a bug with Apple (via bugreport.apple.com), and I recommend that you do the same. Apple prioritizes their software fixes (at least partially) based on the number of duplicate reports that they see for a given problem.
Note: Here is the full text of the bug report submitted to Apple:
Summary:
Xcode's code sense provides a list of suggested matches as you type. This list is filtered depending on context. When typing an Objective-C method declaration, the built-in types (void, int, float, etc.) are filtered out. Numeric types such as int and float may be intentionally missing in order to encourage the use of NSInteger or NSNumber, but the void type is still used all the time, and should really appear in the list of suggestions.
Steps to Reproduce:
1. Open Xcode
2. Create a new project with the Cocoa Application template
3. Open the application delegate header file
4. Begin creating a method declaration with a void return type:
- (vo
5. Press escape to bring up the complete list of suggested completions
Expected Results:
I would expect to see "void" at the top level of the suggestion list, and I would expect it to be highlighted as the most likely choice.
Actual Results:
The list does not even contain "void", and the selected candidate is "voidPtr", which is declared in CarbonCore/Threads.h
Regression:
Unknown, but it definitely happens in the latest build of Xcode (3.2 (1610)) on Mac OS X10.6
Notes:
See discussion on StackOverflow.com (Xcode editor default to -(void) instead of -(voidPtr)?)
voidPtr isn't a standard Objective-C or Cocoa type. XCode is likely presenting voidPtr because it found that symbol somewhere in your project.
You can select "File > Open Quickly" (⌘⇧D) from the menu and type voidPtr to see where that symbol is defined. You can also do the same by holding down the Command key and double-clicking a symbol in your source code.