Skip to content

Conversation

@dantetemplar
Copy link

@dantetemplar dantetemplar commented Sep 8, 2025

Rework Cph › General: Save Location
Now .cph folder created inside Save Location.
Save location will be created instead of raising error.
It supports ${group} syntax 🔥
Description for the option is changed:

Directory where new problem source files and their .prob metadata will be saved. Supports the ${group} placeholder (e.g. '${group}/'), which is replaced with the problem's group. Leave empty to save in the workspace root for sources and alongside sources in .cph for metadata.

Rework finding .prob for code file
Now it will check every .cph folder from down to top until it will find such .prob that points to the code file via srcPath (name of .prob may be any, but same name as code file is prioritized). Using such approach allow us to remove messy hash from .prob files.

Auto-open CPH Judge only if associated .prob file exists
If no .prob file exists, most probably, that is not a problem code file, but just some file (may be scratch, or util).

Ctrl+Alt+B will not create new .prob until second invocation
So, firstly it will open CPH Judge tab, and on second keybind shot will create .prob file with empty testset.

Prettify .prob files
It will be with indent=2 so human will able to read those .json files.

Speed up extension loading
Set retainWebviewContext to true by default so IDE will keep extension in memory to open it instantly.

Line number column and coloring
Now we have line number with synchronized highlight on hovering, also it shifts first line for input if T-testcases pattern (common in CodeForces) is detected. And coloring for good and bad tokens. Relates-to: #572 #577
image

Suppress warning about Content Security Policy
There was a warning in Extension Host:

2025-09-09 02:41:20.879 [warning] DivyanshuAgrawal.competitive-programming-helper created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp

It was fixed by adding Content Security Policy in App and generating nonce for scripts.

… Search for .cph folder from code file parent folder to workspace; Open CPH Judge tab only if .prob file is associated; Ctrl + Alt + B will open CPH Judge but will not create a .prob file until second invocation
@dantetemplar
Copy link
Author

dantetemplar commented Sep 8, 2025

May broke some stuff with .prob files, but should not

@agrawal-d agrawal-d self-assigned this Sep 13, 2025
@dantetemplar
Copy link
Author

dantetemplar commented Sep 13, 2025

Code for line numbers is hacky, sorry, can't do it cleaner yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants