I'm using Sublime and "ImportHelper", and my OS is Linux, and my Sublime version is 3.
I read in the documentation that there's a way to removed unused imports pressing Alt + U.
I tried this but it doesn't work. The unused imports are not removed from the .ts file. How can I can fix this problem?
From the documentation, the keyboard shortcut to remove unused imports is AltI, AltU. That means you hit AltI, release, then hit AltU. The command should also be available from the Command Palette (CtrlShiftP).
Related
I opened a folder in Android Studio which contains a Kotlin script file (.kts). I configured a JDK as SDK in Project Structure (but I added no gradle files), and running the file as Kotlin script works fine. However the syntax highlighting is only PARTIALLY working, see below example (Linux Mint 19.3 and AS 4.1.3):
Some of the stuff missing:
unused variable should be gray (val unused)
to/forEach keyword should be yellow and italic
misspelled variable names should be red
bad style such as extra spaces should be underlined
etc.
What's even going on here? Is this some sort of "fallback" mode?
Any way to use the "full" syntax highlighting from normal Android projects, so I can spot mistakes earlier?
For reference, this is what it "should" look like (pasted into a random Android project):
Renaming the file to end in *.main.kts (scriptname.main.kts) enabled full highlighting for me!
I get this type of issues from time to time with IntelliJ IDEA. I haven't found the reason why it happens, neither do I know the 100% working solution. But here are the options that usually help me solve it:
Restart IDE
Invalidating caches: File > Invalidate Caches...
Re-import the project. Remove the .idea folder and the project.iml file and try to import the project again.
Update the IDE. Last time I had this issue, nothing helped but updating IDEA to 2021.1.
I hope some of these options will help.
I use SublimeText3 on macOS for writing my code. I would like to run/build a code up to the current line where cursor is situated.
Is there a shortcut key to do that?
A shortcut key to select all lines from the beginning to the current line will also help. I can use that followed by key binding for build.
Although the example given below is short, I intend to use it in a script containing many lines of code.
Example .py script:
print("a")
print("b") #keep cursor here and use key board shortcut to run all lines of code up to this line.
print("c")
Sublime Text has no built in debugger so there is no run-to-cursor feature.
There are various debugging plugins that can be installed using Package Control. Among these there are Python Debugger which may be of use to you since you refer to Python in your post and Sublime Debugger which attempts to match Visual Studio Code's Debugger fairly closely.
Until recently I was able to use keymaps such as Ctrl+Right to move the caret to the next word in my Bash Terminals embedded in GoLand on Ubuntu 18.04. I'm not sure what has changed but these no longer work. Now if I try to use the example shortcut it just types C. What settings do I need to change to get this to work? I have tried this with both "Tools>Terminal>Override IDE shortcuts" checked and unchecked.
Turns out this was not an IDE issue. Whilst trying to add support for using Ctrl + Backspace for deleting words, I had created a ~/.inputrc file which was overriding my /etc/inputrc file. Deleting this file fixed the problem.
I'm creating a new project in Android Studio. I'm used to development in Eclipse, and I can simply hover on symbols that are not resolved and I'm able to import the dependencies. Now when I hover on the symbols, I'm simply informed "Cannot resolve symbol X" with no option to import the dependency, even for simple ones like TextView. How do I auto resolve/import these symbols?
Thanks.
One way is to place the cursor anywhere inside a class name (either by clicking with the mouse or moving the cursor with the arrow keys) then press Alt-Enter or right click. Usually the first option will be to import the class. You can also press Ctrl-Alt-O to optimize imports. I know this will remove unused imports and I think it will add missing imports.
I'm new to Sublime Text and am using the latest beta version Build 3047.
I installed VintageEx via Package Control, and also enabled Vintage. However, the command-line mode cannot be triggered after pressing the : key. I suspect it might be the key binding issue, but I've no idea of what to do with it.
Does anyone know how to solve this?
Here are the Sublime Text 3 compatible packages: https://github.com/wbond/sublime_package_control/wiki/Sublime-Text-3-Compatible-Packages
Try using Vintageous instead of VintageEx.