mbuscemi / elm-lens Goto Github PK
View Code? Open in Web Editor NEWElm code visualizations for maximum productivity in Atom
Home Page: https://atom.io/packages/elm-lens
License: MIT License
Elm code visualizations for maximum productivity in Atom
Home Page: https://atom.io/packages/elm-lens
License: MIT License
[Enter steps to reproduce:]
Atom: 1.23.1 x64
Electron: 1.6.15
OS: Mac OS X 10.13.1
Thrown From: elm-lens package 0.1.1
Uncaught TypeError: Cannot read property 'substr' of undefined
At /Users/dan/.atom/packages/elm-lens/lib/text-editor-facade.js:27
TypeError: Cannot read property 'substr' of undefined
at TextEditorFacade.isElmFile (/packages/elm-lens/lib/text-editor-facade.js:27:49)
at Project.processAllElmFiles (/packages/elm-lens/lib/project.js:41:48)
at /packages/elm-lens/lib/project.js:31:35
atom-slime 2.8.0
autocomplete-haskell 1.0.1
elm-format 3.0.0
elm-lens 0.1.1
elmjutsu 7.2.1
ide-haskell 2.2.0
indent-detective 0.1.1
ink 0.7.11
julia-client 0.6.6
language-elm 1.5.0
language-julia 0.14.0
language-lisp 0.2.0
latex-completions 0.3.3
lisp-paredit 0.6.0
teletype 0.4.0
tool-bar 1.1.0
uber-juno 0.1.2
Additionally, this change should also cease doing on-save AST re-parsing when the tags are toggled off. When turning them back on, the whole project should be re-processed.
Library projects expose functions without references for good reason. Elm Lens should be able to recognize exposed library methods and provide special markup rules for those.
Issue came to my attention from here: stil4m/elm-analyse#10
A nice enhancement would be to add an arrow or something at the end of the references text, if only one reference exist. Clicking this would jump straight to the given line. Would be really nice if it's a bit easier to jump to a reference. A popup on hover with the references or something could also work.
Love elm-lens btw! โค๏ธ
There's a noticeable lag when I start up atom. Atom's timecop package shows this
Here the plugin took over 40s to startup. It seems the startup time depends on which directory I start atom in.
When I run it inside small project (atom ~/path/to/my/project), it takes 0.5s to start
When I run it inside my home directory (atom .) it takes 40s to start
For example in the following file:
module Test exposing (foo)
type alias Thing =
{ x : Int
}
foo : Int -> Int
foo x =
let
f : Thing
f =
{ x = x }
in
f.x
Thing
is annotated with 0 internal references, while it is being used within a let expression in foo
.
I'm using version 0.1.2
of elm-lens.
I have a module that import Tangram with:
import Tangram.Model as Tangram
import Tangram.Types as Tangram
import Tangram.Update as Tangram
import Tangram.View as Tangram
and use
Tangram.subscriptions
that is coming from Tangram.Model
but in Tangram.Model it says that external references are 0 while it should say 1.
Maybe the plug-in is not taking in consideration the multiple import with the same name?
Changing the import to
import Tangram.Model
import Tangram.Types
import Tangram.Update
import Tangram.View
the counting is correct
The lens lines are showing up randomly, rather than above function headers they are in the middle of functions, and they are far from the functions they describe.
Since this project was last worked on 2 years ago and makes no mention of Elm 0.19, am I to assume it's abandonware?
elm-package.json
.When I change the zoom level, the metadata from elm-lens is not scaled with my font. It would be nice to have the same zoom level on the metadata as on my code. For example, when you give a presentation and increase your font size.
Very cool concept!
I have a large Elm project (>15,000 LOC). It semi-works, but some functions are not showing up as having any external references when they do.
Not sure if this is a time-out thing or what.
(I have an 1800 line Update
file, for example, and many functions that are used in that file are showing up as having 0 external references.)
Seems to work for the smaller files.
Let me know if there is something I can do to help debug...
Awesome project!
I just wanted to see if you had any opinions around the feasibility of a VSCode version of this tool?
Thanks ๐
This happens consistently in at least two projects.
I'm not an expert in Elm, but I believe that is probably because is doing some confusion with Platform.Task
You can see the source code in action in this ellie: https://ellie-app.com/cvmGqQdtda1/0
If I rename Task
to TaskItem
per example, the reference count becomes correct:
Failed to load resource: net::ERR_FILE_NOT_FOUND
fontawesome-webfont.woff2
, fontawesome-webfont.woff
, fontawesome-webfont.ttf
reported by @halohalospecial
module Table imports another module using the 'as' notation
import Shots as S
...the module then uses a function from that module...
processShots yndex m = S.process yndex m
Viewing the Shots module in elm-lens shows the function 'process' to have 0 external calls
Hi Matt,
I love this plugin even more than elm-test-runner. I'm running version 0.2.0, and I've just noticed one issue with counting external references for union types whose constructors are exposed.
I have a module called Types.elm, declared as follows:
module Types exposing (Model, Entity, EntityClass(..), Sprite, View(..))
And I import these types into my Main.elm as follows:
import Types exposing (Model, Entity, EntityClass(..), Sprite, View(..))
When I look in the Types.elm file, the reference counts for Model, Entity and Sprite are fine - but for the union types EntityClass and View, it says they have 0 external references.
However, they definitely do have external references: here is an example from Main.elm:
[Enter steps to reproduce:]
Is this expected behavior? Does elm-lens really need access to your address book to function properly?
Atom: 1.41.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.1
Thrown From: elm-lens package 0.3.0
Uncaught Error: EPERM: operation not permitted, scandir '/Users/cyrus/Library/Application Support/AddressBook'
At fs.js:115
Error: EPERM: operation not permitted, scandir '/Users/cyrus/Library/Application Support/AddressBook'
at Object.readdirSync (fs.js:764:3)
at Object.fs.readdirSync (ELECTRON_ASAR.js:641:39)
at Workspace.elmFileList (/packages/elm-lens/lib/workspace.js:57:19)
at Workspace.findElmFilesInSubdirectories (/packages/elm-lens/lib/workspace.js:43:29)
at /packages/elm-lens/lib/workspace.js:47:45
at Array.forEach (<anonymous>)
at Workspace.findElmFilesInSubdirectories (/packages/elm-lens/lib/workspace.js:46:24)
at /packages/elm-lens/lib/workspace.js:47:45
at Array.forEach (<anonymous>)
at Workspace.findElmFilesInSubdirectories (/packages/elm-lens/lib/workspace.js:46:24)
at /packages/elm-lens/lib/workspace.js:47:45
at Array.forEach (<anonymous>)
at Workspace.findElmFilesInSubdirectories (/packages/elm-lens/lib/workspace.js:46:24)
at /packages/elm-lens/lib/workspace.js:23:45
at Array.forEach (<anonymous>)
at Workspace.getAllElmFiles (/packages/elm-lens/lib/workspace.js:22:32)
at Project.processAllElmFiles (/packages/elm-lens/lib/project.js:21:41)
at /packages/elm-lens/lib/project.js:31:35
-0:38.2.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
atom-beautify 0.33.4
atom-elixir 0.2.3
atom-elixir-formatter 1.0.6
atom-material-syntax 1.0.8
atom-material-ui 2.1.3
atom-ternjs 0.19.1
atom-typescript 13.2.1
auto-detect-indentation 1.3.0
autocomplete-modules 2.3.0
busy-signal 2.0.1
elm-format 3.2.0
elm-lens 0.3.0
elmjutsu 9.11.0
file-icons 2.1.31
firacode 0.3.0
gloom 0.6.5
html-to-elm 0.2.0
hyperclick 0.1.5
intentions 1.1.5
language-babel 2.85.0
language-docker 1.1.8
language-ejs 0.4.0
language-elixir 0.22.1
language-elm 1.5.0
linter 2.3.0
linter-ui-default 1.7.1
markdown-pdf 2.2.0
pdf-view 0.71.0
pigments 0.40.2
single-click-open 0.2.2
sort-lines 0.19.0
sync-settings 0.8.6
todo-show 2.3.2
In the Poolshots app, the Balls.elm file is not parsed.
Invite sent to 'mbuscemi' to investigate.
Just looking briefly at the source, it looks like this is completely coupled to Atom, which is fine, but it means no other editor can use this really neat tool.
What would be interesting is if this were an npm package, that could be used like:
$ npm install -g elm-lens
$ elm-lens ./src/*.elm
And it would send out (maybe json?) information about each function, maybe something like:
[
{
"file": "path/to/file.elm",
"line": 5,
"name": "nameOfFunction",
"definition": "nameOfFunction : Int -> Int",
"externalReferences": [{ "file": "other/file.elm", "line": 72 }],
"internalReferences": []
},
// ...
]
Not sure you'd need all that information, and maybe you could scope things a little better to make the json output much smaller, but that's the general gist. From there, you could pipe it to a file in unix like elm-lens ./src/*.elm > elm-lens.json
, or from an editor, consume that json and show the appropriate information in the editor.
Haven't looked into the source code enough to know what sort of effort this would be, but it will satisfy 100% of the other issues that will crop up of "please support editor x."
I installed elm-lens but nothing changed, do i miss something ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.