Sublime Forum

API / SDK dummy package to use with tools like autocomplete or lsp

#1

Is there a dummy package somewhere that exposes the entire sublime API to use for things like autocomplete? It’d be nice to use lsp and type hinting where available but tools can’t find the sublime package because it doesn’t exist.

How are you guys handling this?

0 Likes

#2

Uh… what intellisense is? I don’t think there is a built-in one in ST.

For me, using python-language-server, I rudely put sublime.py and sublime_plugin.py into C:\Program Files\Python38\Lib so that they are recognized (only for intellisense purpose) just like a built-in Python module (from python-language-server’s view point).

@AmjadHD also maintains a documented sublime.py and a type-hinted stub sublime.pyi https://github.com/AmjadHD/sublime_dev

Eventually I have this:

1 Like

#3

This is exactly what I was looking for, thank you!

0 Likes

#4

There are also stubs for sublime and sublime_plugin in https://github.com/tomv564/LSP/tree/master/stubs

1 Like

#5

sublime_lib provides a stub for sublime.py too.

v0.31.0 of the python language server adds the ability to provide extra paths for modules via the extra_paths setting. See the PR for details.

3 Likes

#6

image

confirm working, nice!

1 Like