Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Fail to set break point not in current file. #15

Closed
DavidEichmann opened this issue Sep 24, 2017 · 5 comments
Closed

Fail to set break point not in current file. #15

DavidEichmann opened this issue Sep 24, 2017 · 5 comments

Comments

@DavidEichmann
Copy link
Contributor

this.ghciDebug.addBreakpoint(ob) // TODO: make this work properly

I suggest trying to get the module name from the file path using the :list module command. Here is a sketch of how it could work:

GHCIDebug.ts

// in addBreakpoint 
            this.run(`:list modules`, false, false, false)
              .then(modules => {
                const matchResult = modules.match(new RegExp("([^ ]+) +\( +" + breakpoint.file))
                if (! matchResult) { return }
                this.run(`:break ${matchResult[1]} ${breakpoint.line}`)
              })
@lierdakil
Copy link
Contributor

Would you be interested in making a PR? I'd probably be faster...

@DavidEichmann
Copy link
Contributor Author

Yeah, I've not done much TS nor atom hacking, but I'll give it a go tonight.

@DavidEichmann
Copy link
Contributor Author

I'm having some trouble setting up my environment. So far I've done:

  • Clone git repo
  • git submodule init
  • git submodule update
  • apm install
  • apm link

I can now open atom and use the package, but my change to the TS code are not compiled to JS. I've tried using tsc, but it returns a lot of errors:

> tsc
src/lib/Debugger.ts(11,23): error TS2307: Cannot find module 'path'.
src/lib/GHCIDebug.ts(1,21): error TS2307: Cannot find module 'child_process'.
src/lib/GHCIDebug.ts(2,25): error TS2307: Cannot find module 'stream'.
src/lib/GHCIDebug.ts(3,21): error TS2307: Cannot find module 'os'.
src/lib/GHCIDebug.ts(4,23): error TS2307: Cannot find module 'path'.
src/lib/GHCIDebug.ts(366,25): error TS2304: Cannot find name 'Buffer'.
src/lib/TerminalReporter.ts(1,21): error TS2307: Cannot find module 'child_process'.
src/lib/TerminalReporter.ts(2,22): error TS2307: Cannot find module 'net'.
src/lib/TerminalReporter.ts(3,21): error TS2307: Cannot find module 'os'.
src/lib/TerminalReporter.ts(4,23): error TS2307: Cannot find module 'util'.
src/lib/TerminalReporter.ts(27,33): error TS2304: Cannot find name '__dirname'.
src/lib/TerminalReporter.ts(29,37): error TS7006: Parameter 'socket' implicitly has an 'any' type.
src/lib/TerminalReporter.ts(34,26): error TS7006: Parameter 'data' implicitly has an 'any' type.
src/lib/TerminalReporter.ts(94,24): error TS2304: Cannot find name 'Buffer'.
src/lib/config.ts(1,21): error TS2307: Cannot find module 'os'.
src/lib/main.ts(5,21): error TS2307: Cannot find module 'os'.
src/lib/main.ts(6,23): error TS2307: Cannot find module 'path'.
src/lib/main.ts(7,21): error TS2307: Cannot find module 'child_process'.
src/lib/main.ts(59,33): error TS2304: Cannot find name 'require'.
src/lib/main.ts(76,20): error TS7006: Parameter 'code' implicitly has an 'any' type.
src/spec/ghciDebug-spec.ts(2,23): error TS2307: Cannot find module 'path'.
src/spec/ghciDebug-spec.ts(19,37): error TS2304: Cannot find name '__dirname'.

What am I missing?

@lierdakil
Copy link
Contributor

Sorry about prolonged silence. npm i --only=dev in package directory will install dev-specific dependencies (typescript itself, definitions, tslint). Also, I'm using atom-typescript to emit js, and it's generally rather nice to have (autocompletion, error checking, etc)

@lierdakil
Copy link
Contributor

I released #16 after some tweaks, so I suppose this can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants