mps grammar cells giving message "Error Missing Dependency on jetbrains.mps.lang.core" - mps

I am following along Kolja Dummann's Heavy Meta (4) livestream on Youtube.
I am trying to use the grammar cells to wrap a binary expression. the projection looks like this
<default> editor for concept BinaryExpression
node cell layout:
projection: [> wrap % left % grammar.constant wrap % right % <]
grammar: rule: <derive from projection> (instance of CellModel_RefNode) (instance of GrammarConstantQueryCell) (instance of CellModel_RefNode)
inspected cell layout:
<choose cell model>
the grammar.constant constant text property is set to subconcept.conceptAlias.
Unfortunately, I am getting an error message in the editor for both the wrap cells that says:
Error Missing Dependency on jetbrains.mps.lang.core
When I rebuild the editor, the language or the project, it reports that the rebuild is successful, however, I am unable to get the expected behavior of the aliases (+,-,*,/) being recognized after I type a number in the sandbox project.
I have added the jetbrains.mps.lang.core to the editor, but it shows up greyed out, i.e. unused.
when earlier in the tutorial I used wrap on my number literal editor, the expected behavior happened even though I got the editor showed this same error message. so perhaps the error message is a red herring.
I am using
MPS 2020.2 (202.6397.948). (I had same issue in 2020.1)
the grammarcells from de.itemis.mps.extensions-2020.1.1477.e4af43c (I think - not sure how to check).

There is a quick fix action, "Add dummy component to fix dependency on jetbrains.mps.lang.core". You can execute it to fix the error.

You have to use JetBrains MPS 2021.2.1 - It works correctly.
I used grammar.wrap in 2032.3 - it didn't work correctly. You can build the language but changes are not applied to the model - there are still some troubles to use grammarcell language in the newest MPS version 2021.3.

Related

Why does VSCode show 'problems' which do not exist?

I'm using VSCode with the python extension. The 'problems' tab as well as the indicators on the 'explorer' tab and the red underline in the code view itself all show there to be an error, even though the error isn't real.
After importing matplotlib.pyplot as plt, the code uses plt.cm.RdBu. VSCode is presenting the error that matplotlib.cm has no member RdBu.
There are two issues here:
Unless I'm just mistaken, plt.cm.RdBu ought to be equivalent to matplotlib.pyplot.cm.RdBu, not matplotlib.cm.RdBu. It seems to be interpreting that incorrectly.
But regardless of that, both cm and pyplot.cm actually do have an attribute called RdBu, both of which I was able to pull up information for using help(). The code runs perfectly and python throws no errors.
Why is VSCode telling me this is an error when it isn't? Is this just a bug or could it be a misconfiguration?
Unfortunately, there doesn't seem to be a way to fix this issue. The reason that VS Code, or more specifically, the linter used by the Python extension isn't picking up matplotlib.pyplot.cm.RdBu, or any other colormaps defined in cm is because they're defined dynamically. If you try looking inside cm.py, you'll only find this:
cmap_d = _gen_cmap_d()
locals().update(cmap_d)
Essentially, instead of being statically defined like RdBu = ..., these colormaps are defined dynamically by being injected into the module's global namespace at runtime. Even though this works fine when you run it, unfortunately it means that there's no way for the linter to know that names such as RdBu exist in the namespace until runtime. And as most linters such as pylint and flake8 are static code analysis tools that never actually execute the code, it's impossible for them to detect the existence of these colormaps.

VS 2010 C++ phantom compile errors

problem: when attempting to build completed code VS 2010 returns with compile errors. when "errors" are checked in text environment after a few seconds VS 2010 recognizes that "errors" were in fact not errors at all with no external input. when build is attempted again the entire chain of events restarts.
theories: when i attempt to build VS 2010 it appears to "forget" many of the classes and structs that i have defined. many of the errors are required ';' in between a class or struct declaration and the variable name that it is attached to and the red squiggle that indicates an error appears under the struct / class definition.
Example: myStruct myNamedStruct; //in this case "myStruct" would show a red line underneath for a few seconds when viewed after each build attempt but then VS would decide it is fine after a few seconds.
Trouble Shooting: i have hit the "clean solution" button within the build tab and it consistently returns "Clean: 1 succeeded, 0 failed, 0 skipped" which seams like a positive response to me. i have tried restarting VS, hiding the .suo file (to make intellisense behave), systematically opening each program file forcing VS to properly run it's error diagnostic on each, along with tinkering with turning off and on some of the code environment settings within the tools -> options window.
The rest: i am not naive i am fairly certain my code does have errors within it, but these odd fake errors make it impossible to find and test the real errors. any suggestions would be appreciated.
after significant trouble shooting and research i have come to the conclusion that i was declaring my structs incorrectly (i was not using typedef). i still don't understand why the compiler was only saying they were bad when i tried to build and was ok with these errors the rest of the time.
edit: well after more tinkering the problem still persists. typedef solved the issue for my structs, but my classes are still popping the same "errors".
edit2: after more troubleshooting it was discovered that i had header files indirectly calling themselves through other header files. i guess in effect i was creating endless loops on build. i am still not sure why VS found these errors acceptable in the coding environment but producing errors at build.

why red 'Exclamation Mark' appears on project after installing puppeteer?

Whenever I install puppeteers in my netbeans project, A red Exclamation Mark appears on my project name which is actually representing error in 'install.js' (node Modules/puppeteers/install.js). How to resolve this?
Error
This error is shown as a return statement is normally only expected in functions (but actually also valid outside of them). Therefore, the netbeans syntax checker tells you that this is invalid code (although it is valid).
Most likely, you want Netbeans to ignore the node_modules folder, as bad code inside any of these modules should not be shown as an error in your project.

Finding the default project settings file

I'm trying to write a plugin for 3ds max, I went through the entire sdk installation process to the letter as described in the help files.
The problem I'm facing though is intellisence complaining about an invalid macro definition
"IntelliSense: command-line error: invalid macro definition:_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT =1"
I found the definition in project settigs -> c/c++ -> preprocessor definitions as inherited from parent or project default.
I tried disabling the inherited definitions and re-entered them, this time without the space between the name and the = and all works fine so I'm guessing its a typo on their part?
Anyway, I want to change the default project or whatever to not repeat it every time i start a new project. The project is created with a wizard which required me to copy over some files to appear and after which I had to enter the sdk path.
The files I copied are plain text with some fancy extensions and not much in them so I'm guessing the defaults are described in the sdk directory.. somewhere. Does anybody know what kind of a file I'm looking for?
EDIT: I found a file called root.vcxproj_template and it has a section for preprocessor definitions but all it contains is
<PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
and no mention of the broken one
EDIT2: in another part of the file there was a path to a property sheet (maxsdk\ProjectSettings\propertySheets\3dsmax.common.tools.settings) which included the faulty definition. I fixed it an no more complaints from VS.
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT = 1 means that compiler should replace all old C run-time routines such as sprintf, strcpy, strtok with new versions such as strprintf_s, strcpy_s, strtok_s and similar. It goes in pair with following definition _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES = 1.
More you can find here: (MSDN) https://msdn.microsoft.com/en-us/library/ms175759.aspx. However I tried to use this but without success. It says that you can use this only for statically allocated buffers like char buffer[32], but compilers was still complaining bout unsecure strcpy.

Strange link error - LNK1224: Invalid Image Base

I'm having some real difficulties porting a really old Visual Studio 97 C++ project to Visual Studio 2010. Let me begin by first giving a little background on the errors I was getting immediately prior to this new LNK1224 error because they may be related, but I'm not sure.
Prior to my new error I was receiving this error:
error LNK2005: "void __cdecl operator delete(void *)" (??3#YAXPAX#Z) already defined in LIBCMT.lib(delete.obj) nafxcw.lib(afxmem.obj)
Through some digging I found that the reason for this error was because both the MFC and CRT libraries contain definitions for "new" and "delete" so they were colliding. Microsoft provides 2 solutions for this detailed in http://support.microsoft.com/kb/q148652/ . One of them was to make sure that in all your files you always include the MFC headers (afx stuff) first. Well there are about 100 files in this project and I just got tired of trying to find the files that were including resources in the wrong order. So I went with the other solution which is basically forcing libraries to load in a particular order. Basically you have to tell the compiler to ignore a particular library so that you can load it explicitly your self in the order that you choose. In my case, it was nafxcw.lib.
So under Project Properties --> Linker --> Input, I explicitly ignored nafxcw.lib and then explicitly included it at the front of the list.
So after doing this, my LNK2005 errors went away. But they were replaced with one single link error.
error LNK1224: invalid image base 0x287600000
I don't know if I fixed my previous link errors correctly and this new link error is in fact the next thing I have to deal with, or I simply created a more critical link error that is basically stopping the linking process before it gets to my original LNK2005 errors. In either case, there isn't much information I could find on this error. Microsoft doesn't say much in this link about it http://msdn.microsoft.com/en-us/library/3ya3f8wz%28v=vs.80%29.aspx
You specified an invalid base address for the image. Base addresses must be 64KB aligned (the last four hex digits must be zero) and image base must fit within a 32-bit signed or unsigned value.
This isn't all that helpful to me and there seems to be no other clues as to where this problem is coming from. I don't know what the next step is.
OK, so it looks like I have solved my own problem. Here is what I did. I needed to know where the heck this number was coming from so I simply used Notepad++ to do a word search through all the project files looking for "2876" which I got from the error message "LINK : fatal error LNK1224: invalid image base 0x287600000". I found that in the project file (.vcxproj) had the following entry in it:
<BaseAddress>0x287600000</BaseAddress>
So I opened it up and sat there wondering how this number was wrong. I mean I don't even know what this field is for. I didn't even generate this file, M$ made it. Why would the IDE create it's own input file incorrectly? Anyways, as I was trying to google this "BaseAddress" item to figure out what it was, it dawned on me that it looked like there were too many zero's. So I went back and counted and sure enough, this wasn't a 32-bit number, it was a 36-bit number. Deleted one of the zero's, recompiled, and boom it worked. Low and behold, that's kind of what the defintion I looked up, mentioned in the problem statement, hinted at looked up earlier on MSDN but it didn't click.
I don't make a habit to rummage through auto generated files very often so I never questioned that this may be the problem.

Resources