How to add an underscore mixin library to WebStorm? - intellij-idea

In my work, we have a file with utilities functions that are extended in _.mixin() function at runtime. No, I cannot change the framework, because the solution would be to separate those function from _.mixin() and make them and indepent module, that would be the best.
Either way, my problem is that I cannot link this file, with all the extended functions in WebStorm, so I always see Unresolved function or method warning
Yes I have tried to add the file in the Library tab under Libraries & Framework preferences. And it did nothing.
So my question is, It is possible to WebStorm (or other Atlassian software) to link a file with several functions that will be extended with Underscore.js _.mixin() function to show up in Autocomplete?
Thanks, in advance

Adding the file to JavaScript libraries won't help here. _.mixin() dynamically adds passed utility functions to _ object, it's not possible to resolve such dynamically generated stuff during static code analysis unless a special treatment for the certain functions is provided. And WebStorm doesn't provide any special support for _.mixin().
If you miss it, please feel free to create a feature request in youtrack, https://youtrack.jetbrains.com/issues/WEB

Related

How to find usage of deprecated code in kotlin with intellij-idea

I want to automatically find all occurrences in my kotlin application where i use deprecated code (mostly methods which are annotated as deprecated)
I'm talking not about kotlin code which is deprecated in the kotlin spec, i mean kotlin code which calls a deprecated function/method.
The source where the deprecated function is located could be kotlin- or java- libraries.
I found really great tooling for finding similar issues in java code via intellij idea, like:
code -> inspect code
code -> analyse code -> inspection by name -> deprecated API usage
edit -> find -> find structurally -> select template deprecated methods (only available for java)
But i don't find a way for any similar search option for kotlin.
I tried to build a "deprecated api usage structural search"-template myself, but base functionalities to archive this seems not be supported for kotlin.
The only none manual function which works is the local code analyse of the file i'm currently in (this little hind in the upper right corner where you can see number of issues (and can click on them to have them in the a list))
This works but if i make a code analyse for a hole folder the deprecated usages are not there.
I need a solution for scanning the hole code base and not manually clicking from file to file.
Edit:
please note that there is now already a ticket created for jetbrains: https://youtrack.jetbrains.com/issue/IDEA-311206
Because it seems like there is no solution or workaround currently in place.
#Deprecated warning is a compiler warning, and you can not find it via IDE inspection search yet. Please follow an issue — https://youtrack.jetbrains.com/issue/KTIJ-12494/Analyze-Inspect-code-Inspection-results-show-compiler-warnings

how to config Intellij Idea live template's applicable context?

I want to create a live templates group for my custom file type, but when i pick a applicable context, there are a list of kind of file type or language but my custom file type.
Is the list predefined and can not extend?
The available context types depend on the enabled plugins. It says so (and not much more) here in the Jetbrains help page: https://www.jetbrains.com/help/idea/2016.3/live-templates-2.html
If your custom file already has a plugin, maybe all you have to do is add it. For example adding the plugin Perl adds Perl5 to the list.
Otherwise you need to look into how to create an extension. More on that here: http://www.jetbrains.org/display/IJOS/Writing+Plug-ins
Good luck!

gedit: Reading C code

How can you trace function calls, DEFINEs and declarations in a complex project from the listed includes in a given file using gedit?
In other IDEs you usually right-click on a function or variable and it can take you to its original declaration.
Gedit is an extremely light text editor and not an IDE. Therefore to answer you,
It is not possible to do what you are asking in Gedit. It never "reads" your code per se (IDEs/compliers do this) and hence can't locate function definitions etc.

Find child plug-ins of features in eclipse workspace

I want to find all the child plug-ins of a feature ? I know the name of the feature, but IWorkspaceRoot.getProject(String) does not really help me. I get an IProject that I don't know how to convert to a feature object (IFeature ?). Maybe I am on the wrong track and there is a better / easier way to do this. Any ideas ?
You could check that a selected IProject is a feature project by checking for the nature called org.eclipse.pde.FeatureNature.
Then you could try to use IProject.getAdapter(IFeature.class) call, the cast the result to IFeature. I did not try this with feature projects, but works well with Java projects.
The correct answer is the use of PDECore static class. This class provides a FeatureModelManager, that would provide the corresponding information:
FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager();
How to obtain this information? I looked with the plug-in spy to find which project defines the 'Deployable Features' export wizard (use Alt+Shift+F3 when the wizard is selected), and then looked at the implementation of the wizard class, where the addPages() method contains the previously described code block.

Converting static linked library to dynamic linked library under windows

I am in the midst of evaluating the benefits of changing our program from 30+ statically linked libraries to 30+ dynamically linked libraries. We hope by changing to DLL, it will reduce the link time.
One immediate problem is the requirement to add __declspec in front of all the classes to create the lib file for other dlls to link. Is there a way to get around that? Is there a flag in the compiler to force a lib generation so to make all classes inside the DLL available for export? If not, is there any existing script/program that will do that? That will certainly make the switch from statically linked library to a dynamic one a lot easier. If not, what is the rationale behind __declspec? Why not an option to make all dll functions exportable?
Thank you.
Perhaps it's too late, but have you looked into using a DEF file?
There is one another way to solve your problem.
You just need to create one definition file(.def) and export all the methods or class you want to share.
U will also have to set :
Properties->Linker->Input->Module Definition File -> add name of your created .def file.
Now use run time dynamic linking:
In project where you want to call the exported methods use LoadLibrary to get handle of your Dll and call the required method using GetProcAddress.