language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Outside hybridMode, hover might show result of `_VLS_ctx` instead of particular property (off-by-one offset bug)

Open tomblachut opened this issue 1 year ago • 1 comments

Vue - Official extension or vue-tsc version

v2.0.26

VSCode version

1.91.0

Vue version

^3.4.18

TypeScript version

~5.0.4

System Info

No response

Steps to reproduce

  1. hybridMode: false
  2. Consider example file below
  3. Hover over the 1st character of a JS reference inside template, l is the easiest to try.
<script setup lang="ts">

/**
 * docs have to be removed in quick nav, preserved in quick doc!
 */
let local = 323 as number | null;
let l = 323 as number | null;


local;
</script>

<template>
  <div v-text="local"></div>
  <div v-text="l"></div>
  <div>{{local}}</div>
</template>

What is expected?

Screenshot 2024-07-05 at 17 16 01

What is actually happening?

Screenshot 2024-07-05 at 17 15 54

Link to minimal reproduction

No response

Any additional comments?

This is affecting WebStorm sadly, as we're not using hybridMode. I've checked and we sent the same offsets as VSCode does, but in hybridMode, Vue LS returns

[Trace - 16:57:08] Sending request 'textDocument/hover - (20)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/tomblachut/Work/Playgrounds/vue3-vite-ts5/src/components/injections/NullChecksTeamCity.vue"
    },
    "position": {
        "line": 11,
        "character": 15
    }
}


[Trace - 16:57:08] Received response 'textDocument/hover - (20)' in 8ms.
No result returned.

tomblachut avatar Jul 05 '24 15:07 tomblachut

Not sure if this is an upstream issue

so1ve avatar Jul 06 '24 04:07 so1ve