agrawal-d/cph

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

goyalyashpal opened this issue · 8 comments

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

  • related issue: #437
$ 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)

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

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>

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.

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.

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);
.
}

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

@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.

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

cph/docs/dev-guide.md

Lines 61 to 63 in 94b0425

The launch config is in `.vscode/launch/json`. To launch the extension, just
press `F5`. It will bundle the extension using Webpack first, saving the output
in `dist/`.

  • 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.

  • the srcPath used in generating the md5 hash is the output of vscode.window.activeTextEditor .document.fileName.
  • to get that directly: use the result of copy path of active file, ...
  • with only catch being that the drive letter is small on widows os
  • rest assured that, remaining whole path has
    • same case, same separator, same resolution (say in case of symlinks) as this result
  • the md5sum gnu coreutil can then be used to get hash of this name string.
    just make sure (say using od -c) that no unwanted character is added by the calling shell.

example of path:

d:\paTh\tO\hEyo.cpp

Reference to line of sources: