fsprojects / zarchive-sublime-fsharp-package

F# development tools for SublimeText 3
32 stars 7 forks source link

Refactor errors and fsx files #17

Closed guillermooo closed 9 years ago

guillermooo commented 9 years ago

Better support for .fsx files.

Some refactoring around errors received from fsac, bug fixes, etc.

guillermooo commented 9 years ago

@rojepp PTAL commit by commit. Sorry, I got carried away with the changes and lumped everything together.

rojepp commented 9 years ago

I see squigglies in .fsx files now, great!

There's code in here that seem to implement tooltips, but I don't see any?

rneatherway commented 9 years ago

Just a note, if it wasn't clear, you can now load multiple projects and they will all be 'active', you aren't limited to just one at a time anymore. So load away and let FSAC worry about it!

rojepp commented 9 years ago

@rneatherway How can you 'unset' a project? Maybe it isn't necessary, I'm not sure. If you have previously opened a project, and then navigate to an .fsx file, you wouldn't wan't fsac to analyze it as if it is part of the project. I'm thinking that could lead to errors not being caught by FSAC. Like missing #r ... statements for instance.

rneatherway commented 9 years ago

You can't unset a project, I don't think it's needed. .fsx files are always analysed completely independent of any project, which is consistent with Visual Studio.

guillermooo commented 9 years ago

Ah, ok, didn't know that. Then I'll make sure not to unload projects. Wondered the same as @rojepp.

guillermooo commented 9 years ago

@rojepp Re. tooltips: Press Ctrl+k, Ctrl+i on any symbol.

(Often, I get multiple "ERROR NOT PARSED" from fsac before the tooltip finally shows up.)

rneatherway commented 9 years ago

You must send a parse command for a file before anything else, like requesting tooltips. This is just making fsac aware of the current state of the file. I would do it before each other command, and on idle for errors. On 23 May 2015 19:40, "Guillermo López-Anglada" notifications@github.com wrote:

@rojepp https://github.com/rojepp Re. tooltips: Press Ctrl+k, Ctrl+i on any symbol.

(Often, I get multiple "ERROR NOT PARSED" from fsac before the tooltip finally shows up.)

— Reply to this email directly or view it on GitHub https://github.com/fsharp/sublime-fsharp-package/pull/17#issuecomment-104935764 .

guillermooo commented 9 years ago

@rneatherway I'm currently re-parsing on_idle after 1,5 secs no matter what.

https://github.com/fsharp/sublime-fsharp-package/blob/4abd84c5c8c69f94cac90132f10527906c37686e/FSharp/xevents.py#L37

I get the error I mentioned even with clean views, so I'm not sure what may be wrong.

rneatherway commented 9 years ago

Do you parse on opening a file, and before each other command?

For example, the emacs code for goto definition: https://github.com/fsharp/emacs-fsharp-mode/blob/master/fsharp-mode-completion.el#L457

rneatherway commented 9 years ago

If you do, then can you post a log of the communication?

guillermooo commented 9 years ago

I do parse on_load. I'll experiment with re-parsing before every command and see if that helps.

guillermooo commented 9 years ago

@rneatherway @rojepp

Ok, forcing a re-parse does seem to help. PTAL at the latest changes. If everything's ok, I'll merge with master.

rojepp commented 9 years ago

LGTM! Great to see progress here! I'm sure there are still issues to fix but this is progress. It seems the re-parse makes completions usable. Please re-enable fs_dot and I think this should be merged. Btw, @guillermooo can we get your contact details? Robin wanted to mail you and I've wanted to chat with you this week. :)

guillermooo commented 9 years ago

@rojepp Email me at the address in my profile if you want. Does that work?