FlashDevelop code completion AIR API - api

I haven't used FlashDevelop in half a year, and on returning (and updating it) the code completion no longer functions properly. I'm not entirely sure, but I think the code completion doesn't know the AIR library.
When pressing "Ctrl+Space" after typing "import" will only show me the classes I have already imported.
Pressing "Ctrl+Space" after typing "import f" or "import flash." returns no suggestions.
If I type of the import by hand, the class will successfully compile though.
I have updated Flex, FlashDevelop, the debugger
Code completion is activated
I have set Compiler Options >> SWC Included Libraries to "Flex 4.6\frameworks\libs\player\11.1\playerglobal.swc"
searched google and stack overflow for a solution
I have tried shang's suggestions (this & this too)
and I'm out of ideas.
any help would be greatly appreciated.
Jake

Ctrl+Alt+Space will show all the classes included in the classpath. Select an entry and it will generate the import statement.

Related

Intellisense - deduce right Class by its methods

I'm used to work with NetBeans and now I'm trying IntelliJ. So my question is: Does IntelliJ has a way to get right class by its methods?
For example, in NetBeans if I write:
glGenBu // Intellisense will kick in and will suggest me
to use GL15.glGenBuffers() method from GL15 class
This will automatically import the right library.
This is very handy because I'm working with LWJGL and it has a bad way to manage OpenGL methods ('GLXX' where XX is the version of OpenGL and all methods that appeared in that version are stored in that class) and I never remember the right class where my desired method is.
Thank you.
Pressing Ctrl+Space when you already see completion list will show more suggestions, with static methods from the entire project among them. See https://www.jetbrains.com/help/idea/auto-completing-code.html for more details.

Bug in importing project code classes in android studio 3.0

So, say I have this code,
And then, normally, if I want to import that class, i just hover on the red-coded code (in this case MenuType), and press Alt+Enter. But, annoyingly, instead of importing the class, it turns into this:
And it's error.
To make it work, I need to manually insert the supposed-to-be-imported package into the import section, and it works normally. It's workable, but kinda annoying.
This however, work normally with non-project code (classes in dependencies, etc)
Anyone knows what caused this and how to fix it? Maybe it's because of Kotlin?
P.S. I think I didn't find this kind of bug in Android Studio prior to 3.0

Xcode cannot find ProductModuleName-Swift.h

I'm attempting to import my "-Swift.h" file into one of my Objective-C .h files but xcode keeps telling me that the file doesn't exist
#import "Aesculus-Swift.h"
If I command click on the file name it will take me to the generated header file so I know it exists. Why is xcode not able to find it?
This seems like just another issue with Xcode and it's complex tool chain of static analysers and compilers.
Openradar lists radar://21362856 - Swift to Objective-C bridging is unreliable. I am sure there are more but I stopped looking after finding one for this example.
The author imarcelv notes in the description:
I asked a Swift engineer at WWDC in a lab and even he didn't know how to fix this issue.
Steps to Reproduce:
Add a ramdom Swift class to an Objective-C project
Add the #import "ModuleName-Swift.h" file that Xcode generates automatically
Try to use it or just try to compile the project
From time to time it simply doesn't work
It's probably best to file a radar on this issue as it seems that others are already calling it out.
One other thing you could try...
Historically, it was possible for Xcode to completely lose it's syntax highlighting and you could always find out what files the static analyser was giving up on by increasing log level of clang.
I'm not sure if it's still relevant but if I was in your position I'd be trying this command:
defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3
This generates logs you can search with using Console.app for just xcode to highlight the messages. You'll want to trash the derived data of your project to force it to re-compile things.
Although not the same issue as what you're seeing, I have had this post on the syntax highlighting issue bookmarked for years for the above defaults write command to try in times like these.
I solved this recently by adding the following entry to my .xcconfig (you could add it in Xcode's Build Settings > User Header Search Paths if you prefer).
USER_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/MyFramework.framework/Headers
This tells the compiler to search for headers in the build output directory, which is where Xcode puts the generated header (at least in the case of this framework).
In my case this is a directory like ~/Library/Developer/Xcode/DerivedData/MyProject-LongCode/Build/Products/Debug-iphonesimulator/MyFramework.framework/Headers/MyFramework. You might find your generated header in there too.
Xcode's header and dependency management is a hot mess, and it's not surprising that it doesn't work for you.
I had trouble with this stuff & found that your -Swift file is the Product name of your Target ( not just the name of your Target ) . I found the details here helpful: http://ericasadun.com/2014/08/21/swift-calling-swift-functions-from-objective-c/
When you encounter such situation, just find your kinda "ProductName-Swift.h" file by just cmnd+click on it (even if xcode shows warning about it is not found, the #import "Aesculus-Swift.h" string is still clickable) and then in opened code editor window choose context menu and "Show in Finder" item, then explicitly add it to your project.

Import UIKit for debugging Objective-C by default

Whenever I try to read the frame of an UIView for example while debugging, I get this error:
error: property 'frame not found on object of type 'UIView *'
error: 1 errors parsing expression
After searching for a solution, I found out that I can use this command to solve this without adding (annoying and in some cases complicated) casts:
expr #import UIKit;
But I still find it annoying to have to do this every time (why doesn't Xcode do this by default?!), so I thought I should be able to do this using the .lldbinit file, but I couldn't get it to work.
I don't know much about that file, I have this in it atm:
command script import /usr/local/opt/chisel/libexec/fblldb.py
so I tried adding the UIKit import command at the end of the file but it didn't look that it worked. I also tried prefixing it with command to no avail. Is this possible or not? (please say yes; it will save my life)
lldb will auto-import modules that the debug info tells us the program imports fairly soon now. All the pieces weren't in place to do that for the first Xcode 7 releases.
Statements in the .lldbinit get run before the main file is read in, it is supposed to help set up the environment to read in your program. But at that point there's nothing into which to import these symbols. You need to do it after the main binary is read in (and you really need to do it after you have run, since I think we need to run some code to do this.)
At present, the simplest way to do this is to make an auto-continue breakpoint at main, and attach the expr #import UIKit statement as a debugger command in that breakpoint. You'll have to do this once per new project you make, but if you're working on the same project for a while, it's not such an inconvenient workaround.

Removing a method call from inside a static lib(.a) without recompiling

I'm using a static lib thats giving me a warning when uploading my binary for review by apple.
The method in the static lib that causes the warning(non-public selectors) is never called by me, its corresponding .h is deleted from my proj, but warning still persists.
Given that I know the method name causing the problem, is there a way for me to open/edit this .a and comment/delete the offending piece of code and then use the modified .a in my project.
I don't have access to the .a source to recompile it, and its very old and the creator of it has no contact details for me to track down.
Many Thanks,
-Cake
Quick and dirty solution: Open the .a file in a hex editor and change all instances of the name. Leave the function name the same length so that offsets in the file don't change, just change a letter or something like that. I did a quick test, adding a dummy function to a subproject we're building as a static library then tweaking the function name in the .a file (there were five instances, for what that's worth) and everything built okay. I don't see any reason it wouldn't pass the App Store check after that.
I'm really surprised the function was still there in the final build, though—I thought Dead Code Stripping was supposed to clean out any unused code. Huh.
http://opensource.apple.com/source/cctools/cctools-809/
I don't presume to get your bounty, because I haven't provided an easy solution. But yes, it in theory is possible. You have your work cut out for you.
There are several solutions, depending on your lib and project.
In your build settings :
Enable "dead code stripping" if possible : If the method is never used (even internally), the symbol will be deleted.
Use "Unexported symbol file" : Simply add the symbol into a file and it will be removed from the binary. This will work even if the symbol is used internally.
Enable "Deployment Postprocessing" and "Strip Linked Product" with "Strip Style" set to "All symbol"
(Not sure) Use "Symbols Hidden by Default". This is related to the code generation and should not affect linking, but just in case everything above failed...
No need to hack the binary files. Just turn off the compiler's "unused selectors" warning: -fno-unused-selectors.