Skip to content

Commit

Permalink
update snap
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Nov 3, 2023
1 parent c948d82 commit 6b05382
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 88 deletions.
90 changes: 3 additions & 87 deletions packages/language-service/tests/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,91 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`inlay hint: inline-handler-leading > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\inline-handler-leading\\entry.vue:6:19 1`] = `
{
"data": {
"original": {
"data": undefined,
},
"serviceId": "vue/visualizeHiddenCallbackParam",
"uri": "file:///c%3A/Data/Workspace/volar/test-workspace/language-service/inlay-hint/inline-handler-leading/entry.vue",
},
"kind": 2,
"label": "$event =>",
"paddingLeft": undefined,
"paddingRight": true,
"position": {
"character": 18,
"line": 5,
},
"textEdits": undefined,
"tooltip": {
"kind": "markdown",
"value": "\`$event\` is a hidden parameter, you can use it in this callback.
exports[`inlay hint: inline-handler-leading > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\inline-handler-leading\\entry.vue:6:19 1`] = `"$event =>"`;

To hide this hint, set \`vue.inlayHints.inlineHandlerLeading\` to \`false\` in IDE settings.
exports[`inlay hint: missing-props > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\missing-props\\entry.vue:6:19 1`] = `"foo!"`;

[More info](https://github.com/vuejs/language-tools/issues/2445#issuecomment-1444771420)",
},
}
`;
exports[`inlay hint: missing-props > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\missing-props\\entry.vue:6:19 1`] = `
{
"data": {
"original": {
"data": undefined,
},
"serviceId": "html",
"uri": "file:///c%3A/Data/Workspace/volar/test-workspace/language-service/inlay-hint/missing-props/entry.vue",
},
"kind": 2,
"label": "foo!",
"paddingLeft": true,
"position": {
"character": 17,
"line": 5,
},
"textEdits": [
{
"newText": " :foo=",
"range": {
"end": {
"character": 17,
"line": 5,
},
"start": {
"character": 17,
"line": 5,
},
},
},
],
}
`;
exports[`inlay hint: option-wrapper > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\option-wrapper\\entry.vue:2:16 1`] = `
{
"data": {
"original": {
"data": undefined,
},
"serviceId": "vue/visualizeHiddenCallbackParam",
"uri": "file:///c%3A/Data/Workspace/volar/test-workspace/language-service/inlay-hint/option-wrapper/entry.vue",
},
"kind": 2,
"label": "(await import('vue')).defineComponent(",
"paddingLeft": undefined,
"paddingRight": undefined,
"position": {
"character": 15,
"line": 1,
},
"textEdits": undefined,
"tooltip": {
"kind": "markdown",
"value": "This is virtual code that is automatically wrapped for type support, it does not affect your runtime behavior, you can customize it via \`vueCompilerOptions.optionsWrapper\` option in tsconfig / jsconfig.
To hide it, you can set \`\\"vue.inlayHints.optionsWrapper\\": false\` in IDE settings.",
},
}
`;
exports[`inlay hint: option-wrapper > C:\\Data\\Workspace\\volar\\test-workspace\\language-service\\inlay-hint\\option-wrapper\\entry.vue:2:16 1`] = `"(await import('vue')).defineComponent("`;
3 changes: 2 additions & 1 deletion packages/language-service/tests/inlayHint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Range } from 'vscode-languageserver-protocol';

const baseDir = path.resolve(__dirname, '../../../test-workspace/language-service/inlay-hint');
const testDirs = fs.readdirSync(baseDir);
const normalizeNewline = (text: string) => text.replace(/\r\n/g, '\n');

for (const dirName of testDirs) {

Expand Down Expand Up @@ -40,7 +41,7 @@ for (const dirName of testDirs) {
range,
);

const inlayHint = inlayHints[0];
const inlayHint = normalizeNewline(inlayHints[0].label as string);

expect(inlayHint).toBeDefined();
expect(inlayHint).toMatchSnapshot();
Expand Down

0 comments on commit 6b05382

Please sign in to comment.