agrawal-d / cph

Makes judging, compiling, and downloading problems for competitive programming easy.
https://agrawal-d.github.io/cph
GNU General Public License v3.0
816 stars 137 forks source link

how to view the commands used for on clicking cph's run button? #449

Closed goyalyashpal closed 5 months ago

goyalyashpal commented 5 months ago

how to view the commands used for on clicking cph's run button?

$ codium --list-extensions --show-versions | grep agrawal
divyanshuagrawal.competitive-programming-helper@6.1.0

$ codium -v
1.89.1
a045dcfceda27f896936bfd8cbf524f6a93a2f46
x64

$ systeminfo | grep -Ei "^os (n|v)|system type"
OS Name:                   Microsoft Windows 10 Home Single Language
OS Version:                10.0.19045 N/A Build 19045
System Type:               x64-based PC

Browser Version: Vivaldi 6.7.3329.31 (Stable channel) (64-bit) (U/A: Chrome/124.0.0.0)

imeanup commented 5 months ago

You need to select the extension from the VSCode Extension Tab. Select CPH extension, and next to it you will find the 3-dots. Go to extension setting. Here you could perform the setup for Cph based on your requiremnet. If you are using C++, then Cpp Command would be g++-13 (Latest). Furthermore, you could customize based on your requirement. Go through each option and you will find it pretty simple.

PS (If latest g++ is not installed, use Homebrew for MacOS to install. Or, for Windows install ubuntu watch evimalab YT video resource Japanese Video

Screenshot 2024-06-16 at 10 54 48 PM
goyalyashpal commented 5 months ago

Here you could perform the setup for Cph based on your requiremnet. If you are using C++, then Cpp Command would be g++-13 (Latest).

hi! these are not the "commands" - these are just the name of executables used. i was asking for the whole command - with all the flags etc. so like gcc -ggdb3 -std=c04 ... <etcetera> <etcetera>

imeanup commented 5 months ago

Would you like to setup? Or you want to know whats the default? If you want to setup you could find the Args to set the complete command.

goyalyashpal commented 5 months ago

Or you want to know whats the default?

yes, this one.

but also, there should be some way to see what command was run. for example, for various vscode extensions, it's shown in "output" bottom tab of vscode. things like coderunner extension too show which command is currently being executed.

imeanup commented 5 months ago

The default setting is in the file name called complier.ts here

In View > Output, or use the shortcut Ctrl + Shift + U. Selecting CPH, will not result in any output as the log is not captured. But you can built the extension locally, and add the below command in the above file to log the flags.

const getFlags = (language: Language, srcPath: string): string[] =>{
.
.
let ret: string[];
.
.

// Log the flags for debugging 
console.log('Generated flags:', ret);
.
}
goyalyashpal commented 5 months ago

@agrawal-d i see no commits for fixing this. did u mean to close this as "not planned" ?

imeanup commented 5 months ago

@goyalyashpal The requested feature will outputs everytime when your code works and will pop-up the output window in VSCode which will hinder the purpose of CPH in first place. However, you could try on your own (locally) and observe the behaviour.

goyalyashpal commented 5 months ago

2 things:

Problems

``` Could not find the task 'npm: webpack'. ``` ``` Error: there is no registered task type 'npm'. Did you miss installing an extension that provides a corresponding task provider? ``` ``` Activating extension 'DivyanshuAgrawal.competitive-programming-helper' failed: Cannot find module '...\cph\dist\extension.js' Require stack: - c:\Program Files\VSCodium\resources\app\out\vs\loader.js - c:\Program Files\VSCodium\resources\app\out\bootstrap-amd.js - c:\Program Files\VSCodium\resources\app\out\bootstrap-fork.js. ```

Old Tries

https://github.com/agrawal-d/cph/blob/94b0425c484af591ac92cceae2176a13b4ae1997/docs/dev-guide.md?plain=1#L61-L63 [q/29492240]: http://stackoverflow.com/questions/29492240/ddg#41818767 "Error Cannot find module webpack" * it shows this above warning on vscodium, on clicking debug anyway, it showed the last message above as notification. * i have never done any ts/js devt, so don't know how to resolve this. * i tried searching the web, this SO question [q/29492240] seems to have several answers, but thought to ask here to confirm. i am on windows 10


P.S.

example of path:

d:\paTh\tO\hEyo.cpp

Reference to line of sources: