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](https://private-user-images.githubusercontent.com/110709398/340121252-e95dc611-91b1-45b8-875e-ae8c2fcca621.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NzgyMjQsIm5iZiI6MTcyMDY3NzkyNCwicGF0aCI6Ii8xMTA3MDkzOTgvMzQwMTIxMjUyLWU5NWRjNjExLTkxYjEtNDViOC04NzVlLWFlOGMyZmNjYTYyMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMVQwNjA1MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lNGE2Mjk3NTA5ZTUxYmJmN2VkODdkMTkxMmZlMGMyMTNhOTc0ZTMzOTY0MTczODA2YzhkN2U5ZjNlM2QzNGIwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.n1_KwMqlNA1vwmiQUuuvA1aTOFyQ8moOLXGLb3Nm2-g)
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:
npm install .
- Enable
vscode.npm
<@builtin npm
< Extensions<C-S-x>
| Ref: so/q#75752318 (answer #78288149)
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
Lines 61 to 63 in 94b0425
- 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 themd5
hash is the output ofvscode.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 usingod -c
) that no unwanted character is added by the calling shell.
example of path:
d:\paTh\tO\hEyo.cpp
Reference to line of sources: