-
Notifications
You must be signed in to change notification settings - Fork 24
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
Supporting Custom autocompletion functions using a custom-defined api #65
Comments
Hello @matkuki, |
I'm on it, will post details tomorrow. |
Correct, this can be done in the
From what I understand, you would want the autocompletion to show this: If I am, then this # Import everything we need
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.Qsci import *
# Create the main PyQt application object
application = QApplication(sys.argv)
# Create a QScintila editor instance
editor = QsciScintilla()
# Disable autocompletion
editor.setAutoCompletionSource(QsciScintilla.AcsNone)
# Connect UserList signal
def userListCallback(_id, _string):
print(_id, _string)
editor.userListActivated.connect(userListCallback)
# Show an example UserList
def showUserListExample(*args):
editor.showUserList(1, ["ndif2(abstol, reltol, file1, file2)", "two", "three"])
QTimer.singleShot(500, showUserListExample)
# Create the main window
main_window = QMainWindow()
main_window.setCentralWidget(editor)
main_window.resize(800, 600)
main_window.show()
# Execute the application
application.exec_() With the above Hope it helps |
Hello @matkuki ,
#1: I would like to support custom autocompletion functions to be enabled while using the editor, could you tell me where can i edit it in the code?
I am guessing it will be in the "customeditor.py" file right?
#2: I have read in the documentation that you only make the function using a keyword and when using brackets it will be called through the call tip, isn't there a way to modify it?
Example of my wanted function style to be supported:-
Supported function appearing to be selected: ndif2(abstol, reltol, file1, file2);
Supported call tip to appear after using "(" : ndif2("1e-5","5e-2","sim.nd","$ENV{REF}/sim.nd");
my goal is to use the call tip to support a written example as a guide for me while I am writing
Are there any suggestions?
Thanks & Regards
The text was updated successfully, but these errors were encountered: