Skip to content

Commit

Permalink
fix: component type incorrect if props option is empty
Browse files Browse the repository at this point in the history
close #317
  • Loading branch information
johnsoncodehk committed Jul 17, 2021
1 parent 9ff68fe commit 3868287
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vscode-client/src/features/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function updatePanel(_panel: vscode.WebviewPanel) {
range: [number, number],
};
const doc = await vscode.workspace.openTextDocument(data.fileName);
const sfc = parse(doc.getText());
const sfc = parse(doc.getText(), { sourceMap: false });
const offset = sfc.descriptor.template?.loc.start.offset ?? 0;
const start = doc.positionAt(data.range[0] + offset);
const end = doc.positionAt(data.range[1] + offset);
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-vue-languageservice/src/virtuals/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type VNodeProps = PickNotAny<VNodeProps_1, VNodeProps_2>;
type AllowedComponentProps = PickNotAny<AllowedComponentProps_1, AllowedComponentProps_2>;
type PropType<T> = PickNotAny<PropType_1<T>, PropType_2<T>>;
type EmitsOptions = PickNotAny<EmitsOptions_1, EmitsOptions_2>;
type DefineComponent<P, E extends EmitsOptions> = PickNotAny<DefineComponent_1<P, any, any, any, any, any, any, E>, DefineComponent_2<P, any, any, any, any, any, any, E>>;
type DefineComponent<P, E extends EmitsOptions = EmitsOptions> = PickNotAny<DefineComponent_1<P, any, any, any, any, any, any, E>, DefineComponent_2<P, any, any, any, any, any, any, E>>;
type CoreGlobalComponents = PickNotAny<PickNotAny<PickNotAny<CoreGlobalComponents_1, CoreGlobalComponents_2>, CoreGlobalComponents_3>, {}>;
type SetupContext<T> = PickNotAny<SetupContext_1<T>, SetupContext_2<T>>;
type AnyArray<T = any> = T[] | readonly T[];
Expand Down

0 comments on commit 3868287

Please sign in to comment.