-
-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(language-core): inlay hints for
<component :is>
and `<slot :nam…
…e>` (#4661) Co-authored-by: so1ve <i@mk1.io> Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
- Loading branch information
1 parent
b17ef78
commit 0243d5e
Showing
8 changed files
with
51 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type * as CompilerDOM from '@vue/compiler-dom'; | ||
|
||
export interface InlayHintInfo { | ||
blockName: string; | ||
offset: number; | ||
setting: string; | ||
label: string; | ||
tooltip?: string; | ||
paddingRight?: boolean; | ||
paddingLeft?: boolean; | ||
} | ||
|
||
export function createVBindShorthandInlayHintInfo(loc: CompilerDOM.SourceLocation, variableName: string): InlayHintInfo { | ||
return { | ||
blockName: 'template', | ||
offset: loc.end.offset, | ||
setting: 'vue.inlayHints.vBindShorthand', | ||
label: `="${variableName}"`, | ||
tooltip: [ | ||
`This is a shorthand for \`${loc.source}="${variableName}"\`.`, | ||
'To hide this hint, set `vue.inlayHints.vBindShorthand` to `false` in IDE settings.', | ||
'[More info](https://github.com/vuejs/core/pull/9451)', | ||
].join('\n\n'), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.