Closed manuscrypt closed 8 years ago
Mind taking a look, @halohalospecial?
Hi,
I was able to reproduce the issue. Thank you so much for providing the steps and additional details. This is the problematic line:
module.exports.quickFixes[textEditor.getPath()].forEach(({range, fixes}) => {
quickFixes[textEditor.getPath()]
is returning undefined
because there's no value for quickFixes["Hello.elm"]
yet. It will only have a value if the linter was ran at least once.
You probably saw the notification "No elm-package.json beneath or above the edited file" upon saving the file for the first time. If so, the linter did not continue because it required that .json file to be present. It also did not assign a value to quickFixes["Hello.elm"]
.
When you ran elm-package install -y
, an elm-package.json
file was automatically generated. The linter succeeded the second time you save Hello.elm
(since the .json file already exists) and it also assigned a value to quickFixes["Hello.elm"]
.
You're right that it's misleading. We should probably add a check and notification for this.
Thank you for reporting this issue. As a bonus, I discovered another Quick Fix case from the sample code that you gave :)
Hi, that's great to hear!
Thank you for the detailed explanation and your positive feedback. I also came to the the conclusion you described and found a way around it. Of course, I would like the editor to make this as transparent as possible, maybe informing me about automatically installing dependencies. But that's a spoiled requirement and makes the market for scaffolders even less appealing in elm-land.
Since I am only starting to stumble around in the open source world and opted for an issue instead of trying to fix it myself. Yet this email is as friendly and technically interested as the rest of my experience in this new-found open source kingdom, that it just supports my decision to be contributing more in the very near future.
Cheers to everyone!
On Sat, Jun 4, 2016 at 4:55 PM, halohalospecial notifications@github.com wrote:
Hi,
I was able to reproduce the issue. Thank you so much for providing the steps and additional details. This is the problematic line:
module.exports.quickFixes[textEditor.getPath()].forEach(({range, fixes}) => {
quickFixes[textEditor.getPath()] is returning undefined because there's no value for quickFixes["Hello.elm"] yet. It will only have a value if the linter was ran at least once.
You probably saw the notification "No elm-package.json beneath or above the edited file" upon saving the file for the first time. If so, the linter did not continue because it required that .json file to be present. It also did not assign a value to quickFixes["Hello.elm"].
When you ran elm-package install -y, an elm-package.json file was automatically generated. The linter succeeded the second time you save Hello.elm (since the .json file already exists) and it also assigned a value to quickFixes["Hello.elm"].
You're right that it's misleading. We should probably a message when Quick Fix is unavailable.
Thank you for reporting this. As a bonus, I discovered another Quick Fix case from the sample code that you gave :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mybuddymichael/linter-elm-make/issues/31#issuecomment-223759891, or mute the thread https://github.com/notifications/unsubscribe/ASasRz9-MX2UmKvW7mniazsSRahqypwOks5qIZHhgaJpZM4IqwjK .
@ManuScriptHub, I also started just submitting issues myself :)
Btw, I submitted a PR (https://github.com/mybuddymichael/linter-elm-make/pull/34) for review. Thanks!
Awesome! Looks good to me! (You've been busy!) What do I do next?
On Sat, Jun 4, 2016 at 7:57 PM, halohalospecial notifications@github.com wrote:
@ManuScriptHub https://github.com/ManuScriptHub, I also started just submitting issues myself :)
Btw, I submitted a PR (#34 https://github.com/mybuddymichael/linter-elm-make/pull/34) for review. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mybuddymichael/linter-elm-make/issues/31#issuecomment-223769267, or mute the thread https://github.com/notifications/unsubscribe/ASasR1M_nBNA4M2QIzVm5otcuA-9Ph-jks5qIbyJgaJpZM4IqwjK .
Only a collaborator can merge the PR. I think @splodingsocks is on vacation. Btw, I closed the PR and submitted a new one that has on-the-fly linting :)
If you want, you can try out the changes by doing the following:
linter-elm-make
package in Atom, then close Atom.git clone https://github.com/halohalospecial/linter-elm-make
cd linter-elm-make
git checkout lintonfly
apm link
Update Package Dependencies: Update
from the command palette.To revert to the published package version, execute apm unlink
, then reinstall the package.
Hi, i don't know how to proceed, and cannot see another issue that has been raised about this. I started a new project, new file, then tried the quick fix function. This went away after I ran
elm-package install -y
This is my first issue ever, don't know what's taken me long. I love open source. Glad for any pointer.
[Enter steps to reproduce below:]
Create new file "Hello.elm" with this content:
module Main exposing (..)
name = "elmo"
hi name = "hi" ++ name
Atom Version: 1.7.4 System: N466 Thrown From: linter-elm-make package, v0.5.2
Stack Trace
Uncaught TypeError: Cannot read property 'forEach' of undefined
Commands
Config
Installed Packages