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

It doesn't work with C++ files? #4

Closed
rakim-0 opened this issue Oct 30, 2024 · 5 comments · Fixed by #5
Closed

It doesn't work with C++ files? #4

rakim-0 opened this issue Oct 30, 2024 · 5 comments · Fixed by #5

Comments

@rakim-0
Copy link
Contributor

rakim-0 commented Oct 30, 2024

Wakatime doesn't show up in lsp debug. I can only logs for clang

stderr: I[02:29:59.578] PID: 188986
stderr: I[02:29:59.578] Working directory: /home/rakim/programming-stuff/cp+dsa
stderr: I[02:29:59.578] argv[0]: /usr/bin/clangd
stderr: I[02:29:59.578] Starting LSP over stdin/stdout
stderr: I[02:29:59.578] <-- initialize(0)
stderr: I[02:29:59.579] --> reply:initialize(0) 0 ms
stderr: I[02:29:59.581] <-- initialized
stderr: I[02:29:59.581] <-- workspace/didChangeConfiguration
stderr: I[02:29:59.581] <-- textDocument/didOpen
stderr: I[02:29:59.581] <-- textDocument/didOpen
stderr: I[02:29:59.581] Failed to find compilation database for /home/rakim/programming-stuff/cp+dsa/leetcode/lc-1671.cpp
stderr: I[02:29:59.581] ASTWorker building file /home/rakim/programming-stuff/cp+dsa/leetcode/lc-1671.cpp version 0 with command clangd fallback
stderr: [/home/rakim/programming-stuff/cp+dsa/leetcode]
stderr: /usr/bin/clang -resource-dir=/usr/lib64/clang/18 -- /home/rakim/programming-stuff/cp+dsa/leetcode/lc-1671.cpp
stderr: I[02:29:59.581] Failed to find compilation database for /home/rakim/programming-stuff/cp+dsa/interesting_stuff/dp-1-get-all-interesting-substrings.cpp
stderr: I[02:29:59.581] ASTWorker building file /home/rakim/programming-stuff/cp+dsa/interesting_stuff/dp-1-get-all-interesting-substrings.cpp version 0 with command clangd fallback
stderr: [/home/rakim/programming-stuff/cp+dsa/interesting_stuff]
stderr: /usr/bin/clang -resource-dir=/usr/lib64/clang/18 -- /home/rakim/programming-stuff/cp+dsa/interesting_stuff/dp-1-get-all-interesting-substrings.cpp
stderr: I[02:29:59.853] Built preamble of size 2282016 for file /home/rakim/programming-stuff/cp+dsa/leetcode/lc-1671.cpp version 0 in 0.27 seconds
stderr: I[02:29:59.854] Indexing c++17 standard library in the context of /home/rakim/programming-stuff/cp+dsa/leetcode/lc-1671.cpp
stderr: I[02:29:59.880] --> textDocument/publishDiagnostics
stderr: I[02:30:00.022] Built preamble of size 3619304 for file /home/rakim/programming-stuff/cp+dsa/interesting_stuff/dp-1-get-all-interesting-substrings.cpp version 0 in 0.44 seconds
stderr: I[02:30:00.050] --> textDocument/publishDiagnostics
stderr: I[02:30:00.132] <-- workspace/didChangeConfiguration
stderr: I[02:30:01.393] Indexed c++17 standard library (incomplete due to errors): 14161 symbols, 1810 filtered

my config:

{
    "vim_mode": true,
    "ui_font_size": 16,
    "ui_font_family": "Zed Plex Mono",
    "buffer_font_family": "Iosevka Nerd Font",
    "buffer_font_size": 20,
    "tab_size": 4,
    "theme": {
        "mode": "system",
        "light": "One Light",
        "dark": "Ayu Mirage"
    },
    "lsp": {
        "wakatime": {
            "settings": {
                "api-key":"<key>"
            }
        },
        "biome": {
            "settings": {
                "config_path": "/home/rakim/biome.json"
            }
        }
    },
    "languages": {
        "json": {
            "formatter": {
                "language_server": {
                    "name": "biome"
                }
            }
        },
        "jsonc": {
            "formatter": {
                "language_server": {
                    "name": "biome"
                }
            }
        },
        "cpp": {
            "formatter": {
                "external": {
                    "command": "/usr/bin/clang-format",
                    "arguments": [
                        "--style=file",
                        "--assume-filename={buffer_path}"
                    ]
                }
            },
            "lsp": {
                "wakatime": {
                    "settings": {
                        "api-key": "<key>"
                    }
                }
            }
        }
    },
    "buffer_font_features": {
        "calt": false
    },
    "format_on_save": "on",
    "code_actions_on_format": {
        "source.fixAll.biome": true,
        "source.organizeImports.biome": true
    }
}
@rakim-0
Copy link
Contributor Author

rakim-0 commented Oct 30, 2024

It works fine with json or python files though so I'm just confused on how to fix it

@bestgopher
Copy link
Collaborator

Hi, it is working fine on my pc.
image

@rakim-0
Copy link
Contributor Author

rakim-0 commented Oct 31, 2024

I've been going through the logs. C++ files sometimes shows up, sometimes doesn't.
Anything else I can check to debug this?

Also could it be that it's conflicting with another LSP like clang?
nvm adding C++ to extension.toml and loading it as a dev extension seemed to fix it.

LOGS:
Wakatime language server initialized
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396537" "--write" "false" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.c" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--language" "c"
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396565" "--write" "false" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.py" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--language" "python"
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396565" "--write" "false" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.py" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--language" "python"
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396582" "--write" "false" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.py" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--guess-language" "--lineno" "0" "--cursorpos" "0"
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396608" "--write" "false" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.py" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--language" "python"
Wakatime  command: "/home/rakim/.local/bin/wakatime-cli" "--time" "1730396774" "--write" "true" "--entity" "/home/rakim/programming-stuff/cp+dsa/leetcode/hello.cpp" "--plugin" "Zed/0.159.6 Zed-wakatime/0.1.4" "--guess-language"

@bestgopher
Copy link
Collaborator

@rakim-0 I have released v0.1.5. You will be able to update to the new version once the PR is merged.

@rakim-0
Copy link
Contributor Author

rakim-0 commented Nov 1, 2024

Thank you!

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 a pull request may close this issue.

2 participants