Closed Sicos1977 closed 1 year ago
Thanks for reporting. Hmm, I would expect it is a bug in how undo is sent to the server -- I'll have to investigate.
I don't know if it makes any difference but I'm using MirrorSharp on the .net 4.8 framework with ASP.NET webforms (yes I know this is old technology :-) )
Also get it when I type to fast :-)
When I remove this line public string KetenProcess { get; set; }
and paste it back then the error goes away
I also can break everything by just selecting a large portion of code, delete it, paste it back, delete it again and past it back again. For some reason then all code editing features are broken.
The weird thing is that I don't see any errors anywhere, not in the Chrome console or on the server. It just stops working.
I also turned on self debug but that also stops working, when I press CTRL + SHIFT + Y nothing gets send back to the console.
The only way to get it working again is by reloading the webpage.
I did some more test and inspected the object in Chrome and in this example I see something different in the "code behind" then what I see on the screen. This also explains why Roslyn is complaining the code is not correct.
In this a problem I have to look into in codemirror itself or is this a problem combination between codemirror and mirrorsharp?
Any change that this gets fixed because it is sometimes very annoying that mirrorsharp is complaining that something is wrong in the code when it isn't
And could you otherwise point me in the right direction so that I can look if I can solve it myself?
Most of the time the problem occurs after just typing .. e.g. the var keyword --> mirrorsharp is suggestion sometime wrong --> I undo it and then this happens.
Uncaught Error: Unexpected undefined value at completion info index. at ensureDefined (ensure-defined.js:4:15) at Connection.sendCompletionState (connection.js:173:19) at hinter.js:94:48
Can you (or somebody else) please give an answer so that I'm not talking to a black hole?
I logged the messages to the console that I get back from mirrorsharp and that still thinks there is something different on the screen then there is really there.
This is what I see
This is what I see in the html elements
And this is what the slowupdate process is thinking
I think I got it solved by removing this code from the editor.js
file and the method this[editorOnCodeMirrorChanges] = (_, changes) => {
When typing to quick or moving to quick around in CodeMirror the server gets lots in where you are editing. After removing this code I don't have any problems anymore with weird suggestions
if (cursorIndex === start + 1 && text.length === 1 && !this[editorChangesAreFromServer]) {
if (length > 0) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this[editorConnection].sendReplaceText(start, length, "", cursorIndex - 1);
} // eslint-disable-next-line @typescript-eslint/no-floating-promises
this[editorConnection].sendTypeChar(text);
} else {
Only now the tooltip window seems to be broken.
Any updates on this?
This is solved
When I type something in MirrorSharp and use CTRL + Z to undo that and fix it MirrorSharp still's keep complaining about the error I made but it is already fixed. Is this somekind of caching problem and is there a way to solve this?
In the example above it is complaining about 'e' but I already fixed that.