-
Notifications
You must be signed in to change notification settings - Fork 17
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
[bug] non-main modules sometimes do not update #101
Comments
same the other way around: when I fix the error in regarding PSCID:📝 In the same time, the |
@nwolverson this problem appears to be related to #95 indeed, the file that triggers typechecking upon save has tooltips, but the other hasn't. How can I help you on this one ? |
Hmm...... after #102 (comment), I enabled fast rebuild, quitted Atom (Cmd-Q), restarted it, and now, it seems to be working fine, and both modules correctly typecheck upon save ! ❤️ |
Seems like you hit some odd case with something in the particular file. If you can reproduce again reliably it might be interesting to see if you were able to share the project. You're on psc 0.9.2 I think? What you wrote above seems to indicate an issue writing externs with the full compilation but not psc-ide. |
if I can reproduce it reproductibly, I'll make a proper report and share a test project, sure ! I'm on psc 0.9.2, yes, on mac el capitan, using atom 1.9.0-beta0 In both my Main and Input module, I was doing some FFI. It could also be a race condition since I have in the same time running
|
If you can reproduce the effect - even if it just happens rather than understanding the precise steps - the thing to look at would be |
I just tried one last time without |
got it, I'll pay attention to those things from now on |
( 📝 edit: see the next message, I also reproduced with fast-rebuild, and wrote down steps leading to the problem) Got the bug again without falst-rebuild: the non reloading module is Debug.purs: Debug.purs:module Debug where
import Prelude
import Control.Monad.Eff (Eff)
import DOM (DOM)
foreign import p :: forall a eff. a -> Eff (dom :: DOM | eff) Unit
ss
plop
sss
s Debug.js"use strict";
exports.p = function(a){return function(){console.log(a)}}; when I save Debug.purs, the * Source tree changed; restarting:
* Building project in /Users/rvion/dev/psc-b
Error found:
at /Users/rvion/dev/psc-b/src/Debug.purs line 12, column 1 - line 12, column 1
Unable to parse module:
unexpected end of input
expecting binder or indentation
See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information,
or to contribute content related to this error.
* ERROR: Subcommand terminated with exit code 1 and output/Debug/externs.json contains: {"efVersion":"0.9.2","efModuleName":["Debug"],"efExports":[{"ValueRef":{"Ident":"p"}}],"efImports":[{"eiModule":["Prim"],"eiImportType":{"Implicit":[]},"eiImportedAs":null},{"eiModule":["Prelude"],"eiImportType":{"Implicit":[]},"eiImportedAs":null},{"eiModule":["Control","Monad","Eff"],"eiImportType":{"Explicit":[{"PositionedDeclarationRef":[{"start":[4,27],"name":"/Users/rvion/dev/psc-b/src/Debug.purs","end":[4,30]},[],{"TypeRef":["Eff",[]]}]}]},"eiImportedAs":null},{"eiModule":["DOM"],"eiImportType":{"Explicit":[{"PositionedDeclarationRef":[{"start":[5,13],"name":"/Users/rvion/dev/psc-b/src/Debug.purs","end":[5,16]},[],{"TypeRef":["DOM",[]]}]}]},"eiImportedAs":null}],"efFixities":[],"efTypeFixities":[],"efDeclarations":[{"EDValue":{"edValueName":{"Ident":"p"},"edValueType":{"tag":"ForAll","contents":["eff",{"tag":"ForAll","contents":["a",{"tag":"TypeApp","contents":[{"tag":"TypeApp","contents":[{"tag":"TypeConstructor","contents":[["Prim"],"Function"]},{"tag":"TypeVar","contents":"a"}]},{"tag":"TypeApp","contents":[{"tag":"TypeApp","contents":[{"tag":"TypeConstructor","contents":[["Control","Monad","Eff"],"Eff"]},{"tag":"RCons","contents":["dom",{"tag":"TypeConstructor","contents":[["DOM"],"DOM"]},{"tag":"TypeVar","contents":"eff"}]}]},{"tag":"TypeConstructor","contents":[["Data","Unit"],"Unit"]}]}]},null]},null]}}}]} formated, it gives : {
"efVersion": "0.9.2",
"efModuleName": [
"Debug"
],
"efExports": [
{
"ValueRef": {
"Ident": "p"
}
}
],
"efImports": [
{
"eiModule": [
"Prim"
],
"eiImportType": {
"Implicit": []
},
"eiImportedAs": null
},
{
"eiModule": [
"Prelude"
],
"eiImportType": {
"Implicit": []
},
"eiImportedAs": null
},
{
"eiModule": [
"Control",
"Monad",
"Eff"
],
"eiImportType": {
"Explicit": [
{
"PositionedDeclarationRef": [
{
"start": [
4,
27
],
"name": "/Users/rvion/dev/psc-b/src/Debug.purs",
"end": [
4,
30
]
},
[],
{
"TypeRef": [
"Eff",
[]
]
}
]
}
]
},
"eiImportedAs": null
},
{
"eiModule": [
"DOM"
],
"eiImportType": {
"Explicit": [
{
"PositionedDeclarationRef": [
{
"start": [
5,
13
],
"name": "/Users/rvion/dev/psc-b/src/Debug.purs",
"end": [
5,
16
]
},
[],
{
"TypeRef": [
"DOM",
[]
]
}
]
}
]
},
"eiImportedAs": null
}
],
"efFixities": [],
"efTypeFixities": [],
"efDeclarations": [
{
"EDValue": {
"edValueName": {
"Ident": "p"
},
"edValueType": {
"tag": "ForAll",
"contents": [
"eff",
{
"tag": "ForAll",
"contents": [
"a",
{
"tag": "TypeApp",
"contents": [
{
"tag": "TypeApp",
"contents": [
{
"tag": "TypeConstructor",
"contents": [
[
"Prim"
],
"Function"
]
},
{
"tag": "TypeVar",
"contents": "a"
}
]
},
{
"tag": "TypeApp",
"contents": [
{
"tag": "TypeApp",
"contents": [
{
"tag": "TypeConstructor",
"contents": [
[
"Control",
"Monad",
"Eff"
],
"Eff"
]
},
{
"tag": "RCons",
"contents": [
"dom",
{
"tag": "TypeConstructor",
"contents": [
[
"DOM"
],
"DOM"
]
},
{
"tag": "TypeVar",
"contents": "eff"
}
]
}
]
},
{
"tag": "TypeConstructor",
"contents": [
[
"Data",
"Unit"
],
"Unit"
]
}
]
}
]
},
null
]
},
null
]
}
}
}
]
} I'll now enable fast rebuild, and see if the problem pops up in the next hours |
🔴 @nwolverson Ok, so I have been able to "reproduce" the problem with fast-rebuild too, and the buggy module doesn't even use FFI Here is the steps I just did to go from "working sate" to "buggy state":
|
and if I quit completely Atom (cmd-Q) and restart it, the problem is temporarily fixed |
I have a feeling that multiple servers writing and watching the same Can you recreate the issue without |
@kritzcreek @nwolverson ok, so I can now replicate the bug all the time. case 1:
module Eee where
ok :: Int
ok = 3
🔴 -> it doesn't work. the newly created module is never loaded restarting the ide-server doesn't work. The only way for ide-atom to be aware of the newly created Eee.purs is to restart case 2:
1.idem: create a new file module Eee where
ok :: Int
ok = 3
🔶 it fails for the first few seconds, until Again, restarting the ide-server doesn't do anything, and the only way to get Atom fully aware of the newly created Eee.purs is to restart case 3:🔴 when I delete a file (let's say C.purs), It still appears in the autocompletion list from other modules system infos:
atom: 1.9.0-beta0 |
after one more day of purescript hacking, I can confirm the reproductibility, both with and without fast-loading. (atom + atom-ide-purescript) have a problem with newly created modules, but restarting atom completely solves it until next module addition |
Case 3 is #105. For the others will try to reproduce, sounds like new files aren't being watched properly. |
Case 1 seems to work fine for me, maybe I'm missing something.
At this point I can trigger completion from |
@nwolverson forgot to add the last step showing the bug in case 1 x) now, go in Eee, and write something silly, like module Eee where
ok :: Int
ok = 3
d then hit save: no error message 🔴 if I go back to Main with the module Eee still containing the silly code, and hit save, then I'll see the errors from Eee. But while I'm editing Eee, I can write whatever, hit save, and it doesn't reload |
I have the same problem. Ide doesn't see changes in other modules after fast rebuild. For example if I have modules |
@rvion Just tried this again and still can't reproduce (your new file/ @starper Not sure if I follow. For sure if I save file |
Sorry about that "write something that causes an error" thing, I haven't use purescript for month and a half and for some reason I thought that Here are my steps (I'll perform a step, then write it down, then perform the next one and so on):
module A where
import Prelude
module B where
import Prelude
import Control.Monad.Eff (Eff)
bar :: forall e. Eff e Unit
bar = pure unit
module A where
import Prelude
import B (bar)
import Control.Monad.Eff (Eff)
foo :: forall e. Eff e Unit
foo = bar
bar :: forall e. Eff e Unit
bar = pure unit
baz :: forall e. Eff e Unit
baz = pure unit
module A where
import Prelude
import B (baz)
import Control.Monad.Eff (Eff)
foo :: forall e. Eff e Unit
foo = baz
So I end up with those two issues that I described before - |
Thanks for the detailed steps! I'm trying to follow this, at the step
I do not see that this is the case. I get the correct complaint about import B (bar) If this built it would be wrong (can you maybe edit the above post to highlight parts that you believe to be in error?) So everything up until closing atom for the 1st time, works as expected for me. (I'll continue to investigate as I have different versions) I can reproduce nothing starting when you restart the session, opened #120 (but think this is an Atom regression). When you say "open some other |
|
@nwolverson It is still happening but I need to check if I correctly updated the plugin. |
@starper still can't see anything like the 1st issue, where I did notice there is a race condition #121 on starting the package after re-opening the window. I'll ask you to re-test when that is fixed |
I'll retest too, since what you show above doesn't work for me |
@nwolverson can you tell me what tool you're using use to record screen as gif ? |
That's LICEcap (I bet there's one difference that nobody thought to notice that's causing the discrepancy but hard to track down the variables...) |
Thanks for the link :) I noticed that I don't create files the same way you do. I create new files with ctrl-n, followed by ctrl-s, matbe it doesn't trigger events the exact same way? (Cant't test atm, not at home) |
What I've noticed is that ide sees changes in foreign import fooImpl :: Eff e Unit but have no |
Maybe something like |
@starper to what end? You should be able to achieve this effect in your init script if that's something you find useful |
@nwolverson So that people who have this issue do not have to restart editor every time this bug appears. What init script? |
I think if you have to restart your editor repeatedly like that, something is badly wrong, and it would be better to track it down. I never was able to reproduce this, so it won't be fixed otherwise. So this still happens. Does the "restart psc-ide-server" command work for you? Init script is your atom init script, you could for example listen to file saves and run a command. |
It seems that it is I just use |
There is a command "Ide Purescript: Restart Psc Ide" you can find in the command palette, the PureScript package submenu. The actual command is |
It works, thanks. |
With the latest |
@starper are you on windows by chance? in 0.10.3 the server now uses a polling mechanism as the default on windows. If someone else is seeing the same failures on other OS's I'd suggest we add a setting to this plugin to enable the polling behavior. See the |
@kritzcreek yes, I'm on |
I've been using the ide a lot today, and there is one bug 🐛 I can't figure out.
my
Main
module import anInput
module.When I write something wrong on my
Input
module and save the file, no error is shown.🔴 no error shown
When I go back to my
Main
module and hitsave
, suddenly, the bottom toolbar tells me an error is detected:and indeed, when I go back to my
Input
module, I see the error:(I'm not 100% sure, but it may have been working a few hours ago. As of now, the bug is present, and restarting the ide server doesn't solve it)
The text was updated successfully, but these errors were encountered: