sublime_lib icon indicating copy to clipboard operation
sublime_lib copied to clipboard

ST API adjustments

Open FichteFoll opened this issue 6 years ago • 2 comments

The next ST build will include the following changes. I'm just listing those that are relevant for us for now.

  • [ ] Settings objects can be accessed like a dict natively.
  • [ ] Functions to iterate and find syntax definitions.
  • [ ] New enum for completion item kind.

FichteFoll avatar Nov 13 '19 03:11 FichteFoll

I went through the current API docs to produce a hopefully-complete list.

Python 3.8

Compat/types

  • [ ] Remove enum, pathlib, and typing from _compat and import the native versions instead.
  • [ ] Simplify/update some type annotations. Possibly use from __future__ import annotations.

Other

  • [ ] Make SettingsDict.update's other argument positional-only.

Sublime 4 API

Flags

New values for existing enums

  • [ ] PopupOption: KEEP_ON_SELECTION_MODIFIED, HIDE_ON_CHARACTER_EVENT.
  • [ ] OpenFileOption: ADD_TO_SELECTION, REPLACE_MRU, SEMI_TRANSIENT
  • [ ] CompletionOptions: DYNAMIC_COMPLETIONS, INHIBIT_REORDER
  • [ ] QuickPanelOption: WANT_EVENT

New enums

  • [ ] CompletionFormat: TEXT, SNIPPET, COMMAND
  • [ ] KindId: AMBIGUOUS, KEYWORD, TYPE, FUNCTION, NAMESPACE, NAVIGATION, MARKUP, VARIABLE, SNIPPET, COLOR_*
  • [ ] Maybe one for the preconstructed kind tuples as well.
  • [ ] SymbolSource: ANY, INDEX, OPEN_FILES
  • [ ] SymbolType: ANY, DEFINITION, REFERENCE

Syntax

  • [ ] Reimplement list_syntaxes and get_syntax_for_scope using sublime.list_syntaxes and sublime.find_syntax_by_scope.
  • [ ] Return sublime.Syntax instead of SyntaxInfo namedtuple.

Settings

  • [ ] Implement methods requiring iterability. (Could there be performance concerns here?)

Panels

  • [ ] Reimplement Panel.exists() using View.element()?????

show_selection_panel

  • [ ] Handle QuickPanelItem arguments.
  • [ ] Add placeholder argument.
  • [ ] Handle WANT_EVENT (i.e. make sure we pass the correct number of arguments in either case).

Ecosystem

  • [ ] Create a dependency for Sublime type stubs and use it rather than bundling stubs here.
  • [ ] Update UnitTesting if needed.

Thom1729 avatar Apr 04 '21 16:04 Thom1729

Feel free to edit my initial post with these and track them there.

FichteFoll avatar Apr 04 '21 19:04 FichteFoll