Skip to content

refactor: mgrating from AbstractPlugin to LspPlugin - #283

Merged
jfcherng merged 10 commits into
masterfrom
refactor/lsp-plugin
May 25, 2026
Merged

refactor: mgrating from AbstractPlugin to LspPlugin#283
jfcherng merged 10 commits into
masterfrom
refactor/lsp-plugin

Conversation

@jfcherng

Copy link
Copy Markdown
Collaborator

jfcherng and others added 2 commits May 23, 2026 04:33
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
- Replace AbstractPlugin base class with LspPlugin
- Consolidate 5 lifecycle methods into on_pre_start_async
- Replace register_plugin/unregister_plugin with classmethods
- Replace storage_path() with ST_STORAGE_PATH constant
- Migrate on_settings_changed to on_initialized_async
- Rename is_applicable to is_applicable_async with IsApplicableContext

See https://lsp.sublimetext.io/migrating_to_lsp_plugin/

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>

@rchl rchl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes:

  • VersionManager could get the package storage path from CopilotPlugin.plugin_storage_path. Just to have a single source of truth for the path.
  • TextCommands don't need SESSION_NAME to be set anymore
  • get_plugin_setting is unused
  • get_plugin_setting_dotted is only used to read the debug setting which feels a bit overkill to me. Especially as it's the only reason that jmespath is required. Also note that the debug setting is not a server settings so it would be better to have it in the root of the configuration file rather than in settings.*. One reason is that the server doesn't care about this setting and another is that changing settings in the root restarts the server while changing settings doesn't.

Comment thread plugin/client.py Outdated
Comment thread plugin/client.py Outdated
Comment thread plugin/client.py
Comment thread plugin/client.py
jfcherng and others added 7 commits May 23, 2026 22:04
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
@jfcherng

Copy link
Copy Markdown
Collaborator Author

get_plugin_setting_dotted is only used to read the debug setting which feels a bit overkill to me. Especially as it's the only reason that jmespath is required. Also note that the debug setting is not a server settings so it would be better to have it in the root of the configuration file rather than in settings.*. One reason is that the server doesn't care about this setting and another is that changing settings in the root restarts the server while changing settings doesn't.

For historical reason, almost all settings in settings are not server settings but plugin settings 😢

@jfcherng
jfcherng merged commit a981425 into master May 25, 2026
2 checks passed
@jfcherng
jfcherng deleted the refactor/lsp-plugin branch May 25, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants