Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV2-3340 include text in workspace context #609

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

yonip23
Copy link
Contributor

@yonip23 yonip23 commented Aug 8, 2023

  1. fetch at most 2 symbols per "findSymbols" command
  2. instead of only "name - file path", add the entire symbol code, like the retrieval does
  3. cache the BasicContext to later be used by the "get_enriching_context" handler
  4. try to obtain the language field from the binary's metadata response, and use the IDE one as fallback (for both basic and enriching context handlers)

Example resulting symbols text:

file: kaki/kaki/Student2.java
<3 backticks>ECMAScript 6
public class Student2 {
    public void run() {
        System.out.println(\"Welcome to Student 2\");
    }
}
<3 backticks>
file: kaki/kaki/Student.java
<3 backticks>ECMAScript 6
public class Student {
    public void rerunIt() {}
    public void run() {
        Scanner scanner = new Scanner(System.in);
        System.out.println(\"Enter your name: \");
        String name = scanner.nextLine();
        System.out.println(\"Enter your age: \");
        int age = scanner.nextInt();
        System.out.println(\"Your name is \" + name + \" and your age is \" + age);
    }
}
<3 backticks>

(the IDE resolves the language very poorly, I know, that's why (4) is done)

@yonip23 yonip23 requested a review from a team as a code owner August 8, 2023 14:34
Comment on lines +31 to +33
var metadata = fileUri?.let {
binaryRequestFacade.executeRequest(FileMetadataRequest(it))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same logic - used ?.let instead of if/else

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

Successfully merging this pull request may close these issues.

None yet

1 participant