vscode-compiler-explorer
vscode-compiler-explorer copied to clipboard
Allow opening the Compiler-Explorer feature even if file language is not C/C++
The current functionality prohibits opening the explorer preview if the editor's target language is not one of C/C++. Yet once it is open, it remains open even for non-C/C++ editors.
I would recommend allowing the user to open the explorer regardless of the language. Then if the target language is not supported, simple display a corresponding message. Otherwise display the results of Godbolt's Compiler-Explorer.
I was able to produce "unsupported language CMAKE" with this approach on my end. :)
Did you figure out how to open another language? I am trying to open a window for some zig code.
Did you figure out how to open another language? I am trying to open a window for some zig code.
Unfortunately it's been several years since I last played around with this extension, so I can't remember exactly. From what I vaguely remember, I think I just worked around the issue. I believe the extension just needed a simple adjustment to it's file/language-check logic.
You may want to have a look at: (canShowCompilerExplorer
in compiler-view.ts) https://github.com/MRobertEvers/vscode-compiler-explorer/blob/3758b9ec198229275656cd5117f0b432804faf53/src/compiler-view.ts#L119
Zig is not currently listed there. :)
Thanks for finding that!
this.supportedCompilers.then(res => {
if(res.includes(lang)){
return true;
}
});
Not super familiar with TypeScript. Zig is supported by Compile-Explorer and I've been able to set that to ztrunk which is supported and would be pulled down from the website.
Hmmm, will need to figure out how to put my own version into VSCode. Super new to VSCode so this is a lot of learning.
Thanks!
Boy, I have no idea how to compile this on my windows computer. I was able to compile it but then dropping it into the same spot as the old compiled file didn't do anything. I wonder where I can find info on adding a VS Code extension.