atom-racer icon indicating copy to clipboard operation
atom-racer copied to clipboard

by default do not pass a rust source

Open lu-zero opened this issue 8 years ago • 2 comments

This way the racer default can be used.

It would make it work out of box on rustup setups.

lu-zero avatar Dec 27 '16 16:12 lu-zero

This would definitely be an improvement. A temporary workaround to automatically detect the rustup source component would be to add something like this to the init script:

do setRustSrcPath = () ->
    exec = require('child_process').exec

    exec 'rustc --print sysroot', (error, stdout, stderr) ->
        if error
            atom.notifications.addFatalError 'failed to determine rust source path: ' + stderr
        path = stdout.trim() + '/lib/rustlib/src/rust/src'
        atom.config.set 'racer.rustSrcPath', path

I'm not sure if this is a 100% correct (and good idea due to the asynchronous execution) though.

qzed avatar Dec 27 '16 17:12 qzed

https://github.com/edubkendo/atom-racer/pull/79 this is the current kludge that works well enough to me.

lu-zero avatar Dec 27 '16 19:12 lu-zero