- Notifications
You must be signed in to change notification settings - Fork220
-
When I’m editing, I want to have access to some “built in” functions that should be available in the Editor (Completion and Definition) without importing. The code for those built ins will be something like this: importnumpyasnpmyHeaderVar=123defmyFunction(x):returnnp.abs(x) And in the editor itself I will have: mylist= [1,2,3,4]myFunction(mylist)some_value+=myHeaderVar This is just a silly example to capture the idea. When I start typing the myF.. it should provide the completion for the myFunction as it is present on the "built in headers". So my question really is, there is something in the pylsp that support this? Like, loading this header.py from the same workspace that the main.py is and making the content of tha file available? |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
-
You could create your own project-specific pylsp plugin. Disable the built-in completion plugin, make it so that it uses your completion plugin and your completion plugin will call the default completion and add whatever extras you need. Thecookiecutter-pylsp-plugin might be useful to you if you want to create your own plugin. |
BetaWas this translation helpful?Give feedback.