-
Notifications
You must be signed in to change notification settings - Fork 15
post code load function #15
Comments
Let me know if there is any other possible way. |
I agree, 2nd use case will be too complex and hard to implement as a library maintainer for each method and varied languages. I was looking for a flexibility of having a setting for callback function as a
CppCodeFixer being a function by the plugin user. post_code_buffer_callback(codeBuffer) is called after buffer is initialed. This gives plugin user an ability to modify the codeBuffer and return a string. This way, the library maintainer doesn't have to factor in all the mapping and the user, if they want can make their own function to modify the buffer initialization. Does this flexibility in leetbuddy seems possible to you? |
So, lets say if you're going to you use cpp then adding these code #include <bits/stdc++.h>
using namespace std; at the beginning when running |
I was hoping to parse through the code buffer.
The
The
User can hard code the function to uncomment the comments for the definition of struct ListNode and return something like:
Technically, the user can do this manually everytime the new code buffer opens. I am just trying to automate them. |
Instead of allowing the user to hard code the function for parsing the code, better to make leetbuddy automatically does this by default. Cause this can benefit all. If you're interested in doing this for cpp open up a PR :) |
Right now, I have a lot of things on my plate. I will send a PR if i am able to finish it. |
Custom callback function execution after loading the any question from LBQuestions on the code buffer.
Use case 1: user can resolve the empty code buffer problem. The custom callback function can detect if buffer is empty and call
:LBReset
automatically.Use case 2: by default the lsp on
cpp
gives errors. Leetcode assume using namespace std but doesn't show that in the code. A user can parse the text and return a new code string with some changes such as string -> std::string, vector -> std::vector and so on (including appropriate header files and ).For the both the use cases, a post code load callback can give user flexibility to change the code according to how he/she wants.
The text was updated successfully, but these errors were encountered: