[TOOL] CWTools - a mod validating extension for VS Code

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
I'm getting a problem since yesterday where autocomplete suggestions on ctrl+space only show the terms already in the file (not even paradox language stuff, it shows as autocomplete even stuff I write on comments) prefixed by an icon containing the letters abc. I suppose this is a Visual Studio Code utility and has nothing to do with your extension.

It appears your extension simply stopped working properly. I can still see it sending and receiving messages, but nothing gets validated and no code suggestion works (the code snippets for events work, by the way, that's the only thing still working).

I don't understand a thing about the internal workings of a Visual Studio Code extension but something is definitely broken. I have both CWTools Paradox Language Server and Paradox Syntax Highlighting.

Now, getting to the point, should I try to reinstall? How to do that properly, just click uninstall on both extensions, close VS Code, open it search for them and install again? Or should I not do that and something else instead to fix it?

Thanks for this great extension and for any help you're willing to offer to solve this issue.
Yeah, it sounds like it isn't activating correctly. There's a few possible reasons, so, things to check:
1. That you're opening a folder with "Open folder"
2. That the full path to that folder contains the folder "Stellaris", e.g. "C:\Users\Thomas\Paradox Interactive\Stellaris\mod\my_mod"
3. That the first file you open is a .txt
4.That once you've opened the file, it says "stellaris" is the filetype in the bottom right of the screen

If it's none of those, the best thing is probably if you can grab some logs for me.
1. Go to file, preferences, settings and set cwtools.server.trace to "messages"
2. Close and reopen vscode
3. Open your mod folder as normal
4. Go to "View", "Output" and in the panel that opens, select "Paradox Language Server" in the dropdown on the right
5. Grab that log and send it to me in a conversation (or here if you like, but it might have some personal info in it like your username)

Reinstalling won't usually do anything, as long as you have the latest version of vscode and cwtools-vscode, there's nothing that can really corrupt :)
 
Last edited:
Yeah, it sounds like it isn't activating correctly. There's a few possible reasons, so, things to check:
1. That you're opening a folder with "Open folder"
2. That the full path to that folder contains the folder "Stellaris", e.g. "C:\Users\Thomas\Paradox Interactive\Stellaris\mod\my_mod"
3. That the first file you open is a .txt
4.That once you've opened the file, it says "stellaris" is the filetype in the bottom right of the screen

If it's none of those, the best thing is probably if you can grab some logs for me.
1. Go to file, preferences, settings and set cwtools.server.trace to "messages"
2. Close and reopen vscode
3. Open your mod folder as normal
4. Go to "View", "Output" and in the panel that opens, select "Paradox Language Server" in the dropdown on the right
5. Grab that log and send it to me in a conversation (or here if you like, but it might have some personal info in it like your username)

Reinstalling won't do anything, as long as you have the latest version of vscode and cwtools-vscode, there's nothing that can really corrupt :)

I did all that, didn't work, so I've sent you the log. I see there's a System.IO.InvalidDataException in there, don't know if that's ignorable or maybe the root of my problems (I had never read the init logs before).
 
Problem fixed, everyone! I just showed him the logs, he told me to delete a folder from his extension that he guessed got corrupted, he was right. The extension downloaded the folder again, this time uncorrupted and boom, everything went back to normal. Probably my computer's fault. I have some issues in it that make the screen just goes black, and the sound continues for like 20 seconds or so and then freezes too, endlessly looping the last noise it made. I'm thinking about getting a new HD soon, since this one is tiny for all my stuff (I have to use 2 external ones... oh maybe it's their fault!)

Anyway, sorry for the TMI, I'm just really happy to be able to continue working on this little mod of mine... and thanks Dayshine, for the amazingly useful tool and for being able to fix my problem with your first guess (even though you offered 3 possible steps to solve the problem using that worrying line we always get from tech support "if that doesn't work, then try step 2", which usually leads nowhere after completing all the darn steps).
 
Hello there! There are three modifiers that are not listed by Stellaris itself but they do exist (I just tested them). Is it possible for you to add them manually or you take the modifiers directly from a file the file that lists them in Stellaris folder? (game.log? I forget...) The missing modifiers are:


  • megastructures_physics_research_produces_mult
  • megastructures_society_research_produces_mult
  • megastructures_engineering_research_produces_mult
Thanks again for this amazing tool!
 
Hi :)
I'm having this problem with the autocompletion, I just no more get it :/
I have all the syntax (although the loc one seems strange), the "word" completion works fine (even though is just file limited) but I cannot get any real completion to suggest me how the command, e.g. add_building_construction, should work, and the ShowDefinition command shows no definition for everything
upload_2020-2-4_17-34-46.png


This is the syntax, I remember the "#" were green, whereas the title and desc where orangish and blueish
upload_2020-2-4_17-38-1.png


Thanks in advance for the time and work done,
Have a nice day :)
 
Hi :)
I'm having this problem with the autocompletion, I just no more get it :/
I have all the syntax (although the loc one seems strange), the "word" completion works fine (even though is just file limited) but I cannot get any real completion to suggest me how the command, e.g. add_building_construction, should work, and the ShowDefinition command shows no definition for everything
View attachment 543183

This is the syntax, I remember the "#" were green, whereas the title and desc where orangish and blueish
View attachment 543186

Thanks in advance for the time and work done,
Have a nice day :)

If you look in the bottom right, the language is showing as "paradox". This is because the extension can't detect which game you're in.

For the extension to work correctly you should place the mod in your user modding folder (C:\Users\Thomas\Documents\Paradox Interactive\Stellaris\mod).

What it actually needs is the mod folder's path to contain the name of the game, so something like D:\Temp\Stellaris\blah\blah\mod\ would work too :)
 
But the mods are automatically placed under the steam path :/
Even the mod files in the Documents/Paradox Interactive/Europa Universalis IV/mod folder just refer to the one in the steam workshop :/

This is the content of my /Europa Universalis IV/mod/ folder :/
upload_2020-2-4_20-46-13.png
 
But the mods are automatically placed under the steam path :/
Even the mod files in the Documents/Paradox Interactive/Europa Universalis IV/mod folder just refer to the one in the steam workshop :/

This is the content of my /Europa Universalis IV/mod/ folder :/
View attachment 543211

Sure, but it's not safe to edit mods in that folder is it? I assume steam will just override any changes you make.
You can still make it work, but I guess there are two ways:
1. Just copy the mod from the steam folder to somewhere else
2. Open the mod folder, then open a script file, then in the bottom right click "Plain text" and change it to "EU4". This will activate cwtools in EU4 mode, however it might not work perfectly.
 
Sure, but it's not safe to edit mods in that folder is it? I assume steam will just override any changes you make.

Technically yes, but Steam will update it only when a new version on the steam workshop is added so it's safe for my own mods I would say lOl

Let's say I would like to mod them from the /mod/ folder, how should I do it? (I think this message is outside of this post scope though)
I'll try with the script file :t
 
Is there a way to exclude specific lines or specific problems (not the entire error code) from the list of problems?

Otherwise; great extension. The myriad of features made me jump over to modding PDX games in VSC.
 
Is there a way to exclude specific lines or specific problems (not the entire error code) from the list of problems?

Otherwise; great extension. The myriad of features made me jump over to modding PDX games in VSC.
Not really I'm afraid, that's one of the limitations of the rule based system. I've toyed with adding inline comments, but it seems a bit messy.
My question for you would be: Why do you want to do that?
If there a few specific places the rules aren't quite right, the better solution is for us to tweak the rules there.
 
I think I'm doing something wrong with setting the vanilla folder location. Basically, everything that needs to be defined by vanilla is marked as an error, e.g., all civics, ship types...

I tried entering the vanilla location in the settings by hand, "C:\Program Files (x86)\Steam\steamapps\common\Stellaris", and also leaving it blank. I think it was mentioned that this would produce a prompt to enter it, but this didn't happen.

Any idea what to do here?
 
I think I'm doing something wrong with setting the vanilla folder location. Basically, everything that needs to be defined by vanilla is marked as an error, e.g., all civics, ship types...

I tried entering the vanilla location in the settings by hand, "C:\Program Files (x86)\Steam\steamapps\common\Stellaris", and also leaving it blank. I think it was mentioned that this would produce a prompt to enter it, but this didn't happen.

Any idea what to do here?
Oh, I actually solved it, sorry for the bother (by recreating vanilla cache through the command palette). :D
 
hey so am haveing issues so iv installed this and after setting it up and i see i have the Stellaris Language mode but i type the only kind of auto fill i get it are the below events.
2 events .PNG


am kinda lost and dont know where to look and what i should be seeing tbh am kinda a newbe so am sorry if this is obvuse or am not useing it right
 
So some issues I am having...
  1. Sometimes this messes with auto-indent after hitting return. Basically, it stops doing any auto-indenting and all new lines start at the very beginning of the line. I know it's this because when I uninstalled it, the problem stopped. (However, I had the tools and the syntax coloring addon both installed at once so it might have been one or the other or a combination.)
  2. The syntax coloring overrides a Paradox YAML coloring addon I'm using. Any way to exclude .yml files from the coloring?
 
I only yet found that this tool has an validator. Also I've no clue what the readme on https://github.com/tboby/cwtools says, you must need C# to use the parser?? In VSCode this should be integrated as linter commonly per SHIFT+ALT+F !? I use this tool since one month simply as syntaxhighlighter and I simply wondering why it should be so great. :p
 
Hey. Thanks for this great tool. It works perfect for syntax errors so far, but I don't get validation errors or auto-complete feature for EU4 (also find definition, reference etc does not work). Is it not fully supported for EU4 yet or I did something wrong?

Edit: Language is shown as eu4 in my files.
 
Last edited: