You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sequenceDiagram
actor A as User
participant C as Client
participant S as Server
A-->>C: Select code and right click
C->>+S: "textDocument/codeAction" request,<br>context.triggerKind: "invoked"
S->>-C: CodeAction[]<br>kind: "refactor.extract"<br>command: "shopifyLiquid/extractSnippet"<br>args: uri, range
C-->>A: Show options
A-->>C: Select "Extract to new file"
C->>S: "workspace/executeCommand" request<br>command: "shopify/extractSnippet"<br>args: uri, range
activate S
S->>S: Compute WorkspaceEdit for refactor
S->>C: "workspace/applyEdit" request
activate C
C->>S: applied!
deactivate C
S->>C: done!
deactivate S
Loading
Therefore here are the things I need to build:
A CodeAction provider of kind "refactor.extract"
A ExecuteCommand provider for "shopify/extractSnippet" commands
would “Select to refactor into a new file” be possible to take a “Section block” and move it to a /blocks/_blockName.liquid file, and then update the schema for that section to now accept that block?
The LSP defines some CodeActionKinds that have special meanings in some Language Clients. One of those is the
RefactorExtract
action kind.We could probably offer a
RefactorExtract
action when you highlight a large range of text inside a section|template|snippet.When executed, we could do something like this:
snippets/Z.liquid
with the contents of YTo be answered:
Resources
The text was updated successfully, but these errors were encountered: