Humoroussix2799
Humoroussix2799
Explore posts from servers
CC#
Created by Humoroussix2799 on 6/11/2024 in #help
Reading in JSON-RPC for LSP msg returning Null???
So long story short Im building an LSP and it has been a process. I finally got it hooked up to read in stdin from vscode only for my message to never return anything but null. Its not hat at some points I dont have the full message but as you'll see from my custom scanner and Split function the whole purpose is to scan until I am certain I have a finished message from vscode once I do for right now I just send the actual message to the logger to a text file.
7 replies
CC#
Created by Humoroussix2799 on 5/24/2024 in #help
✅ Is there a way to programmatically formatt a file
Im writing a transpiler to C# (in C#) and I would like to formatt the output files after I write them to C# does anybody know how to do this? Roslyn does not work:
private async void FormatCode(string path)
{

string code = File.ReadAllText(path);
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
var root = await syntaxTree.GetRootAsync();
var formattedRoot = Formatter.Format(root, Formatter.Annotation, new AdhocWorkspace());
string formattedCode = formattedRoot.ToFullString();
File.WriteAllText(path, formattedCode);
}
private async void FormatCode(string path)
{

string code = File.ReadAllText(path);
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
var root = await syntaxTree.GetRootAsync();
var formattedRoot = Formatter.Format(root, Formatter.Annotation, new AdhocWorkspace());
string formattedCode = formattedRoot.ToFullString();
File.WriteAllText(path, formattedCode);
}
SOLUTION FOUND by SleepWellPupper
28 replies
DIAdiscord.js - Imagine an app
Created by Humoroussix2799 on 8/14/2023 in #djs-questions
Multiple Schema creation on message for level???
So basically I have the leveling system and on the surface it seems to work, but there is just a few issues when I send a message 1. it creates more than one level schema (anywhere from 2-13) 2. the cooldowns dont work I am really scratching my head on this one since Ive tested with console.logs and the actual function is only called once succsefully as seen here:
connected to db
RpgBot#1051 is online
xpGiver function called
INCORRECT
xpGiver function called
xpGiver function called
INCORRECT
connected to db
RpgBot#1051 is online
xpGiver function called
INCORRECT
xpGiver function called
xpGiver function called
INCORRECT
(incorrect following the call means it didnt run the code bc its a bot) so it is only called once, yet, the bot sends the level up message multiple times. After that it works perfectly fine except cooldowns wont work but it only levels up and changes the data of one of the schema not all, heres what really confusing. It creates an almost random amount of schema like I said 2-13 in the provided screenshot it made 12. Also even when removing cooldowns it does the same thing?!?! I just dont know what could cause it?
3 replies
DIAdiscord.js - Imagine an app
Created by Humoroussix2799 on 8/13/2023 in #djs-questions
Leveling system not working
So the issue is that when trying to make aleveling system and send the data tyo mongoDB it seems to not even be calling in the message interaction, but an even weirder part is that when I make it a slash command it does seem to call, however it immediatly halts with the if statement at the beginning? All I really want to do is make a simple leveling system that gets sent to mongoDB when A user sends a message in the guild.
5 replies