From 3e6e45c1d53dbd5f19d18233475d7249e4630205 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Wed, 19 Jun 2024 01:54:42 +0800 Subject: [PATCH] chore(language-core): import `toString` from `muggle-string` --- packages/language-core/lib/codegen/template/elementProps.ts | 4 ++-- packages/language-core/lib/codegen/template/vIf.ts | 2 +- packages/language-core/lib/plugins/file-md.ts | 4 ++-- packages/language-core/lib/types.ts | 3 ++- packages/language-core/lib/virtualFile/computedMappings.ts | 5 +++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/language-core/lib/codegen/template/elementProps.ts b/packages/language-core/lib/codegen/template/elementProps.ts index f8d2baa38e..dcbd5a9102 100644 --- a/packages/language-core/lib/codegen/template/elementProps.ts +++ b/packages/language-core/lib/codegen/template/elementProps.ts @@ -1,16 +1,16 @@ import * as CompilerDOM from '@vue/compiler-dom'; import { camelize } from '@vue/shared'; import { minimatch } from 'minimatch'; +import { toString } from 'muggle-string'; import type { Code, VueCodeInformation, VueCompilerOptions } from '../../types'; import { hyphenateAttr, hyphenateTag } from '../../utils/shared'; import { conditionWrapWith, variableNameRegex, wrapWith } from '../common'; import { generateCamelized } from './camelized'; import type { TemplateCodegenContext } from './context'; +import { generateEventArg, generateEventExpression } from './elementEvents'; import type { TemplateCodegenOptions } from './index'; import { generateInterpolation } from './interpolation'; import { generateObjectProperty } from './objectProperty'; -import { toString } from '@volar/language-core'; -import { generateEventArg, generateEventExpression } from './elementEvents'; export function* generateElementProps( options: TemplateCodegenOptions, diff --git a/packages/language-core/lib/codegen/template/vIf.ts b/packages/language-core/lib/codegen/template/vIf.ts index bf1ae7cf7d..e12e14b215 100644 --- a/packages/language-core/lib/codegen/template/vIf.ts +++ b/packages/language-core/lib/codegen/template/vIf.ts @@ -1,5 +1,5 @@ -import { toString } from '@volar/language-core'; import * as CompilerDOM from '@vue/compiler-dom'; +import { toString } from 'muggle-string'; import type { Code } from '../../types'; import { newLine } from '../common'; import type { TemplateCodegenContext } from './context'; diff --git a/packages/language-core/lib/plugins/file-md.ts b/packages/language-core/lib/plugins/file-md.ts index d00e330177..48d8f313d9 100644 --- a/packages/language-core/lib/plugins/file-md.ts +++ b/packages/language-core/lib/plugins/file-md.ts @@ -1,6 +1,6 @@ -import { SourceMap, toString } from '@volar/language-core'; +import { SourceMap } from '@volar/language-core'; import type { SFCBlock } from '@vue/compiler-sfc'; -import type { Segment } from 'muggle-string'; +import { Segment, toString } from 'muggle-string'; import type { VueLanguagePlugin } from '../types'; import { buildMappings } from '../utils/buildMappings'; import { parse } from '../utils/parseSfc'; diff --git a/packages/language-core/lib/types.ts b/packages/language-core/lib/types.ts index 296966df3f..577c92f0ab 100644 --- a/packages/language-core/lib/types.ts +++ b/packages/language-core/lib/types.ts @@ -1,8 +1,9 @@ +import type { CodeInformation } from '@volar/language-core'; import type * as CompilerDOM from '@vue/compiler-dom'; import type { SFCParseResult } from '@vue/compiler-sfc'; +import type { Segment } from 'muggle-string'; import type * as ts from 'typescript'; import type { VueEmbeddedCode } from './virtualFile/embeddedFile'; -import type { CodeInformation, Segment } from '@volar/language-core'; export type { SFCParseResult } from '@vue/compiler-sfc'; diff --git a/packages/language-core/lib/virtualFile/computedMappings.ts b/packages/language-core/lib/virtualFile/computedMappings.ts index 90df46b412..27a7376a14 100644 --- a/packages/language-core/lib/virtualFile/computedMappings.ts +++ b/packages/language-core/lib/virtualFile/computedMappings.ts @@ -1,8 +1,9 @@ -import { CodeMapping, Segment, replaceSourceRange } from '@volar/language-core'; +import type { CodeMapping } from '@volar/language-core'; import { computed } from 'computeds'; +import { Segment, replaceSourceRange } from 'muggle-string'; import type * as ts from 'typescript'; -import type { Sfc, VueCodeInformation } from '../types'; import { allCodeFeatures } from '../plugins/shared'; +import type { Sfc, VueCodeInformation } from '../types'; export function computedMappings( snapshot: () => ts.IScriptSnapshot,