nelak2 / nwscript-sinfar-language-server

NWScript Language Server modified to work for Sinfar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor your functions in specified files

Arthurmtro opened this issue · comments

You should separate your logic in specified files, this will allow you to better read, update and understand your code.
Plus, you may want to test your code in order to avoid a lot of errors

for example a folder lib with a folder commands with all commands so in your main file it will be more readable to just call the associated functions and don't care about what it does

context.subscriptions.push(
vscode.commands.registerCommand("sinfar.gotoERF", async (event) => {
const erfID: string = event.path
.match(/(\()([0-9]{1,4})(\))$/)
.at(2)
.toString();
void vscode.env.openExternal(vscode.Uri.parse("https://nwn.sinfar.net/res_list.php?erf_id=" + erfID));
}),
);

Yes. This makes a lot of sense.