remcohaszing / monaco-tailwindcss

Tailwindcss intellisense support in Monaco editor
https://monaco-tailwindcss.js.org
MIT License
87 stars 14 forks source link

No hints in React #83

Closed rick-chou closed 1 year ago

rick-chou commented 1 year ago

Hey, I'm trying to build my own React REPL in which I've built in tailwind syntax, but it seems that after monaco-editor is configured with typescript language, the library doesn't support syntax hints, but you can still see the content on mouse hover, for example

https://monaco-tailwindcss.js.org/#mdx

remcohaszing commented 1 year ago

I’m not really sure I understand. Can you post a screenshot / screencast to show the problem? Or ideally a repo to reproduce it.

rick-chou commented 1 year ago

Sorry , I'm still a novice English speaker, thank you very much for your reply!

What I mean is that the code hints work when the language of monaco-editor is html / css, but not when the language is typescript.

language : html -- works

Screenshot 2023-08-30 at 21 04 56

language : typescript -- not work

Screenshot 2023-08-30 at 21 05 10

My question is, is it possible to set the language of monaco-editor to typescript and still have the syntax prompt?

remcohaszing commented 1 year ago

Sorry , I'm still a novice English speaker, thank you very much for your reply!

No problem! So far it’s not that bad actually.


Ah, I think I understand the problem.

For HTML

  1. https://monaco-tailwindcss.js.org/#html
  2. Move the cursor towards the end of a class attribute
  3. Press Space followed by b
  4. A pop-up appears showing all autocompletions starting with b

For MDX

  1. https://monaco-tailwindcss.js.org/#mdx
  2. Move the cursor towards the end of a className prop
  3. Press Space followed by b
  4. Nothing happens
  5. Press Ctrl + Space
  6. A pop-up appears showing all autocompletions starting with b

For TypeScript you’re seeing the same behaviour as for MDX?

rick-chou commented 1 year ago

Yes, that's what I meant. But I'm using Macos. Press Ctrl + Space triggers the switching of input method

rick-chou commented 1 year ago

BTW, Why does mdx needs an extra button Ctrl to show the pop up?

remcohaszing commented 1 year ago

CompletionItemProvider accepts an optional array triggerCharacters. As far as I’m aware, this is supposed to determine after which character the completions show up automatically. I don’t understand why this behaviour is currently different between HTML and MDX.

I’m not going to look into this for now, but you can if you want. Feel free to ask if you have any questions.

rick-chou commented 1 year ago

Anyway thanks a lot!