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

feat: hack support for webstorm(intellij) #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhangciwu
Copy link

@zhangciwu zhangciwu commented Feb 19, 2020

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

Support eggjs project code jump within webstorm in a hacky way, in term of issue: #55

用一种比较取巧的方式支持webstorm的eggjs工程代码中的跳转

@codecov-io
Copy link

codecov-io commented Feb 19, 2020

Codecov Report

Merging #57 into master will decrease coverage by 1.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
- Coverage   98.25%   97.17%   -1.08%     
==========================================
  Files          19       16       -3     
  Lines         743      672      -71     
  Branches      107       99       -8     
==========================================
- Hits          730      653      -77     
- Misses          5        7       +2     
- Partials        8       12       +4
Impacted Files Coverage Δ
src/generators/egg.ts 100% <ø> (ø) ⬆️
src/generators/custom.ts 96.42% <0%> (-3.58%) ⬇️
src/utils.ts 96.19% <0%> (-2.18%) ⬇️
src/generators/config.ts 98.18% <0%> (-1.82%) ⬇️
src/index.ts 94.73% <0%> (-1.32%) ⬇️
src/bin.ts
src/cmd/clean.ts
src/cmd/init.ts

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfed138...d83471f. Read the comment docs.

`\/\/ hack support for webstorm (intellij)
declare module 'egg' {
export interface Context {
service: IService;
Copy link
Member

@whxaxes whxaxes Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样不会导致 ctx 只有一个 service 属性么 ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多次定义一个interface是追加,不是覆盖

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我知道这是追加,但是 webstorm 不是识别不到 egg 的声明么,那这样新加个声明它就可以识别到了?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,就是这么神奇…… 我已经在本地测试过

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好,我待会验证一下

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大佬能教我操作一下吗, 我也是碰到了webstorm下egg方法跳转不了的问题

@chengfeng12138
Copy link

大佬能教我操作一下吗, 怎么样才能在webstorm上实现egg的方法跳转呢?万分感谢~

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

Successfully merging this pull request may close these issues.

4 participants