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

[dap-go] Debug extension has changed its file structure #334

Closed
shackra opened this issue Aug 11, 2020 · 13 comments
Closed

[dap-go] Debug extension has changed its file structure #334

shackra opened this issue Aug 11, 2020 · 13 comments

Comments

@shackra
Copy link

shackra commented Aug 11, 2020

It seems that the extension has changed:

internal/modules/cjs/loader.js:979
  throw err;
  ^

Error: Cannot find module '/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/out/src/debugAdapter/goDebug.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Process Go Debug stderr finished

This is the file tree upon deleting ~/.emacs.d/.extension and letting lsp-go and friends make its contents:

.extension/vscode/golang.go on  master
➜ pwd
/Users/joaraya/.emacs.d/.extension/vscode/golang.go
.extension/vscode/golang.go on  master
➜ tree
.
|-- [Content_Types].xml
|-- extension
|   |-- CHANGELOG.md
|   |-- LICENSE.txt
|   |-- README.md
|   |-- dist
|   |   |-- debugAdapter.js
|   |   |-- debugAdapter2.js
|   |   `-- goMain.js
|   |-- images
|   |   |-- go-logo-blue.png
|   |   |-- gutter-blockblue.svg
|   |   |-- gutter-blockgreen.svg
|   |   |-- gutter-blockred.svg
|   |   |-- gutter-blockyellow.svg
|   |   |-- gutter-slashblue.svg
|   |   |-- gutter-slashgreen.svg
|   |   |-- gutter-slashred.svg
|   |   |-- gutter-slashyellow.svg
|   |   |-- gutter-vertblue.svg
|   |   |-- gutter-vertgreen.svg
|   |   |-- gutter-vertred.svg
|   |   `-- gutter-vertyellow.svg
|   |-- languages
|   |   `-- go.mod.language-configuration.json
|   |-- package.json
|   |-- snippets
|   |   `-- go.json
|   `-- syntaxes
|       |-- go.mod.tmGrammar.json
|       `-- go.sum.tmGrammar.json
`-- extension.vsixmanifest

6 directories, 26 files
.extension/vscode/golang.go on  master
➜
@shackra shackra changed the title [lsp-go] Debug extension has changed [lsp-go] Debug extension has changed its file structure Aug 11, 2020
@shackra
Copy link
Author

shackra commented Aug 11, 2020

I have a copy in one machine which has 0.14.4 as its version, compared to 0.16.1 on my work machine, lsp-go is currently compatible with the former but not with the latter.

@shackra
Copy link
Author

shackra commented Aug 11, 2020

yes, not sure what I can do on my own, the files in dist/ do not work due to missing dependencies:

internal/modules/cjs/loader.js:979
  throw err;
  ^

Error: Cannot find module 'vscode'
Require stack:
- /Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:5766:18)
    at __webpack_require__ (/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:21:30)
    at Object.<anonymous> (/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:13907:16)
    at __webpack_require__ (/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:21:30)
    at /Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:85:18
    at Object.<anonymous> (/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js:88:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/joaraya/.emacs.d/.extension/vscode/golang.go/extension/dist/goMain.js'
  ]
}

Process Go Debug stderr finished

@shackra shackra changed the title [lsp-go] Debug extension has changed its file structure [dap-go] Debug extension has changed its file structure Aug 11, 2020
@yyoncho
Copy link
Member

yyoncho commented Aug 12, 2020

Can you verify this: #326?

@shackra
Copy link
Author

shackra commented Aug 24, 2020

fyi:

@yyoncho got this from Go debug stderr:

(node:27901) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Process Go Debug stderr finished

I have node v13.11.0

also, in Warnings I got the following:

Warning (emacs): Initialize request failed: unrecognized request

I've attached some logs, but it short: no luck.

lsp-log gopls.txt
lsp-log.txt

@shackra
Copy link
Author

shackra commented Sep 1, 2020

any updates with this? is there more debugging information or tests I can do in order to resolve this bug?

@Gleek
Copy link

Gleek commented Sep 20, 2020

It would be great if we would could update the version manually in dap-go.el to fetch 0.15.0 instead of the latest being fetched right now. This can be moved back to the latest version once we fix the bugs @shackra pointed out with the new version.

@yyoncho
Copy link
Member

yyoncho commented Sep 20, 2020

@Gleek you can path dap-utils-get-vscode-extension - it has version parameter. Also, you can download and extract the extension from marketplace manually in .emacs.d/.extension/vscode/

@Gleek
Copy link

Gleek commented Sep 20, 2020

@yyoncho I did that already and it works for me. I was suggesting we add this to dap-go.el as well so that things work out of the box for people trying out dap-mode with go.

@yyoncho
Copy link
Member

yyoncho commented Sep 20, 2020

@Gleek thank you, good idea, I will try to do that tomorrow my time.

@yyoncho
Copy link
Member

yyoncho commented Sep 27, 2020

FTR I pushed a change which forces 15.0 version which should work.

@h3poteto
Copy link

h3poteto commented Oct 6, 2020

The master branch works fine.

@shackra
Copy link
Author

shackra commented Oct 17, 2020

for some reason I was unable to make it work, but testing now things go smooth and I can debug again

unless there is something else to do this issue can be close

@shackra
Copy link
Author

shackra commented Oct 17, 2020

or rather, open the issue again if there is something else

@shackra shackra closed this as completed Oct 17, 2020
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

No branches or pull requests

4 participants