Move Code causes broken Import - vb.net

I move a .vb module from one folder to another and now an Import cannot find it.
In Default.aspx.vb I have an Import that looks like this:
Imports XYZ
I moved the code from:
App_Code\XYZ.vb
to:
Utils\XYZ.vb
I moved it because I now understand that App_Code is some kind of special folder and I did not want this code treated as special code.
I tried adding
Namespace Utils
End Namespace
in Utils\XYZ.vb and changing to Imports Utils.XYZ but the import still did not resolve.
In case it matters I am using VS2017.
[EDIT] It appears that the problem is that VS2017 can't see the code moved as I can build and publish without error.

Related

what is '#' in import reference, and why it doesn't work in VSCode

In my router/index.js I have a reference that looks like that:
import SingleVignette from '#/components/Vignette'
I guess # stays for a base directory, right? But I try to Command+click on the reference in VSCode it doesn't refer me to an original file (while ../components/Vignette does. How to make it work?

Problem Importing ControlP5 in IntelliJ IDEA (used with Processing Core)

I am developing an interactive program to simulate power grid switching and I have it working beautifully with the rendering tools in the Processing library. Now I want to add a user interface with menus and buttons, etc. I found the ControlP5 library and it seems like what I need, but I am having a hard time importing it into my project. I have the most current ControlP5 folders/files on my machine and I have added them as a project library. IntelliJ is recoginizing my import statement, but it won't let me declare a variable using the ControlP5 class.
My import statement seems good to go... it is greyed out as an unused import.
But the very last line in the code copied here generates an error "Cannot resolve symbol 'ControlP5'"
import processing.core.PApplet;
import processing.core.PConstants;
import processing.event.*;
import controlP5.*;
public class Main extends PApplet {
Viewport viewport = new Viewport();
Click click = new Click();
UserInterface ui = new UserInterface();
ControlP5 cp5;
Here is a screen shot of my libraries. I have the Processing Core library which I am using for drawing tools, and I want to also use classes from the ControlP5 library which I believe I have correctly linked as an external library here.
Here is a screen shot of my module dependencies.
Here is a screen shot of the bottom of my project tree. I can see that Processing is correctly shown, but I do not see the ControlP5 library here.
I have tried multiple different methods of adding just certain subfolders of the "controlp5-master" folder which I downloaded with no luck.
I have also searched through Google, Processing forum, and Stack Overflow and can't find an answer.
Any advice?
My problem was solved on the Processing Forum. I simply referenced the wrong file when establishing my external library. The ControlP5 download package includes a jar file that is buried several folders deep. Once I pointed the library to that jar file, I was in business.

How do you import a reference to a dart file when you only know the file name? Extension methods and others

To import a file in Dart (using IntelliJ) I will usually use start typing the name of a function, class or variable and select enter. Alternatively I might type the name of the class and press alt+enter on it. This will then give me an option to import the file reference.
For extension methods this doesn't work and sometimes I know the name of the package (file) I want to import but can't remember the name of the function.
Is there a way to use the filename to lookup and insert an import statement with the full package address?
Edit
Unfortunately my originally accepted answer doesn't always work. For example with extension methods. I'm trying to add a reference and it seems impossible to do without typing the full reference to the extension.
Edit2
Found out there is an open issue to fix this
https://github.com/dart-lang/sdk/issues/40365
You can write import 'som...' and ctrl+space for auto-complete and get IntelliJ to make suggestion across all packages imported with pubspec and files across the project. If the file is inside a package, it will automatically insert the full path.

intellij cannot resolve symbol "File"

I have this in my script
import groovy.io.FileType
.....
derp = new File("blah")
The script works but inetillij complains it cant resolve "File" and it suggested I import a totally different wrong library for it (com.jidesoft.icons.IconSet)
I already tried invalidating cache and restarting
How do I get intelllij to import groovy.io.FileType? I cant even find a way to suppress error either it doesnt give me that option
groovy.io.FileType is an enum class. It appears your variable derp would be of type File, not FileType.
You can statically import enums from the FileType class (for example):
import static groovy.io.FileType.*
In my Intellij on Java 8 the File class comes from the java.io package in a .groovy file.

Using a type without namespace specification or import

I know that this is not really clean but it is possible as I am seeing it right now.
I have no import for System.Web.UI.WebControls. All I have is a reference to System.Web.
The type is used like this:
Private plhZoneContexte As PlaceHolder
PlaceHolder is under System.Web.UI.WebControls so I should prefix it like this if not imported:
Private plhZoneContexte As System.Web.UI.WebControls.PlaceHolder
The problem is that I can't use imports or prefixes for this case. I'm not allowed to do this kind of modification. This is the way the app worked before, and this is the way the newer version should work.
Any ideas?
You could import the namespace in the project properties. That would remove the necessity of adding Imports or prefixes.