Humoroussix2799
Humoroussix2799
Explore posts from servers
CC#
Created by Humoroussix2799 on 11/11/2024 in #help
Incorrect Position for syntax tree nod
No description
4 replies
CC#
Created by Humoroussix2799 on 10/22/2024 in #help
Message header must separate key and value using ':', OmniSharpLSP
I get the typical err message for when your JSON rpc is somehow unformatted, but here the thing is I'm using OmniSharp, I could see how it could be a buffer issue if it was from scratch but your telling me Omnisharp doesn't handle that (doubtful)? I see no real problem with the way I currently have it set up, although every implementation I see does something completely different
4 replies
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