JudiniLabs / code-gpt-docs

Docusaurus page
https://code-gpt-docs.vercel.app
MIT License
585 stars 64 forks source link

No output on CodeGPT Visual Studio Extension #192

Closed zono50 closed 6 months ago

zono50 commented 1 year ago

Hi everyone, i'm using Manjaro linux with Visual-studio-code-bin version 1.84.0-1. I have installed ollama using the proper commands:

curl https://ollama.ai/install.sh | sh ollama pull codellama

when i go to 127.0.0.1:11434 it says ollama is working, also when i type in the command "ollama run codellama" it works fine, and am able to query the codellama.

When i go to visual studio extension, I install version 2.2.1 with the blue checkmark, and then restarted vscode, as well as my computer. When I highlight a funciton, i rilght click, and select code explanation, and I get no output on the left hand side as follows:

image

image

image

Any help with this would be greatly appreciated!

orkutmuratyilmaz commented 1 year ago

Hello all,

Thanks for this repository:)

I've installed the extension on VSCodium and I'm facing the same problem. When I check the logs, I can see an error message, which I paste below:

[error] Blocked vscode-webview request vscode-webview://0s0p7497vnpbs3qvk3l2arfk3ake6u08g7vrm3rff2m0lk3nibdp/index.html?id=cc6ac9f0-7f04-42d2-b286-f6cd0f61e4e5&origin=0c875f47-6da0-4d44-8ceb-2e8e85ca66ae&swVersion=4&extensionId=DanielSanMedium.dscodegpt&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&purpose=webviewView

After checking the error logs, I've made a search about the error message and it says that, enabling the scripts can be a solution.

What could be done?

Best, Orkut

orkutmuratyilmaz commented 1 year ago

I've just checked /src/utils/webview.js and noticed that scripts are already enabled:

// Función para crear y mostrar el WebView
const createWebViewPanel = (type, response, context, chat, copy, title, typing, dataFile) => {
  // New WebView
  const panel = vscode.window.createWebviewPanel(
    'codegpt-panel-view', // ID
    'Code GPT', // Tab Title
    vscode.ViewColumn.Beside, // Column
    {
      enableScripts: true, // scripts
      localResourceRoots: [
        vscode.Uri.joinPath(context.extensionUri, 'media')
      ]
    }
  )

Then, what is blocking the webview here?

joake commented 1 year ago

I'm on windows with WSL w/kali-linux, ollama + mistral is working well here, so I suspect there are either some vscode settings, system permissions or url / cors issues.

image

Version: 1.84.0 (system setup) Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d Date: 2023-11-01T11:29:04.398Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

orkutmuratyilmaz commented 1 year ago

@joake thanks for your comment.

This is my VSCodium info:

Version: 1.84.0 Release: 23306 Commit: 695a9146b1347633e608f9f166c81b5b2843b492 Date: 2023-11-03T08:29:10.277Z Electron: 25.9.2 ElectronBuildId: undefined Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 6.5.9-1-MANJARO

I've re-installed CodeGPT extension and made the config as:

AI Provider: Ollama Model: codellama

I've typed "ollama run codellama" on my terminal and hit enter. It is working.

And I've restarted my VSCodium. Again, nothing happened when I clicked on the Code GPT icon:

image

orkutmuratyilmaz commented 1 year ago

Hmmm, this time logs are different:

2023-11-07 22:30:59.877 [info] ExtensionService#_doActivateExtension DanielSanMedium.dscodegpt, startup: true, activationEvent: '*'
2023-11-07 22:31:00.148 [error] Activating extension DanielSanMedium.dscodegpt failed due to an error:
2023-11-07 22:31:00.148 [error] Error: Cannot find module '../utils/promptLayer'
Require stack:
- /home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/clients/openai_client.js
- /home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/extension.js
- /usr/share/vscodium/resources/app/out/vs/loader.js
- /usr/share/vscodium/resources/app/out/bootstrap-amd.js
- /usr/share/vscodium/resources/app/out/bootstrap-fork.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15)
    at o._resolveFilename (node:electron/js2c/utility_init:2:3040)
    at Module._load (node:internal/modules/cjs/loader:927:27)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at r._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:6996)
    at c._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:36107)
    at t._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:117:45341)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at h (/usr/share/vscodium/resources/app/out/vs/loader.js:4:647)
    at Object.<anonymous> (/home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/clients/openai_client.js:8:25)
    at o._compile (/usr/share/vscodium/resources/app/out/vs/loader.js:4:1271)
    at Module._extensions..js (node:internal/modules/cjs/loader:1324:10)
    at Module.load (node:internal/modules/cjs/loader:1124:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at r._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:6996)
    at c._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:36107)
    at t._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:117:45341)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at h (/usr/share/vscodium/resources/app/out/vs/loader.js:4:647)
    at Object.<anonymous> (/home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/extension.js:7:22)
    at o._compile (/usr/share/vscodium/resources/app/out/vs/loader.js:4:1271)
    at Module._extensions..js (node:internal/modules/cjs/loader:1324:10)
    at Module.load (node:internal/modules/cjs/loader:1124:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at r._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:6996)
    at c._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:36107)
    at t._load (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:117:45341)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Function.i [as __$__nodeRequire] (/usr/share/vscodium/resources/app/out/vs/loader.js:5:98)
    at d._loadCommonJSModule (/usr/share/vscodium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:37734)
    at async Promise.all (index 0)
joake commented 1 year ago

Can you check if the following file exists?

/home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/utils/promptLayer.js?

I'd expect a user folder to precede the .vscode-oss folder, do files exist in /home/user/.vscode-oss at all?

Try to find the danielsanmedium.dscodegpt-2.1.22-universal folder in either /home/user/.vscode-oss and check if the file exists and that VSCode is running on a user with permission to the folder / files required.

orkutmuratyilmaz commented 1 year ago

Okay, I've solved mine after some searching.

As mentioned on #154 and #185, I have figured out that I need to upgrade my Code GPT version. The latest version on my VSCodium extensions manager, which comes from Open VSX Registry is 2.1.22. Then, I've decided to download V2.2.1's VSX file and install it manually. And now, I have a working extension! :)

image

@joake thanks for helping comments:)

@zono50 can you check yours too?

orkutmuratyilmaz commented 1 year ago

Can you check if the following file exists?

/home/user/.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.22-universal/src/utils/promptLayer.js?

I'd expect a user folder to precede the .vscode-oss folder, do files exist in /home/user/.vscode-oss at all?

Try to find the danielsanmedium.dscodegpt-2.1.22-universal folder in either /home/user/.vscode-oss and check if the file exists and that VSCode is running on a user with permission to the folder / files required.

I've just seen this one and thanks for that too:)

Skybladev2 commented 10 months ago

Downgrading from v3.X to v.2.2.3 hepled me, but this is suboptimal.

PilarHidalgo commented 6 months ago

Hi everyone!

I hope you're all doing well. Please take a moment to update to the latest version here: Visual Studio Marketplace.

Thank you!