You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letassignedFunction=function(a,b){if(a){return'a';}else{return'b';}};[].map(function(a,i){returni});// FunctionExpression inside an ObjectExpressionletmyInstance={myMethod(){return'foo'}}
Code like this can't be parsed by Recast, because it is not valid JavaScript syntax:
function(a,i){returni}
Also other parts in the ecosystem can't handle this, like 'eslint' which would mark the first line as error and doesn't show other errors. The language server used in Oni today can handle this code btw, you still get completions.
By adding a name the code is parsable again, e.g.:
added code should be read only (never saw 'read only' mode on a per character basis), because user should not change this
Yode could probably track that a change to the added name occurred and restore it, as Yode can change through the editorApi and the editor plugin can than react to to this also like make a tooltip "you should not edit this, here are dragons"
a bit bad look and feel as users sees code which is not in the file, can be solved by highlighting?!
The text was updated successfully, but these errors were encountered:
Some examples:
Code like this can't be parsed by Recast, because it is not valid JavaScript syntax:
Also other parts in the ecosystem can't handle this, like 'eslint' which would mark the first line as error and doesn't show other errors. The language server used in Oni today can handle this code btw, you still get completions.
By adding a name the code is parsable again, e.g.:
ideas:
builder
example for adding AST nodes. This would not fix problems like eslint errors.editorApi
and the editor plugin can than react to to this also like make a tooltip "you should not edit this, here are dragons"The text was updated successfully, but these errors were encountered: