Giter Site home page Giter Site logo

vscode-node-modules's Introduction

  • 👋 Hi, I’m @zyrong
  • 👀 I’m interested in ...
  • 🌱 I’m currently learning ...
  • 💞️ I’m looking to collaborate on ...
  • 📫 How to reach me ...

vscode-node-modules's People

Contributors

tjx666 avatar zyrong avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

tjx666 askin667

vscode-node-modules's Issues

包名悬浮提示的几个建议

  1. 目前实现依赖解析 ast,感觉有点杀鸡用牛刀,如果可以的话全用正则实现会性能会更好
  2. 目前代码中存在拼接正则的情况: https://github.com/zyrong/vscode-node-modules/blob/master/src/pkgname-hover-tip.ts#L60
    • 可以的话不要用拼接正则,有些情况拼接出来的正则性能很差
    • 拼接出来的正则非法情况没有 try/catch 处理
  3. https://github.com/zyrong/vscode-node-modules/blob/master/src/pkgname-hover-tip.ts#L60 range 有可能返回的是 undefined, 这会导致 hoverWord 是整个文件的文本,从而导致拼出非法的正则

代码没细看,可能有说错的地方。

不存在对应语言包

image

Version: 1.75.1 (Universal)
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
Date: 2023-02-08T21:34:59.000Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin x64 22.3.0
Sandboxed: No

[Bug] pnpm 下面的包 package.json 无法跳转

复现:

  1. 随便进一个 package
  2. pnpm install vue
  3. 打开 node_modules/vue/package.json
  4. 尝试跳转 @vue/runtime-dom 失败

原因:

project/node_modules/vue 是一个软连接,链接到 project/node_modules/.pnpm/[email protected]/node_modules/vue,在其真实的位置目录结构是可以加载到 @vue/runtime-dom 的。

image

解决方法:在解析一个 package.json 的依赖时,如果它是一个符号链接,应该先取到它在磁盘上的真实地址,再相对于真实的文件地址做解析

最近发现一个有意思的包,这个项目的包路径解析好像是自己写的,我感觉可以直接用这个包:https://www.npmjs.com/package/resolve

press cmd + hover on version number show warning

image

package.json:

{
    "name": "packagejsonissue",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
        "axios": "0.0.1"
    }
}

If the version number is prefix with ^ will no issue, like "axios": "^0.0.1"

Versions:

VSCode: 1.65.0-insider
MacOS: 12.2.2
node_modules: v1.1.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.