Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
charlespwd committed Dec 6, 2024
1 parent 15cf74e commit cd0aa54
Showing 1 changed file with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,6 @@ export class BlockRenameHandler implements BaseRenameHandler {

const edits: TextEdit[] = [];
if (validSchema.blocks) {
const hasAtTheme = validSchema.blocks.some((block) => block.type === '@theme');
if (hasAtTheme && isPrivate(newBlockName) && isPublic(oldBlockName)) {
const arrayNode = nodeAtPath(ast, ['blocks']);
edits.push({
annotationId,
newText: `, { "type": "${newBlockName}" }`,
range: Range.create(
textDocument.positionAt(offset + arrayNode!.loc.start.offset - 1),
textDocument.positionAt(offset + arrayNode!.loc.end.offset - 1),
),
});
}

for (let i = 0; i < validSchema.blocks.length; i++) {
const blockDef = validSchema.blocks[i];
if (isLocalBlock(blockDef)) {
Expand Down Expand Up @@ -497,11 +484,3 @@ function getBlocksEditsFactory(
});
};
}

function isPrivate(blockName: string) {
return blockName.startsWith('_');
}

function isPublic(blockName: string) {
return !isPrivate(blockName);
}

0 comments on commit cd0aa54

Please sign in to comment.