 
         # TODO: The lines in the message will be indented by a fixed amount
         # We could potentially remove this (not a big deal, of course)
-        uri: file
+        uri: @cwd.getFile(file).getPath()
         position: new Point parseInt(line) - 1, parseInt(col) - 1
         message: msg.trimRight()
         severity: typ

    hasError = false

    proc.stderr.on 'data', (data) =>
      msg = @parseMessage data.toString()
      if msg?
        if msg.uri?
          hasError = true
        onMsg msg

    proc.on 'close', (code, signal) =>
      onClose code, hasError

  # Split the error buffer we have so far into messages
  splitErrBuffer: (isEOF) ->
     som = @errBuffer.search startOfMessage
     while som >= 0
       errMsg     = @errBuffer.substr(0, som + 1)
       @errBuffer = @errBuffer.substr(som + 1)
       som        = @errBuffer.search startOfMessage
       @parseMessage errMsg
     if isEOF
       # Try to parse whatever is left in the buffer
       @parseMessage @errBuffer

  parseMessage: (raw) ->
    if raw.trim() != ""

class CabalProcess
  # Spawn a process and log all messages
  constructor: (command, args, options, onMsg, onClose) ->
    @cwd = new Directory options.cwd
    proc = child_process.spawn command, args, options

    # TODO: Not sure how to make the cancel available
