Skip to content

Commit

Permalink
Add BlockRenameHandler
Browse files Browse the repository at this point in the history
Co-authored-by: Navdeep Singh <[email protected]>

Whenever a block gets renamed, the following will now happen:
  1. References in files with a {% schema %} will be changed
  2. References in template files will be changed
  3. References in section groups will be changed
  4. References in {% content_for "block", type: "oldName" %} will be changed
  • Loading branch information
charlespwd committed Jan 6, 2025
1 parent 35074ed commit ae65e1f
Show file tree
Hide file tree
Showing 5 changed files with 870 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { path } from '@shopify/theme-check-common';
import { Connection } from 'vscode-languageserver';
import { RenameFilesParams } from 'vscode-languageserver-protocol';
import { ClientCapabilities } from '../ClientCapabilities';
import { DocumentManager } from '../documents';
import { BaseRenameHandler } from './BaseRenameHandler';
import { AssetRenameHandler } from './handlers/AssetRenameHandler';
import { BlockRenameHandler } from './handlers/BlockRenameHandler';
import { SnippetRenameHandler } from './handlers/SnippetRenameHandler';

/**
Expand All @@ -26,6 +26,7 @@ export class RenameHandler {
this.handlers = [
new SnippetRenameHandler(documentManager, connection, capabilities, findThemeRootURI),
new AssetRenameHandler(documentManager, connection, capabilities, findThemeRootURI),
new BlockRenameHandler(documentManager, connection, capabilities, findThemeRootURI),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import {
WorkspaceEdit,
} from 'vscode-languageserver-protocol';
import { ClientCapabilities } from '../../ClientCapabilities';
import {
AugmentedLiquidSourceCode,
AugmentedSourceCode,
DocumentManager,
isLiquidSourceCode,
} from '../../documents';
import { DocumentManager, isLiquidSourceCode } from '../../documents';
import { assetName, isAsset } from '../../utils/uri';
import { BaseRenameHandler } from '../BaseRenameHandler';

Expand Down
Loading

0 comments on commit ae65e1f

Please sign in to comment.