Issues with Notepad++ and Unityscript

I’m trying to switch IDEs now because as I find myself writing larger scripts, having the ability of code folding would be really nice, which Monodevelop doesn’t support. I’ve tried using Notepad++, but every time I try to open a .js file made in Monodevelop, I get an error message saying “Session file is either corrupted or invalid”. Is this because it doesn’t like Unityscript?

I’ve posted this in the forums for Notepad++ support as well. Not sure if it’s a Unityscript issue or a Notepad++ issue.

Any help would be greatly appreciated!

– Chris

“having the ability of code folding would be really nice, which Monodevelop doesn’t support”

It supports code folding pretty well IMO, at least with C#.

Also, you could try ATOM?

It’s available for both Windows and Mac at least.

I just tried UnityScript code from manual, and it seems to be doing class and function level folding just fine…

I’ve personally like Notepad++ since I’ve used it years, but UI customization and menu options are pretty outdated, most likely because how it’s built, but most annoying is the fact that once you try ATOM or something similar, fonts and styles look just so much better, although it might be a bit slower overall with large files.

I’ve read that it doesn’t support folding for UnityScript. And it doesn’t for my code. I do have folding enabled in settings.

What version of Mono are you using?

And I’ll look into ATOM.

notepad++ reads any normal text file (regardless of extension)…

I just tested notepad++ and it opened files just fine (either through notepad++ itself, or by opening through unity when selecting it as my editor in preferences).

Though not sure why you’d want to use Notepad++, since all it will give you is code highlighting. It’s not a full fledged IDE… unless you don’t care about having the various features an IDE gives.

I would personally suggest Visual Code (not Visual Studio), include this asset in your project and it gives full debug support and what not:

2 Likes

Yeah, I don’t know why it’s refusing to work for me. It’s really weird.

Where does the error display, what steps do you take to recreate it?

You got an example of it I can dl and check out? A screenshot?

I just open any .js file in N++ (either from with N++ or from File Explorer) and it says it upon opening. If I change extension from .js to .txt it opens fine. But even if I save a file from N++ to .js and try to reopen it, it gives the error.

3024502--226041--Broken1.png
3024502--226042--Broken2.png

I’ve never seen code folding in MonoDevelop (with C#). Do you have to enable it somewhere?

@StarManta

I’m pretty sure only thing I’ve ever touched in monodevelop is color theme (or whatever it was called).

I think code folding should automatically work for: classes, methods, block comments and #region-endregion tags…?

EDIT: check the boxes in: Options / TextEditor / General > Enable code folding

Well, there it is. Thanks!

So that message has to do with the session.xml file in your appdata folder for Notepad++. It’s what keeps track of what files you’re currently editing, highlights, and other stuff like that. This way if you close and reopen N++, it has the same session.

If this file is malformed, it can’t be loaded.

It usually doesn’t have to do with the file you’re opening, but rather N++ itself.

have you tried opening N++ just on its own?

Try clearing out the session file in your appdata folder for N++.

The file opens up fine in any other text editor (Monodevelop, Visual Studio, etc.), but not N++. N++ opens fine on its own.

Clearing the session file does nothing. Really confusing. :frowning: