Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add config property to set trace level #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikpivkin
Copy link
Contributor

@nikpivkin nikpivkin commented Aug 19, 2024

This PR adds the ability to set the trace level for intercepting requests and responses between client and server.

[Trace - 01:54:39] Sending request 'initialize - (0)'.
Params: {
    "processId": 91401,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.92.1"
    },
    "locale": "en",
    "rootPath": "/Users/.../projects/rego-lsp-test",
    "rootUri": "file:///Users/.../projects/rego-lsp-test",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
...

@@ -160,6 +160,17 @@
],
"default": "opa-fmt",
"description": "The formatter to use for Rego. Supports: ['opa-fmt', 'opa-fmt-rego-v1', 'regal-fix']."
},
"regal.trace.server": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks positive, I think it looks too like we might be able to replace

if (process.env.VSCODE_DEBUG_MODE === 'true') {
with this - but only once we have the Regal LS side to this too?

Do we not need to send/set this config as part of the initialisation options too? (i.e. in here somewhere: https://github.com/open-policy-agent/vscode-opa/blob/main/src/ls/clients/regal.ts#L167)

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