mdx-js / mdx-analyzer

MDX extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx
MIT License
330 stars 19 forks source link

Typing a `.` triggers TypeScript completions if Astro extension is installed #457

Closed corneliusroemer closed 2 weeks ago

corneliusroemer commented 1 month ago

Initial checklist

Affected packages and versions

v1.8.9

Link to runnable example

No response

Steps to reproduce

  1. Install mdx extension for vscode: https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx
  2. Make .mdx file with following content:
    
    ---
    layout: ../../.././layouts/DocLayout.astro
    title: "Getting an authentication token for programmatic access"
    order: 2
    ---

Need


2. Install vimium extension
3. Enter insert mode in the layout string
4. Type period `.`
5. Type another period `.`
6. Observe result

### Expected behavior

A literal period is inserted

### Actual behavior

Some long string is inserted that I don't want inserted

See Gif:

![2024-07-10 17 19 44](https://github.com/mdx-js/mdx-analyzer/assets/25161793/b5fdd4c1-c569-471d-8ce5-f259da3dca27)

### Runtime

Other (please specify in steps to reproduce)

### Package manager

Other (please specify in steps to reproduce)

### OS

macOS

### Build and bundle tools

Other (please specify in steps to reproduce)
ChristianMurphy commented 1 month ago

Welcome @corneliusroemer! 👋 Sorry you ran into a spot of trouble.

For triage purposes.

  1. What version of VSCode are you using?
    code --version
  2. What other extensions do you have installed in your VSCode?
    code --list-extensions

When you say vimium are you referring to https://github.com/philc/vimium? vimium isn't related to vscode or language servers...

Do you mean something else like https://github.com/VSCodeVim/Vim ?

A general sense is this feels like a conflicting keybindings issue similar to https://github.com/mdx-js/mdx-analyzer/issues/422

github-actions[bot] commented 1 month ago

Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:

Thanks, — bb

stuartherbert commented 1 month ago

I'm having the exact same problem, only I don't have any sort of Vim plugin installed.

code --version
1.91.1
f1e16e1e6214d7c44d078b1f0607b2388f29d729
arm64
code --list-extensions
absszero.vscode-laravel-goto
akashagarwal.markdown-meaningful-wordcount
alefragnani.bookmarks
alefragnani.project-manager
amiralizadeh9480.laravel-extra-intellisense
arturock.gitstash
astro-build.astro-vscode
austenc.tailwind-docs
bbenoist.vagrant
bmewburn.vscode-intelephense-client
bradlc.vscode-tailwindcss
christian-kohler.npm-intellisense
codezombiech.gitignore
coolbear.systemd-unit-file
davidanson.vscode-markdownlint
dbaeumer.vscode-eslint
donjayamanne.githistory
editorconfig.editorconfig
ericadamski.carbon-now-sh
formulahendry.auto-close-tag
formulahendry.auto-rename-tag
github.vscode-github-actions
github.vscode-pull-request-github
glenn2223.live-sass
golang.go
hbenl.vscode-test-explorer
heybourn.headwind
joelday.docthis
kisstkondoros.vscode-codemetrics
macieklad.tailwind-sass-syntax
mechatroner.rainbow-csv
mhutchie.git-graph
mrmlnc.vscode-apache
ms-azuretools.vscode-docker
ms-dotnettools.vscode-dotnet-runtime
ms-python.debugpy
ms-python.isort
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.vscode-jupyter-slideshow
ms-vscode-remote.remote-containers
ms-vscode-remote.remote-ssh-edit
ms-vscode.hexeditor
ms-vscode.makefile-tools
ms-vscode.test-adapter-converter
ms-vsliveshare.vsliveshare
mystk.vscode-mocha-two
octref.vetur
onecentlin.laravel-blade
qcz.text-power-tools
redhat.vscode-yaml
redocly.openapi-vs-code
rido3.wordcount
ritwickdey.liveserver
robinbentley.sass-indented
ronnidc.nunjucks
tuxtina.json2yaml
ujo.findinfilescontext
undefined_publisher.phix-dark
unifiedjs.vscode-mdx
vue.volar
waderyan.gitblame
whatwedo.twig
xdebug.php-debug
xdebug.php-pack
yzhang.markdown-all-in-one
zignd.html-css-class-completion
ziyasal.vscode-open-in-github

It looks like a problem with Intellisense kicking in when it shouldn't. I've tried disabling Intellisense of MDX, but the problem continues.

stuartherbert commented 1 month ago

Disabling the Astro plugin stops the problem from happening.

lrstanley commented 1 month ago

Running into the same exact issue.

$ code --version
1.91.1
f1e16e1e6214d7c44d078b1f0607b2388f29d729
x64
$ code --list-extensions
42crunch.vscode-openapi
a-h.templ
albert.tabout
alefragnani.project-manager
amazonwebservices.aws-toolkit-vscode
antfu.iconify
astro-build.astro-vscode
bradlc.vscode-tailwindcss
davidanson.vscode-markdownlint
dbaeumer.vscode-eslint
eamodio.gitlens
editorconfig.editorconfig
esbenp.prettier-vscode
foxundermoon.shell-format
github.copilot
github.copilot-chat
github.remotehub
github.vscode-pull-request-github
golang.go
graphql.vscode-graphql
graphql.vscode-graphql-execution
graphql.vscode-graphql-syntax
hashicorp.hcl
hashicorp.terraform
heybourn.headwind
james-yu.latex-workshop
jinliming2.vscode-go-template
mitchdenny.ecdc
ms-kubernetes-tools.vscode-kubernetes-tools
ms-playwright.playwright
ms-python.debugpy
ms-python.isort
ms-python.python
ms-toolsai.jupyter
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.vscode-jupyter-slideshow
ms-vscode.cpptools
ms-vscode.remote-repositories
ms-vsliveshare.vsliveshare
naumovs.color-highlight
redhat.vscode-yaml
richie5um2.vscode-sort-json
signageos.signageos-vscode-sops
steoates.autoimport
supermaven.supermaven
svelte.svelte-vscode
timonwong.shellcheck
tomoki1207.vscode-input-sequence
unifiedjs.vscode-mdx
vscode.docker
vscode.yaml
vue.volar
wakatime.vscode-wakatime
wenfangdu.snippet-generator
yoavbls.pretty-ts-errors
yzhang.markdown-all-in-one
znck.grammarly
zxh404.vscode-proto3

Can confirm that disabling Astro does seem to fix the issue. Not sure which side the actual issue is on though.

github-actions[bot] commented 1 month ago

Hi! This was marked as ready to be worked on! Note that while this is ready to be worked on, nothing is said about priority: it may take a while for this to be solved.

Is this something you can and want to work on?

Team: please use the area/* (to describe the scope of the change), platform/* (if this is related to a specific one), and semver/* and type/* labels to annotate this. If this is first-timers friendly, add good first issue and if this could use help, add help wanted.

remcohaszing commented 1 month ago

I have reproduced this bug and confirm this is caused by the combination of the Astro and MDX extensions. It will be fixed by #460 once Volar 2.4 is released.

In case anyone is interesting in further reading: I have a hunch about it’s caused by the same internal issue as #451, but I’m not completely sure.

github-actions[bot] commented 2 weeks ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.