Skip to content

Commit 8dd5b1c

Browse files
committed
refactor: remove extra props hover info logic due to upstream resolved
vuejs/core#5166
1 parent e339424 commit 8dd5b1c

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

packages/vscode-vue-languageservice/src/services/hover.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function register({ sourceFiles, htmlLs, pugLs, getCssLs, getTsLs, vueHos
2929
return result;
3030
}
3131

32-
function onTs(uri: string, position: vscode.Position, isExtra = false) {
32+
function onTs(uri: string, position: vscode.Position) {
3333

3434
let result: vscode.Hover | undefined;
3535

@@ -48,25 +48,9 @@ export function register({ sourceFiles, htmlLs, pugLs, getCssLs, getTsLs, vueHos
4848
const tsHover = tsLs.doHover(
4949
tsLoc.uri,
5050
tsLoc.range.start,
51-
isExtra,
5251
);
5352
if (!tsHover) continue;
5453

55-
if (!isExtra && tsLoc.type === 'embedded-ts' && tsLoc.data.capabilities.extraHoverInfo) {
56-
const definitions = findDefinitions.on(uri, position) as vscode.LocationLink[];
57-
for (const definition of definitions) {
58-
const extraHover = onTs(definition.targetUri, definition.targetSelectionRange.start, true);
59-
if (!extraHover) continue;
60-
if (!vscode.MarkupContent.is(extraHover.contents)) continue;
61-
const extraText = extraHover.contents.value;
62-
for (const extraTextPart of extraText.split('\n\n')) {
63-
if (vscode.MarkupContent.is(tsHover.contents) && !tsHover.contents.value.split('\n\n').includes(extraTextPart)) {
64-
tsHover.contents.value += `\n\n` + extraTextPart;
65-
}
66-
}
67-
}
68-
}
69-
7054
if (tsHover.range) {
7155
// ts -> vue
7256
const hoverRange = { start: position, end: position };

packages/vue-code-gen/src/generators/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const capabilitiesSet = {
1313
tagHover: { basic: true },
1414
event: { basic: true, diagnostic: true },
1515
tagReference: { references: true, definitions: true, rename: true, },
16-
attr: { basic: true, extraHoverInfo: true, diagnostic: true, references: true, definitions: true, rename: true, },
16+
attr: { basic: true, diagnostic: true, references: true, definitions: true, rename: true, },
1717
attrReference: { references: true, definitions: true, rename: true, },
1818
scopedClassName: { references: true, definitions: true, rename: true, },
1919
slotName: { basic: true, diagnostic: true, references: true, definitions: true, completion: true, },

packages/vue-code-gen/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export interface TsMappingData {
55
doRename?: (oldName: string, newName: string) => string,
66
capabilities: {
77
basic?: boolean,
8-
extraHoverInfo?: boolean,
98
references?: boolean,
109
definitions?: boolean,
1110
diagnostic?: boolean,

0 commit comments

Comments
 (0)