VSCode showing weird errors in my Haxe Code - visual-studio-code

i just started learning Haxe today and i got a couple of problems with my VSCode.
There are 3 "Errors" in total, to be exact 2 errors and 1 info, but the info seems kind of wrong and i would like to know how to get rid of it aswell.
Before i go into more detail, some info that might be relevant:
I created my project using the "Haxe: Initialize Project" from the Haxe VSCode extension
I changed nothing in the build.hxml file
If i run my code via VSCode (Ctrl-Shift-B) i get an error
If i run it on a normal CMD with "haxe build.hxml" it works totally fine, no errors at all
The Code:
class Main {
static function main() {
trace("Hello, World!");
var t:String = Sys.stdin().readLine().toString();
trace(t);
}
}
The build.hxml file:
-cp src
-D analyzer-optimize
-main Main
--interp
The first error i get:
It seems that this error is not even in my own file, how can this be?
The Sys.stdin().readLine() seems to have something to do with it, since this error came the moment i added this line.
Uncaught exception Not implemented in haxe.io.input.readByte at haxe/io/Input.hx tasks [180. 1]
Screenshot from VSCode
The second error i get:
Once again it seems to have something to do with Sys.stdin().readline() this time this exact part of my code is red underlined and the error message is pointing at this exact line.
Called from here tasks [4, 18]
Screenshot from VSCode (Error)
Screenshot from VSCode (red underline)
The (kind of) error / Info i get:
This is the most weird one imho..
Its a blue "~" i get at the beginning of my trace("Hello, World!"); line.
Screenshot from the weird Blue Symbol
Screenshot from the VSCode "Problem" regarding this line
Thanks in advance!
I looked through the internet the whole day hoping to find something to get this things solved on my own, but since its my first time ever using Haxe and i was not able to find something even similar to this i hope some of you 5heads out there can help me with this. :)

Related

provideDebugConfigurations not getting called

I am using the vscode-mock-debug git as the basis for my work.
Activation event is OnDebug, although same result
I implement provideDebugConfigurations in my DebugConfigurationProvider and its not getting called.
provideDebugConfigurations(folder: WorkspaceFolder | undefined, token?: CancellationToken): DebugConfiguration[] {
return [...my data in here];
}
the resolveDebugConfiguration (the original from mock-debug) is called, I can set a breakpoint. However the provideDebugConfigurations is never getting reached. build 1.36 of vsce. am I missing something obvious ?
this is the answer from the vscode team: https://github.com/microsoft/vscode/issues/78362
I have investigated this and it is expected behavior.
Namely, provideDebugConfigurations is only called then the debug configurations are needed to generate a launch.jsonfile. If you click on the configure command the provideDebugConfigurations will get nicely called.
However if you do not have a launch.json and you simply press Debug Start, vscode will try to start debugging without using debug configurations, but using one on the fly provided by the resolveDebugConfiguration call.
More about this can be found in our docs https://code.visualstudio.com/api/extension-guides/debugger-extension
Thus closing this as designed.

Connecting FluidEnter/FluidExit at run-time

I am toying with the FluidEnter/FluidExit. So in a simple form, here is what I am trying to do:
I created in Main an empty population of agent called Terminal. For now, in Terminal, there is only a fluidEnter connected to a fluidExit (very simple)
enter image description here
Now, on startup, I want to fill this population and set up the proper connections (the terminals are ordered).
So, on startup, I call a function init(), whose body start with Terminal t = add_terminals(); (I have only one terminal for now, just toying with things)
In Main, obviously, I also have a fluidEnter and a fluidExit. I would like to connect the fluidExit of Main to the fluidEnter of the terminal t, and the fluidExit of the terminal t to the fluidEnter of Main, so code (still in init()) looks like
fluidExit.set_fluidEnter(t.fluidEnter);
t.fluidExit.set_fluidEnter(fluidEnter);
I get an exception so obviously, I am doing something wrong. Any idea?
I think the set_fluidEnter function is deprecated or just non-functional.
Instead, you should do:
fluidExit.connect(t.fluidEnter);
So just replace set_fluidEnter with connect... nothing else.
That should do the trick
I was going down the same path as you a couple of months ago. Yes... .connect() works great. It even works as a gate. If it is disconnected, then fluid stops at the exit. Once connected, fluid starts to flow again. It is very slick.

VSCode Custom Extension: Seem not to work

I'm currently trying to write an VS Code extension and it's a bit frustrating. I did everything as said here:
https://code.visualstudio.com/docs/extensions/example-hello-world
But after using yo code and entering all necessary information, I opened the respective folder VS Code hit F5 and VS Code says I should configure my launch.json (this should be done by yo code, shouldn't it?). However, when I press the debug start button, a extension-host window opens as described in that tutorial. BUT: When I try to execute the extension the command palette won't find it.
I tried several command names such as "hello world" "helloworld" or variants of the name of the extension that I gave in yo code. I also noticed the
"commands": [{
"command":"extension.sayHello",
"title":"Hello World"
}]
section of the package.json, but somehow I don't manage it to put it all together in order to get a simple, working vs code extension. In tutorial videos on youtube everyone can simply hit F5 after launching VS Code, what I cannot. Pretty weird somehow.
Any help is appreciated!
Thanks in advance.
EDIT: Additional information.
When I activated vs code to show all exceptions (even handled) vs code stops at the following point (see default:)
at internal/process/stdio.js (core module)
// ...
case 'PIPE':
case 'TCP':
var net = require('net');
stream = new net.Socket({
fd: fd,
readable: false,
writable: true
});
stream._type = 'pipe';
break;
default:
// VS CODE STOPS AT THE LINE FOLLOWING!
// Probably an error on in uv_guess_handle()
throw new Error('Implement me. Unknown stream file type!');
}
// Ignore stream errors.stream.on('error', function() {});
} catch (error) {
stream = createDevNull();
}
//...
Hopefully it helps :(
I solved my problem by reading the tutorial with more attention. The tutorial tells you to activate the command palette by Hitting F1 not CTRL P. This solved my Problem.
I did not change anything in the code; rather it seems to be important to hit F1 instad of [CTRL] + [P] despite it actually brings up the same input. I'm still wondering why to differenciate between CTRL + P and F1 if both bring up the same control. :/
Hope it helps other beginners, too.
cheers!
I had the same issue (though didn't debug to see if it failed on the same line) and I resolved it by restarting VSCode.

A weird error occurs on my xml-file during eclipse start and goes away after maven update

I have a weird error that occurs on my camel-config.xml file that occurs on my datasource pooling. When I start my eclipse, the error shows up that says "Processing XML Error. Resource must not be null", and goes away after I do maven update. I wanted to know what's causing the error to occur in the first place and why does it go away after I update it. Its oracle datapooling and not even related to logic of a particular project. Any thoughts, suggestions or views about this problem are appreciated.
I'm getting error on this piece of code.
<orcl:pooling-datasource id="dataSource1"
url="${oracle.db1.url}" username="${oracle.db1.username}" password="${oracle.db1.password}"/>
<orcl:pooling-datasource id="dataSource2"
url="${oracle.db2.url}" username="${oracle.db2.username}" password="${oracle.db2.password}"/>
<orcl:pooling-datasourc
e id="dataSource3"
url="${oracle.db3.url}" username="${oracle.db3.username}" password="${oracle.db3.password}"/>
Thanks,
Gautham

iphone: co-processor offset out of range

i have a strange compiling problem with xcode and iphone. my game is almost finish but now i got suddently this compiling error:
{standard input}:6108:co-processor offset out of range
gcc-4.2 failed with exit code 1
this only happens if i compile the release version for the device. the debug version and both versions for the simulator works. clean targets and recompile don't work.
strangly enough that error only happens if i add a line of code to one specific source file and only between these lines:
[_sharedDirector checkAndPutScoreToHighscore:(int)[player score]];
gameOverScreen = YES;
gameOverScreenSlideY = 320.0f;
[buttonManager activateButtonWithID:replayButton];
[buttonManager activateButtonWithID:menuButton];
so when i put a random line between this lines of code i get that error.
i do not know what causes this error. i had opened the sourcecode file to "show as assembly file" just for fun but i don't think this has caused the error.
has anybode a hint for me what could be going on? i am searching the web for over 3 hours and thats very frustrating.
You most likely found a compiler bug. You really should switch to the LLVM compiler (clang).