Skip to content

Commit

Permalink
Expose organize imports only when typescript session is active (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Nov 10, 2021
1 parent 4b7d227 commit ac53f5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LSP-typescript.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"caption": "LSP-typescript: Organize Imports",
"command": "lsp_execute",
"command": "lsp_typescript_organize_imports",
"args": {
"session_name": "LSP-typescript",
"command_name": "_typescript.organizeImports",
Expand Down
6 changes: 5 additions & 1 deletion commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from LSP.plugin.core.registry import LspTextCommand
from LSP.plugin.core.typing import Optional
from LSP.plugin.core.views import text_document_position_params
from LSP.plugin.execute_command import LspExecuteCommand
from LSP.plugin.locationpicker import LocationPicker
import functools
import sublime
Expand All @@ -13,8 +14,11 @@
SESSION_NAME = "LSP-typescript"


class LspTypescriptCallsCommand(LspTextCommand):
class LspTypescriptOrganizeImportsCommand(LspExecuteCommand):
session_name = SESSION_NAME


class LspTypescriptCallsCommand(LspTextCommand):
session_name = SESSION_NAME

def is_enabled(self) -> bool:
Expand Down

0 comments on commit ac53f5b

Please sign in to comment.