Honestly, I like the 98% solution of "grab metadata from every other module
in the project except the one you're editing, and use 'text that appears
before' completion (or similar heuristics) for things in the module you're
editing." It doesn't require a compiler that can parse broken code, and is
relatively minimal in work.

  - Clark


On Wed, Mar 12, 2014 at 4:07 PM, Daniel Micay <danielmi...@gmail.com> wrote:

> On 12/03/14 03:52 PM, Clark Gaebel wrote:
> >
> >     ​There is no accurate jump-to-definition, type retrieval, docstring
> >     retrieval or semantic completion for Rust. The compiler was not built
> >     with support for this kind of tooling in mind, and I seriously doubt
> >     that anything but inaccurate hacks will exist for a *long* time.​
> >
> >
> > ​This worries me a lot.
>
> It would need to be able to perform type checking/inference even if the
> file can't be fully parsed, or there are type errors in other places.
>
> At the moment, each phase simply assumes all of the previous stages were
> fully completed, and it bails out immediately on any error by unwinding
> via failure.
>
> It's easy to see this from the error reporting. Rust can report multiple
> errors within the same phase, but it's unable to report a type error if
> parsing fails. `clang` was designed with this kind of thing as a central
> pillar and is able to continue reporting errors or giving useful results
> to queries from tooling even if there are problems.
>
> It's not at all an easy task, and most compilers are not able to do it.
> A language like Go is simple enough that tooling like completion can be
> done without help from a compiler. However, Rust has powerful local type
> inference, which presents a difficult obstacle. Another enormous
> obstacle is the power of traits - a type can have methods provided by
> traits, if the trait is in scope and the type is covered by an
> implementation, which may be generic.
>
>


-- 
Clark.

Key ID     : 0x78099922
Fingerprint: B292 493C 51AE F3AB D016  DD04 E5E3 C36F 5534 F907
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to