Reddit uses Markdown so you should look there if you wanna make anything pretty.
If you just wanna write a single line of code or a short inline statement, you can use `single backticks` like this: someFunction()
.
If you want to post a whole script, you can enclose it between a pair of three backticks.
`
// This is
// an example
\
`
This becomes
// This is
// an example
And you can even specify the language right after the first three backticks, like this: ```js
Which gives
/** @param {NS} ns */
export function main(ns)
{
// some code
}
Also, you must have two line breaks before and after blocks of code. Otherwise it won’t work (IIRC). And it makes it easier to read.
If you're confident of the type of a var, but the editor's not picking up on it, you can toss something like /** @type string[] */
on the line before the var's declaration. I've found this to be been a handy reference. (I know this works in .js files, not certain about others, but .ns should behave identically.)
Still an odd issue... the main time I've had trouble getting the editor to pick up on types has been with my own imported functions...
Hey no problem, this is an extension for Visual Studio Code https://code.visualstudio.com
That is a glorified text editor to the level of an ide like Visual Studio.
Basically the idea is to have/use a proper code editor instead of using the one build in game, with support to tooltips/code completion/linting/imports/etc.
So after you have Visual Studio Code installed and have gotten the extensions you want from the marketplace for your code language of choice (in this case javascript/typescript), you install this extension following the instructions so you would have a counter for the ram usage similar of how it is in the game.