Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Sep 9, 2023
1 parent 4bd0181 commit b05dae6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/vue-language-core/src/parsers/scriptSetupRanges.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as ts from 'typescript/lib/tsserverlibrary';
import type { VueCompilerOptions, TextRange } from '../types';
import { defaultMacros } from '../utils/ts';

export interface ScriptSetupRanges extends ReturnType<typeof parseScriptSetupRanges> { }

Expand Down Expand Up @@ -35,15 +36,7 @@ export function parseScriptSetupRanges(
const bindings = parseBindingRanges(ts, ast, false);
const text = ast.getFullText();
const leadingCommentEndOffset = ts.getLeadingCommentRanges(text, 0)?.reverse()[0].end ?? 0;
const macrosToBeImported: VueCompilerOptions['macros'] = {
defineProps: vueCompilerOptions.macros.defineProps,
defineSlots: vueCompilerOptions.macros.defineSlots,
defineEmits: vueCompilerOptions.macros.defineEmits,
defineExpose: vueCompilerOptions.macros.defineExpose,
defineModel: vueCompilerOptions.macros.defineModel,
defineOptions: vueCompilerOptions.macros.defineOptions,
withDefaults: vueCompilerOptions.macros.withDefaults,
};
const macrosToBeImported = defaultMacros;

ast.forEachChild(node => {
const isTypeExport = (ts.isTypeAliasDeclaration(node) || ts.isInterfaceDeclaration(node)) && node.modifiers?.some(mod => mod.kind === ts.SyntaxKind.ExportKeyword);
Expand Down

0 comments on commit b05dae6

Please sign in to comment.