Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Retrieving code completion/definitions from an external source#445

Unanswered
marindevs asked this question inQ&A
Discussion options

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?
Or a way to provide the content of this Header.py to be used together with the code from main.py acting as dictionary for the completion and linting checking?

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@marindevs@lieryan

[8]ページ先頭

©2009-2025 Movatter.jp