Git Product home page Git Product logo

Comments (4)

mopemope avatar mopemope commented on August 18, 2024

No, it must do all of the server. Server analyzed the source, it has type information and expression information and you need to implement it using it.
Contributions are extremely welcome !
Thanks.

from meghanada-server.

xqliu avatar xqliu commented on August 18, 2024

Got the thoughts, that's reasonable design, I will try to implement it.

Then we can discuss on how to handle basic completion and smart completion and make them work at the same time.

Thanks.

from meghanada-server.

xqliu avatar xqliu commented on August 18, 2024

@mopemope Would you please help to review the pull request and offer your thoughts

Client side:
mopemope/meghanada-emacs#102

Server side:
#61

Basically in order to make it easier for end user, I have combine the so called "smart completion" and normal completion together through implement a custom comparator for CandidateUnit, and offers higher rank for those with exactly same return type with the variable/field to be assigned.

The current implementation logic is:

For the follow code fragments

String a = "";
int i = a. //<-- Cursor position 
String a = "";
int i = 0;
i = a.//<-- Cursor position
public class A {
  private int intMember;
  private void aMethod() {
    String a = "";
    intMember = a. //<-- Cursor position 
  }
}

then all methods of String class with return type of int will be list before other methods.

Current support:

  • class member assignment
  • local variable assignment

Note:

  • For code fragment 2 and 3, the buffer needs to be saved first for the meghanada-server to generate correct output, otherwise the return list will be same as current.
  • For code fragment 1, I will sent the type information(int) directly from Emacs to server side for it to do match, so there's no need to save the buffer.

Thanks :)

from meghanada-server.

xqliu avatar xqliu commented on August 18, 2024

Already added generic support for the smart completion of assignment.

from meghanada-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.