Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vscode plugin #144

Open
8 of 12 tasks
mantou132 opened this issue Apr 18, 2024 · 4 comments
Open
8 of 12 tasks

Add vscode plugin #144

mantou132 opened this issue Apr 18, 2024 · 4 comments

Comments

@mantou132
Copy link
Owner

mantou132 commented Apr 18, 2024

https://code.visualstudio.com/api/get-started/your-first-extension
vscode-plugin-gem, instead of lit-plugin, use gem-analyzer

  • snippet
  • css highlight
  • html highlight
  • intellisense
    • css hover
    • css code completions
    • html hover
    • html code completions
    • custom element
      • hover // message
      • define // link to
      • inference // rename
      • validation // props type / import missing
  • effect private method colorful
  • code refactor
    • effect/memo order
    • react to gem
    • use swc + swc-plugin add code/remove code
  • jsx intellisense
    • define
    • inference
    • validation // must use ts
@mantou132
Copy link
Owner Author

mantou132 commented Nov 4, 2024

VSCode:

  • 能使用内置 LS? // 好像不可以;反正可以在编译阶段手动添加 plugin 或者扩展自动添加

用正则(好像不能用 LS,Tree-Sitter 又不方便)匹配内联 html css,用 LS(是调用内置 LS?) 进行自动完成、Hover,以支持原生 html,css

Zed:

  • 能使用 Zed 内置的 LS?// 应该可行
  • 能复用 Zed 内置 Tree-Sitter 获取嵌入代码?// 应该不行

使用内置 LS 获取内联 html css(?不行就添加 Tree-Sitter 自己获取),然后调用内置 LS 进行自动完成、Hover,以支持原生 html,css

@mantou132
Copy link
Owner Author

mantou132 commented Nov 12, 2024

vscode/zed plugin -> language service(ts-server) -> ts plugin -> gem-analyzer

@mantou132
Copy link
Owner Author

mantou132 commented Dec 25, 2024

ts plugin 的问题:

  • Zed 中似乎不能通过语言服务扩展支持 // 暂时可以用 tsconfig.json
  • 如何收集 source file 进行自定义元素分析?没有导入的能否分析到?能否用 hack 手段在解析 ts 文件和更新 ts 文件时执行分析
  • 分析 gem element 似乎不能用 ts-morph,能否不依赖 gem-analyzer
  • 获取当前位置 Node 需要手写
  • 如何进行类型验证?能否用个虚拟 ts 文档(位置映射)进行类型诊断、自动完成

@mantou132
Copy link
Owner Author

ts-plugin 自定义元素的问题:

  • 从导入模块中能否找到注册元素类?,能支持自动导入(.d.ts)?
  • 获取模块属性时能否读取装饰器?依赖的装饰器别编译了咋办?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant