# Development tools for Julia?

**URL:** <https://discourse.julialang.org/t/development-tools-for-julia/5361>\
**Category:** Internals & Design\
**Tags:** package\
**Created:** [August 13, 2017, 5:50pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361 "2017-08-13T17:50:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffwong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffwong/32/1276_2.png) [@jeffwong](https://discourse.julialang.org/u/jeffwong)\
**Post date:** [August 13, 2017, 5:50pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/1 "2017-08-13T17:50:15Z")

</div>

I am a new contributor to Julia and feel like I have a very inefficient workflow. For example, I am trying to contribute to this function in GLM

[https://github.com/JuliaStats/GLM.jl/blob/master/src/linpred.jl#L128](https://github.com/JuliaStats/GLM.jl/blob/master/src/linpred.jl#L128)

I know x is a LinPredModel and has a .pp variable representing the covariates in the regression. I am trying to see if LinPredModel also contains a .weights variable representing weights used in maximum likelihood. When I use github to search for the LinPredModel class I’ve found that it is a subclass of RegressionModel

[https://github.com/JuliaStats/GLM.jl/blob/master/src/GLM.jl#L67](https://github.com/JuliaStats/GLM.jl/blob/master/src/GLM.jl#L67)

But to find the definition of RegressionModel I need to search inside StatsBase, which is a different repo and won’t show up in my original github search. Is there a better way to find where variables and functions are declared while developing?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 13, 2017, 5:56pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/2 "2017-08-13T17:56:13Z")

</div>

`LinPredModel` is an abstract type and thus, does not have any fields. If a function that takes a `LinPredModel` accesses a `.pp` field then it can be inferred that all concrete types that are subtypes of `LinPredModel` **should** have a `.pp` field. This is however not automatically checked and it could be argued that direct access to `.pp` in a function that takes an abstract type is breaking abstractions.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [August 13, 2017, 6:08pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/3 "2017-08-13T18:08:06Z")

</div>

The [Julia VS code extension](https://github.com/JuliaEditorSupport/julia-vscode) allows you to easily navigate to where a type or function is defined (or give you a number of options to choose from). See the [demo](https://github.com/JuliaEditorSupport/julia-vscode/wiki/Navigation). Unfortunately, it’s not working right now for me because of [https://github.com/JuliaEditorSupport/julia-vscode/issues/255](https://github.com/JuliaEditorSupport/julia-vscode/issues/255), but it’s really nice when it does work.

Edit: just wanted to mention that they are working really hard to fix the problem.  
Edit 2: and it’s fixed.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [August 13, 2017, 6:51pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/4 "2017-08-13T18:51:17Z")

</div>

In Juno you can jump to the definition of a symbol with Cmd-J Cmd-G

---

<div class="post-metadata">

**Author:** ![jeffwong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffwong/32/1276_2.png) [@jeffwong](https://discourse.julialang.org/u/jeffwong)\
**Post date:** [August 13, 2017, 7:58pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/5 "2017-08-13T19:58:30Z")

</div>

I think that requires having the full source code of StatsBase locally stored on my machine. Is there a way for Juno to search for definitions just by having the package installed?

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [August 13, 2017, 8:10pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/6 "2017-08-13T20:10:47Z")

</div>

In Julia, you have the full source code of any installed packages locally on your machine. A package is essentially a git repo cloned locally to your machine (on my mac located in ~/.julia/v0.6).

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [August 13, 2017, 8:14pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/7 "2017-08-13T20:14:55Z")

</div>

You also got a bunch of useful commands at the REPL: `@which`, `@less`, `@edit`, `methods`, `methodswith` and more.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [August 13, 2017, 8:57pm UTC](https://discourse.julialang.org/t/development-tools-for-julia/5361/8 "2017-08-13T20:57:31Z")

</div>

Since your question is about the workflow, this is how I’d extend GLM:

1. Fork the repo on github
2. Open the local package folder in the directory I mentioned in a git client (I use GitKraken) and add my own fork as a remote.
3. Make a new branch.
4. Open the local package folder in Juno and use file search and jump-to-definition to acquaint myself with the code.
5. Run the GLM.jl file and use Juno’s capabilities for setting GLM as the ‘working module’ to immediately and iteratively test the effect of any changes I make to the code.
6. PR when happy.
