Skip to content

Adjustments for ST4 #132

@FichteFoll

Description

@FichteFoll

Sublime Text 4 included a lot of changes relevant to us, notably the addition of a Python 3.8 plugin host (and later 3.13, potentially 3.14) and a couple changes to the API like making settings iterable.

Python 3.8

Compat/types

  • Remove enum, pathlib, and typing from _compat and import the native versions instead. (f3c0e89)
  • Possibly use from __future__ import annotations. (13f7637)
  • Simplify/update some type 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions