profile
viewpoint
Marijn Haverbeke marijnh Berlin http://marijnhaverbeke.nl Independent open-source programmer person

acornjs/acorn 6564

A small, fast, JavaScript-based JavaScript parser

marijnh/Eloquent-JavaScript 2462

The sources for the Eloquent JavaScript book

codemirror/CodeMirror-v1 358

An editable-iframe based code editor in JavaScript. See https://github.com/marijnh/CodeMirror for the currently maintained version

marijnh/Eloquent-JavaScript-1st-edition 319

The source for http://eloquentjavascript.net

lezer-parser/lezer 258

Incremental parsing system

akapav/js 169

JavaScript compiler for Common Lisp

lezer-parser/lezer-generator 43

Parser generator for the lezer incremental parser

marijnh/browserkeymap 40

Map key events to key names, and key names to values

marijnh/distfs 40

Mount a directory of ES6 code as a FUSE directory of babel-compiled output

marijnh/cetriolo 21

Time management tool

issue commentcodemirror/codemirror.next

HoverPlugin RangeError: Field is not present in this state

Thanks for the example script! This was a rather clumsy timeout leak after all. Attached patch should fix it.

mischnic

comment created time in 4 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 03bfdb04a2cc56cced51dc66295796f718171648

Fix leaked timeout in hover tooltip plugin Closes #298

view details

push time in 4 hours

issue closedcodemirror/codemirror.next

HoverPlugin RangeError: Field is not present in this state

I occasionally get this error

Uncaught RangeError: Field is not present in this state
    at EditorState.field (index.b2918c3c.js:4634)
    at HoverPlugin.get active [as active] (index.b2918c3c.js:13024)
    at HoverPlugin.checkHover (index.b2918c3c.js:13029)

But I'm not able to trigger it consistently, maybe some kind of race condition.

closed time in 4 hours

mischnic

created tagProseMirror/prosemirror-view

tag1.16.1

ProseMirror's view component

created time in 7 hours

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 1f59119350349a240fc78db4aa1d19d0d0c68530

Serialize any non-default attrs on context nodes to the clipboard FIX: Fix an issue where the attributes of defining nodes were dropped when copying to the clipboard. See https://discuss.prosemirror.net/t/copying-and-pasting-defining-nodes/3203

view details

Marijn Haverbeke

commit sha d01c420d9c087f7ba56fc4db2081823ff491dc9d

Mark version 1.16.1

view details

push time in 7 hours

issue commentcodemirror/codemirror.next

HoverPlugin RangeError: Field is not present in this state

Have you been able to reproduce this or found out more about when it may occur?

mischnic

comment created time in 8 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 55a2f6bdf2fc25a928f4fcfb15de9ff59871fef1

Wrap blocks that set EditorView.updateState in a try/finally To avoid leaving the flag set on exception. Closes #322

view details

push time in 8 hours

issue closedcodemirror/codemirror.next

Do something about a crash leaving the updating flag set, breaking any further use of the instance

It's kind of hard to do something meaningful, since the crash could have happened anywhere during imperative update code, and thus the internal state might be corrupt, but the current situation, where that just gives you a completely unusable instance, is just about the worst outcome possible.

closed time in 8 hours

marijnh

issue closedcodemirror/codemirror.next

Highlighter crashes with StreamSyntax

With the javascript legacy mode and the StreamSyntax the highlighter crashes sometimes when editing. The issue is reproduceable by adding two blank lines to a single line of code and then removing them.

streamparser_error

extension.js:27 CodeMirror plugin crashed: Error: Ranges must be added sorted by `from` position and `startSide`
    at RangeSetBuilder.addInner (rangeset.js:331)
    at RangeSetBuilder.add (rangeset.js:324)
    at flush (highlight.js:341)
    at Iteration.leave (highlight.js:389)
    at TreeBuffer.iterChild (tree.es.js:515)
    at TreeBuffer.iterInner (tree.es.js:500)
    at Tree.iterInner (tree.es.js:337)
    at Tree.iterate (tree.es.js:323)
    at Highlighter.buildDeco (highlight.js:349)
    at Highlighter.update (highlight.js:333)
logException @ extension.js:27
update @ extension.js:133
updatePlugins @ editorview.js:173
update @ editorview.js:118
EditorView._dispatch @ editorview.js:56
dispatch @ editorview.js:94
deleteBy @ commands.js:269
deleteByChar @ commands.js:272
deleteCodePointBackward @ commands.js:298
runFor @ keymap.js:139
runHandlers @ keymap.js:150
keydown @ keymap.js:58
runCustomHandlers @ input.js:67
(anonymous) @ input.js:28

closed time in 8 hours

PhilippRaab

issue commentcodemirror/codemirror.next

Highlighter crashes with StreamSyntax

This should be fixed by lezer-tree 0.12.1

PhilippRaab

comment created time in 8 hours

created taglezer-parser/lezer-tree

tag0.12.1

Packed syntax tree data structure

created time in 8 hours

push eventlezer-parser/lezer-tree

Marijn Haverbeke

commit sha 18f6bce25476edca6e6c17c50173997de381becd

Fix bug when appending an empty tree FIX: Fix issue where using `Tree.append` with an empty tree as argument would return a tree with a nonsensical `length` property.

view details

Marijn Haverbeke

commit sha fdde518e9827b78130efb4ceb62677db2034daeb

Mark version 0.12.1

view details

push time in 8 hours

issue openedcodemirror/codemirror.next

Do something about a crash leaving the updating flag set, breaking any further use of the instance

It's kind of hard to do something meaningful, since the crash could have happened anywhere during imperative update code, and thus the internal state might be corrupt, but the current situation, where that just gives you a completely unusable instance, is just about the worst outcome possible.

created time in 8 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 7e08de527fc194050e142b084fb5fe8d72bd20cf

Tweak styling of blurred cursor and active line

view details

push time in 9 hours

issue commentcodemirror/CodeMirror

[closebrackets] wrong reusing of closing brackets

I've implemented this for CodeMirror 6 in https://github.com/codemirror/codemirror.next/commit/a0ddc17c7cca743dc89fe3f9a12158ee0d0da2e5 , but I don't expect to get around to implementing it in version 5 anytime soon.

AlttiRi

comment created time in 10 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 89b51a9c6c4828111d406e3017256f17f45112e0

Allow the callback to changeByRange to produce effects FEATURE: The function passed to `changeByRange` may now also return effects for each range.

view details

Marijn Haverbeke

commit sha a0ddc17c7cca743dc89fe3f9a12158ee0d0da2e5

Make closeBrackets only skip over brackets it itself added See https://github.com/codemirror/CodeMirror/issues/6430 FIX: `closeBrackets` will no longer type-over brackets that it did not itself insert.

view details

push time in 10 hours

push eventcodemirror/CodeMirror

Marijn Haverbeke

commit sha e6b094ac19e91df8d8eea3f3bfc3d802ea2a47c2

Delay blur events during dragging Issue #6427

view details

push time in 12 hours

pull request commentcodemirror/CodeMirror

fix focus/blur issues during editing

because I do not know if it is safely set back to false

Indeed, that's no good either. Does something like https://github.com/codemirror/CodeMirror/tree/delay-blur , which preserves the delayBlurEvent flag during draggin, work for you?

rPraml

comment created time in 13 hours

create barnchcodemirror/CodeMirror

branch : delay-blur

created branch time in 13 hours

release codemirror/CodeMirror

5.58.2

released time in 13 hours

created tagcodemirror/CodeMirror

tag5.58.2

In-browser code editor

created time in 13 hours

push eventcodemirror/CodeMirror

Marijn Haverbeke

commit sha 264022ee4af4abca1c158944dc299a8faf8696d6

Mark version 5.58.2

view details

push time in 13 hours

delete tag codemirror/CodeMirror

delete tag : 5.58.2

delete time in 13 hours

push eventmarijnh/mold

Brecht Savelkoul

commit sha 760978f09df90e72db019bcd1c2888ddba909133

Validate template is string when baking

view details

push time in a day

PR merged marijnh/mold

Validate template is string when baking

If you directly pass an undecoded Buffer into bake, it throws an error only on dispatch, making it very hard to trace the original bug. This has tripped me up several times already (with some months in between). Added some validation to protect future me against this same mistake.

I don't think this is a breaking change, as it should only throw in code that's already broken.

+12 -0

0 comment

2 changed files

brechtcs

pr closed time in a day

issue closedProseMirror/prosemirror-markdown

Click to view line markdown source

Like https://laobubu.net/HyperMD/#README.md

Can this be achieved in prosemirror?

closed time in a day

linonetwo

issue commentProseMirror/prosemirror-markdown

Click to view line markdown source

It'd be awkward, since the extra markup characters aren't part of the document and you'd need serious scripted magic to make editing them feel like regular text editing.

Please use the forum, not the bug tracker, for questions in the future.

linonetwo

comment created time in a day

issue closedcodemirror/CodeMirror

Tern Server Documentation

Why not jsut display the script you used to setup your demo ?

I mean it cant really be the optimal for me to have to open dev tools on your demo page and take a look :D

code is the best documentaion ^^

  function getURL(url, c) {
    var xhr = new XMLHttpRequest();
    xhr.open("get", url, true);
    xhr.send();
    xhr.onreadystatechange = function() {
      if (xhr.readyState != 4) return;
      if (xhr.status < 400) return c(null, xhr.responseText);
      var e = new Error(xhr.responseText || "No response");
      e.status = xhr.status;
      c(e);
    };
  }

  var server;
  getURL("https://unpkg.com/tern/defs/ecmascript.json", function(err, code) {
    if (err) throw new Error("Request for ecmascript.json: " + err);
    server = new CodeMirror.TernServer({defs: [JSON.parse(code)]});
    editor.setOption("extraKeys", {
      "Ctrl-Space": function(cm) { server.complete(cm); },
      "Ctrl-I": function(cm) { server.showType(cm); },
      "Ctrl-O": function(cm) { server.showDocs(cm); },
      "Alt-.": function(cm) { server.jumpToDef(cm); },
      "Alt-,": function(cm) { server.jumpBack(cm); },
      "Ctrl-Q": function(cm) { server.rename(cm); },
      "Ctrl-.": function(cm) { server.selectName(cm); }
    })
    editor.on("cursorActivity", function(cm) { server.updateArgHints(cm); });
  });

  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
    lineNumbers: true,
    mode: "javascript"
  });

closed time in a day

jonnytest1

issue commentcodemirror/CodeMirror

Tern Server Documentation

That's the idea behind the examples, that you look at their source on github or in the devtools. Also, that script adds very little to the things that are already documented.

jonnytest1

comment created time in a day

issue closedcodemirror/CodeMirror

Inappropriate Link in Old Docs

<!-- Do not use this bug tracker for questions. We have a forum (https://discuss.codemirror.net) for those.

In order to get us to look at something, you need to make it easy for us to understand what you are doing and what went wrong. When possible, a code example that demonstrates the problem helps a lot. If there's any chance at all that a problem is related to the browser, include information about which browser(s) you tested with. -->

Link to Adult Themed Website

The is a link to an adult website on codemirror.net

Steps to reproduce

  1. Go to codemirror.net/1/contrib/csharp/
  2. Click on the Written by "Boris Gaber and Christopher Buchino" link
  3. Notice that it takes you to an adult website

It's basically some sketchy pornography site.

closed time in 3 days

rbaker26

issue commentcodemirror/CodeMirror

Inappropriate Link in Old Docs

Thanks for noticing that. I guess the domain expired and got taken over. I've removed the links in https://github.com/codemirror/CodeMirror-v1/commit/2d7adc98d16cfb05aecf208177d4a4281b43ce30

rbaker26

comment created time in 3 days

push eventcodemirror/CodeMirror-v1

Marijn Haverbeke

commit sha 2d7adc98d16cfb05aecf208177d4a4281b43ce30

Remove link to domain taken over by a porn site

view details

push time in 3 days

issue closedcodemirror/codemirror.next

get Subtree through iteration

Hi,

When using the method iterate on a SubTree, for some cases I'm not able to get the corresponding SubTree where the iteration stopped.

For example, I have the following tree:

Expr(
  BinaryExpr(
    Expr(
      AggregateExpr(
        AggregateOp(sum),
        FunctionCallBody(
          FunctionCallArgs(
            Expr(
              MetricIdentifier(
                Identifier
              )
            )
         )
       )
     )
   )
)

which matched the following expression:

sum(rate)

For this example, FunctionCallBody, FunctionCallArgs, Expr and MetricIdentifier are started at the same position.

I have the following iteration method:

function getNode(node: Subtree) {
    let i = 0;
    const subChildChained = ['AggregateExpr', 'FunctionCallBody', 'FunctionCallArgs', 'Expr'];
    const child = node.iterate<Subtree>({
      enter: (type, start) => {
        if (i >= subChildChained.length) {
          return node.resolve(start, -1);
        }
        if (type.name === subChildChained[i]) {
          i++;
          // continue to loop on this node
          return undefined;
        }
        // go to the next node
        return false;
      },
    });
}

the idea is to give the path to follow thanks to the array subChildChained to the iteration method. Then if the last node is found, it returns the associated Subtree.

Unfortunately, so far I didn't find how to get it. I tried by using node.resolve or node.childBefore or node.childAfter but since I have multiple node started at the same position, I'm not able to get the Subtree for the node MetricIdentifier but only for the node FunctionCallBody.

Is there a way to get exactly the node where I stopped the iteration ?

closed time in 3 days

Nexucis

issue commentcodemirror/codemirror.next

get Subtree through iteration

The TreeCursor interface in lezer-tree 0.12.0 allow converting between that and a node object, which should cover this.

Nexucis

comment created time in 3 days

release codemirror/CodeMirror

5.58.2

released time in 3 days

created tagcodemirror/CodeMirror

tag5.58.2

In-browser code editor

created time in 3 days

pull request commentcodemirror/CodeMirror

Add WebAssembly (wast) to meta.js

Thanks!

voraciousdev

comment created time in 3 days

push eventcodemirror/CodeMirror

David R. Myers

commit sha 23b7a9924b5f9460a091e97392dd00d3834e8cc6

Add WebAssembly to meta

view details

push time in 3 days

PR merged codemirror/CodeMirror

Add WebAssembly (wast) to meta.js

closes #6450

Summary

The WebAssembly wast mode already exists, but it is not currently available via meta.js. This will apply to the .wat and .wast extension for now, but it looks like .wat and .wast have separate meanings going forward.

+2 -1

0 comment

1 changed file

voraciousdev

pr closed time in 3 days

issue closedcodemirror/CodeMirror

wast mode not listed in meta

I use the meta.js file to autoload modes for syntax highlighting in markdown code blocks. The wast mode exists, but it is not listed in meta.js.

closed time in 3 days

voraciousdev

issue commentcodemirror/CodeMirror

wast mode not listed in meta

Want to create a pull request that adds it?

voraciousdev

comment created time in 3 days

created taglezer-parser/rust

tag0.12.0

Rust grammar for Lezer

created time in 3 days

push eventlezer-parser/rust

Marijn Haverbeke

commit sha 01b87f9d7713401fbd17f0a2e28e1abac62d691c

Add @ in front of pseudo-props

view details

Marijn Haverbeke

commit sha a2919b0a79698add6e456574cf44adc85f9e0119

Assign node groups

view details

Marijn Haverbeke

commit sha 22f3d2d09beca3797d4cf13da996d87ae3dbe28a

Mark version 0.12.0

view details

push time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 9f3cef25744f82d6cc84cdd2ad91ca5fb834cf4b

Fix highlighting of mismatched XML close tags

view details

push time in 3 days

issue closedcodemirror/codemirror.next

Stop using -1 as special return value

It sabotages TypeScript's ability to notice ignored error results. Should use null instead in most cases.

closed time in 3 days

marijnh

issue commentcodemirror/codemirror.next

Stop using -1 as special return value

Done in attached patches.

marijnh

comment created time in 3 days

created tagcodemirror/codemirror.next

tag0.14.0

The next generation of the CodeMirror in-browser editor

created time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 9af7ceb0e96ae58c5f6b787f937369509a2c95fd

Start adjusting to lezer 0.12 interface BREAKING: Lezer and lezer-tree have been upgraded to 0.12, which introduces a few breaking changes.

view details

Marijn Haverbeke

commit sha dedf8f7aab29f632f572669e401d97edd7ae37d4

Adjust SQL grammar to Lezer 0.12 notation

view details

Marijn Haverbeke

commit sha 580390a06bee536ce4d94cf64febf14bf9b43ffa

Add tests for SQL completion

view details

Marijn Haverbeke

commit sha 97a93c47d281e46494fdefb1e49e5091e6b8bc07

Add tests for HTML completion

view details

Marijn Haverbeke

commit sha 49dafbfb7281a46f499fa7d5f6833cfea2331f05

Update XML completion for changes in XML grammar

view details

Marijn Haverbeke

commit sha e59a09c35a3fd8093a89f9df8b9b0259edbde3a8

Drop mapPosStable Since it isn't actually stable.

view details

Marijn Haverbeke

commit sha ac3e241186977730ff0344e5cc3169e8cb679323

Make mapPos return null for deletion Issue #321 BREAKING: `ChangeDesc.mapPos` now returns null instead of -1 when reporting a deletion.

view details

Marijn Haverbeke

commit sha 9606f8af76c4a93e76dc082338c24207c4706cff

Make posAtCoords return null on failure BREAKING: `EditorView.posAtCoords` now returns null, rather than -1, when it fails to find a position. Issue #321

view details

Marijn Haverbeke

commit sha 6fbd607b3a218933a26bb6d7e1507c221b3fa5e8

Mark version 0.14.0

view details

push time in 3 days

created taglezer-parser/json

tag0.12.0

JSON grammar for Lezer

created time in 3 days

push eventlezer-parser/json

Marijn Haverbeke

commit sha 033ed6574b566360af4e89e9350b9301b1808c6f

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/python

tag0.12.0

A Python parser for Lezer

created time in 3 days

push eventlezer-parser/python

Marijn Haverbeke

commit sha 26e7e553d052bd93a66aae4754e1f32ebcc50491

Adjust to change in Stack.startOf return type

view details

Marijn Haverbeke

commit sha 2d23ff04a0ad9473ed24aa60f63f584b27604a3a

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/java

tag0.12.0

Java grammar for Lezer

created time in 3 days

push eventlezer-parser/java

Marijn Haverbeke

commit sha 7c57b66e1e2d7e0e222fd73d41d30dd4b154c8c1

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/cpp

tag0.12.0

C++ grammar for the Lezer parser system

created time in 3 days

push eventlezer-parser/cpp

Marijn Haverbeke

commit sha 42084a2cf9fb4f09a8f41120016ab7ce850b894f

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/xml

tag0.12.0

An XML parser for lezer

created time in 3 days

push eventlezer-parser/xml

Marijn Haverbeke

commit sha 0fb3c0e25b224b3b2701004b086add7dd64dd5b3

Improve recovery from mismatched close tags

view details

Marijn Haverbeke

commit sha fb2cb0e8636a09a3e3416d22efab99adebd2b451

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/html

tag0.12.0

An HTML parser for Lezer

created time in 3 days

push eventlezer-parser/html

Marijn Haverbeke

commit sha 6c6139e65872cbae4428bfe81cbc483efdea15db

Improve handling of mismatched close tags FEATURE: The parser now more effectively matches close and open tags, even in the presence of mismatched tags.

view details

Marijn Haverbeke

commit sha 9ea4c2a6a2463226814a6ad42daa8643bff9f938

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/css

tag0.12.0

CSS grammar for lezer

created time in 3 days

push eventlezer-parser/css

Marijn Haverbeke

commit sha f3301218e8735db44360f8972b42ea567131f9a2

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/javascript

tag0.12.0

A JavaScript lezer grammar

created time in 3 days

push eventlezer-parser/javascript

Marijn Haverbeke

commit sha 46a30eacc687ad74896fd75f7bf283e5752619bb

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/lezer-generator

tag0.12.0

Parser generator for the lezer incremental parser

created time in 3 days

push eventlezer-parser/lezer-generator

Marijn Haverbeke

commit sha 78d648021170562165db35fb9e6c5e4c144e8879

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/lezer

tag0.12.0

Incremental parsing system

created time in 3 days

push eventlezer-parser/lezer

Marijn Haverbeke

commit sha 3bd729db13163659ace0d8a6f2860529136779db

Add before argument to Stack.startOf FEATURE: `Stack.startOf` now takes an optional second argument that allows you to select a match beyond the innermost one.

view details

Marijn Haverbeke

commit sha 8e2648f14de1090eb13360ea9c18289d177cb240

Make startOf return null on failure BREAKING: `Stack.startOf` now returns null, rather than -1, when it can't find the given element.

view details

Marijn Haverbeke

commit sha 532ab6563dd59651a2b2743b8dba40526e8d0e34

Mark version 0.12.0

view details

push time in 3 days

created taglezer-parser/lezer-tree

tag0.12.0

Packed syntax tree data structure

created time in 3 days

push eventlezer-parser/lezer-tree

Marijn Haverbeke

commit sha 11f25a2f6d5f8a419cbe66691806847f2771409a

Don't select empty nodes in moveTo

view details

Marijn Haverbeke

commit sha f9a7c32109426ab1781560f30591ca9fb5781ac1

Mark version 0.12.0

view details

push time in 3 days

issue openedcodemirror/codemirror.next

Stop using -1 as special return value

It sabotages TypeScript's ability to notice ignored error results. Should use null instead in most cases.

created time in 3 days

issue commentcodemirror/codemirror.next

btoa

Loading view-only components in node is, on the whole, not a very meaningful thing to do (they won't work), but I'm trying to make it at least not error. See attached patch.

jet10000

comment created time in 4 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 381f819a1cdcef8188c77df81b39abd7adb30017

Revise fix in domBoundsAround

view details

Marijn Haverbeke

commit sha 043f8fb15345c011b95972fdd70a39a3192d6224

Don't call btoa when loading the lint package on node Closes #319

view details

Marijn Haverbeke

commit sha f1591fcdb8ee0092c210e73c061b9016c4d36264

Make sure editor attributes are updated for measure-driven changes Closes #320

view details

push time in 4 days

issue closedcodemirror/codemirror.next

btoa

    return `url('data:image/svg+xml;base64,${btoa(svg)}')`;
    ^

ReferenceError: btoa is not defined

closed time in 4 days

jet10000

issue closedcodemirror/codemirror.next

cannot focus a new EditorView

Calling .focus() on a new EditorView no longer focuses the editor, and prevents a future call to .focus() from having an effect (unless focus has moved away from the element).

Using git bisect I traced this to 5f089553f2626822a8cfef87bf750126590e9343.

I tested by adding the following code to demo/demo.js and reloading the demo page. What I expect is that the editor is focused, but it isn't.

window.view.focus()

// the first .focus() also prevents this from working
setTimeout(function(){window.view.focus()}) 

A workaround is to put view.focus() inside a setTimeout, but this does not work if .focus() has already been called synchronously.

closed time in 4 days

mhuebert

push eventlezer-parser/python

Marijn Haverbeke

commit sha 8ccadc849c350a9f2023efbd0d1b55b773a7c0f0

Add @ in front of name pseudo-props

view details

Marijn Haverbeke

commit sha a0487aa0acc4cccad599ef0da769c7eb4aff49b9

Use pseudo-prop syntax for @export

view details

Marijn Haverbeke

commit sha 6d4dbbeedf496d7a46f97a57c063f7cdb705933d

Assign node groups

view details

push time in 4 days

push eventlezer-parser/java

Marijn Haverbeke

commit sha b3b167a882274797a0c69c7ce020b01b857dcd07

Add @ in front of pseudo-props

view details

Marijn Haverbeke

commit sha 8dd5d7f7bb062121ae40e347d7f860ac3cccb5ab

Assign node groups

view details

push time in 4 days

push eventlezer-parser/cpp

Marijn Haverbeke

commit sha 60910697db718376877f4cc309d4318312ebe5ac

Add @ in front of pseudo-props

view details

Marijn Haverbeke

commit sha 8027982761c5e6d2171a4f8627dea21acc8ca355

Assign node groups

view details

push time in 4 days

push eventlezer-parser/xml

Marijn Haverbeke

commit sha 1b745b4960ecf18fe14adedc9f41857d4c741a97

Add @ in front of name pseudo-props

view details

push time in 4 days

push eventlezer-parser/html

Marijn Haverbeke

commit sha 9f95b9e8b8c755a7e107e9714f7d349b2fc82e8e

Add @ in front of pseudo-props

view details

Marijn Haverbeke

commit sha e1f37e3a885cd483cd6a868db69b362075619098

Use pseudo-prop syntax for @export

view details

push time in 4 days

push eventlezer-parser/css

Marijn Haverbeke

commit sha 170364309cc469b7cc0a6ca9d1e44ad74334d5c8

Add @ in front of name pseudo-props

view details

push time in 4 days

push eventlezer-parser/javascript

Marijn Haverbeke

commit sha 124acb3eeb408eb40c66c86f0e9d205d4a1e9f6c

Add @ in front of pseudo-props

view details

Marijn Haverbeke

commit sha 0110ae11056c32ed5a1031a654cb68333c15f992

Assign node groups

view details

push time in 4 days

push eventlezer-parser/lezer-generator

Marijn Haverbeke

commit sha 61045f7f966695267259dc202670e4c39e3a4de4

Get rid of awkward noProps construct

view details

Marijn Haverbeke

commit sha 843301459978bcec99f33281c6f16b0bd0b7e9be

Require @ in front of built-in prop names Avoiding name clashes with user-defined ones BREAKING: Pseudo-props like `name`, `dialect`, `inline` and `dynamicPrec` now require an `@` in front of them when specified in a rule's prop list.

view details

Marijn Haverbeke

commit sha 3b8d99f2dbe9fe544b307e56fe4b69080307637e

Add @isGroup shorthand for defining node groups FEATURE: Rules can now specify an `@isGroup` pseudo-prop to automatically attach a group name to all the (single) named nodes they produce.

view details

Marijn Haverbeke

commit sha b5f27eccb949c8e0f93146822aecd6126f8a73b9

Move to pseudo-prop syntax for @export To simplify the grammar syntax a bit. BREAKING: `@export` is now specified as a pseudo-prop instead of in front of the rule.

view details

Marijn Haverbeke

commit sha d73410e4435c4dab8a54f3a8378ab1cd8de8ead1

Make @isGroup capable of recursing into unnamed child rules

view details

Marijn Haverbeke

commit sha 3e8e9408fefe7b8b298d60b2a031be44a03e9a83

Make the serialized node prop format more compact

view details

Marijn Haverbeke

commit sha 9f44e0a6cdb8991c8d64991685b1445a90607865

Allow multiple groups per node type Add a warning pass that checks for dodgy assignment of groups.

view details

Marijn Haverbeke

commit sha 291c21015dfcee444ba6e626f63047a65da4f87b

Suggest @-variant in error for undefined props

view details

Marijn Haverbeke

commit sha 5edd5021348a784290715247c6e010c8719b41f2

Make top rule name obligatory Removing the annoying exception where top nodes are the only nodes that can be unnamed. BREAKING: Top rule names are now required.

view details

push time in 4 days

push eventlezer-parser/lezer

Marijn Haverbeke

commit sha b2c6350e4885e8f03a7b5bc3b02db2f2b1e385be

Slightly complicate prop reading to allow more compact files Specifically for the representation of the group prop.

view details

push time in 4 days

push eventlezer-parser/lezer-tree

Marijn Haverbeke

commit sha 725291cbb840b263819775966b34b17c9f089d4c

Use original node as cache when constructring a buffer tree cursor

view details

Marijn Haverbeke

commit sha 50c6da9702b65b8726344839e7cd1f5bbb8ec7af

Add the group prop FEATURE: Adds `NodeProp.group` to assign group names to node types.

view details

Marijn Haverbeke

commit sha d302f139e321ec896cf963280465d28c531441b1

Make getChild/getChildren node-group-aware FEATURE: Syntax nodes now have helper functions `getChild` and `getChildren` to retrieve direct child nodes by type or group.

view details

Marijn Haverbeke

commit sha 0d831decf0b4b8b2132ec770e1be738bb0550db8

Fix method name of TreeCursor.prevSibling

view details

Marijn Haverbeke

commit sha 6b2aa44133f14c75cee02329d07899e70952f0b1

Allow multiple groups per node type, integrate groups better FEATURE: `NodeType.match` (and thus `NodeProp.add`) now allows types to be targeted by group name. FEATURE: Node types have a new `is` method for checking whether their name or one of their groups matches a given string.

view details

Marijn Haverbeke

commit sha 640f3f33f4ec3b19b83edc7bbf8a8713ef01f444

Don't pick zero-length nodes on the boundary in childAfter/Before

view details

push time in 4 days

push eventcodemirror/CodeMirror

tophf

commit sha 212bafa8ab7837abebc1d326ed943540a9a47200

[stylus mode] Recognize "url-prefix" token properly

view details

push time in 4 days

pull request commentcodemirror/CodeMirror

[stylus mode] Recognize "url-prefix" token properly

Thanks!

tophf

comment created time in 4 days

PR merged codemirror/CodeMirror

[stylus mode] Recognize "url-prefix" token properly

Test case:

@-moz-document url-prefix("https") {
  a {} 
}

Expected/fixed behavior:

A single url-prefix token is recognized.

Current bugged behavior:

url and -prefix tokens are recognized separately.

The underlying cause was that documentTypes_ was used to create a regexp in documentTypesRegexp so the shorter url was always matching first.

+2 -1

0 comment

1 changed file

tophf

pr closed time in 4 days

issue closedcodemirror/CodeMirror

Cannot change inputStyle

https://github.com/codemirror/CodeMirror/blob/2571b4ad08e007c246d73bdd973892bf5dd7b02e/src/edit/options.js#L78

Any idea when this will be fixed? Or if there are no plans, is there any documentation on why this is the way that it is?

closed time in 4 days

tylershuster

issue commentcodemirror/CodeMirror

Cannot change inputStyle

Support for this won't be added anymore. There's quite a bit of editor state that works differently depending on the input style, and the work to wire up everything to update when changing input styles was never done. Since focus is now on the upcoming version 6 (which is always contentEditable-based), I don't have plans to do further work on this feature.

tylershuster

comment created time in 4 days

issue closedcodemirror/CodeMirror

Unclear what the relationship between defineMode, defineMIME, modeInfo, and mimeModes is.

There seems to be a variety of overlapping, but independent, places where mode information is stored. For example, calling defineMode() and defineMIME seems to correctly update the CodeMirror.mimeModes object, but not CodeMirror.modeInfo, which means that CodeMirror.findModeByMIME fails to find modes added solely through defineMIME. It's not clear to me what the utility of calling defineMIME is at all, as the only source of truth seems to be the contents of the meta.js file.

Anyways, I am in a situation where I am wanting to add modes to new mime types dynamically, and the only thing that seems to actually have the desired effect is to manually mutate the modeInfo object directly. If this is the expected way to do things, then that is totally fine, just seems like defineMIME is somewhat of a red herring in its current incarnation.

closed time in 4 days

tolmasky

issue commentcodemirror/CodeMirror

Unclear what the relationship between defineMode, defineMIME, modeInfo, and mimeModes is.

modeInfo is used to look up mode implementations by name or extension. These may not have been loaded yet. As they are loaded, modes use defineMode to register the actual mode implementation and defineMIME to associate one or more MIME types with it. You can add to modeInfo at run-time, for example to add modes that it doesn't yet know about, but the typical use case is to just use it as a static database about the built-in modes.

tolmasky

comment created time in 4 days

issue commentlezer-parser/clojure

publishing to npm

Feel free to publish this as lezer-clojure.

mhuebert

comment created time in 6 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 8c6d87126152efcaaa6f103f54cf59eea965fdff

Integrate jsonParseLinter FEATURE: The lang-json package now exports a `jsonParseLinter` function that produces a linter based on `JSON.parse`. Issue #316

view details

Marijn Haverbeke

commit sha 7b730cb460c0fd218dbfb9a6aecee6866141632d

Fix a bug in domBoundsAround If the DOM change removed the node at the end of the changed region from the DOM, it would still return it as end node.

view details

push time in 7 days

push eventcodemirror/codemirror.next

Philipp Raab

commit sha cc6a9e70b8ba6eb15940f3ca160af9039393f44f

Add json parse linter to json-lang package (#316)

view details

push time in 7 days

push eventmarijnh/style-mod

Marijn Haverbeke

commit sha f9f74b4f5480549b3d060ee35abf74c2c1d48b17

Fix missing docs in README

view details

push time in 8 days

push eventlezer-parser/javascript

Marijn Haverbeke

commit sha 3c2c4804e82bcc792402fd6a27f60792dd5abdb3

Remove accidentally committed half-baked test

view details

push time in 9 days

push eventlezer-parser/lezer-generator

Marijn Haverbeke

commit sha 75216cbca78f58fe2858b91ee8582706ea26c662

Avoid indirection when a state's actions are all shared

view details

Marijn Haverbeke

commit sha 377b15729bd62ca067765fa3d9300ca452962b56

Adjust tests to changes in tree interface

view details

Marijn Haverbeke

commit sha b936b311217b8b4d92b27823d38c84b441965070

Follow changes in lezer-tree interface

view details

Marijn Haverbeke

commit sha 89e3078bde85ea0cc41dea5d7956446afe49ef9f

Adjust to introduction of node type flags BREAKING: The serialized parser format changed.

view details

Marijn Haverbeke

commit sha 95db01388e33ec5f6669f2ccdd1a840cf9972161

Emit a version number with serialized parsers

view details

push time in 9 days

push eventlezer-parser/lezer

Marijn Haverbeke

commit sha aa0463e279502670ecebb63408185f963cf25416

Adjust tree re-exports for Subtree->TreeCursor change BREAKING: Follow the change from `Subtree` to `TreeCursor` in lezer-tree.

view details

Marijn Haverbeke

commit sha d5a82d92c417160fdfdebdc9facc3bbbe2b76510

Follow changes in lezer-tree's interface

view details

Marijn Haverbeke

commit sha ce09af5475c5623eaffedc8bdc8573ac90c238c5

Follow change to node type flags BREAKING: The serialized parser format changed.

view details

Marijn Haverbeke

commit sha 4e04e3a2a9d8d9dee5ec4d0320cc88c371fa5d2a

Require a version number in serialized parsers To avoid obscure errors on mismatches

view details

push time in 9 days

more