)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"f6245655b194b6e71993453bd28bb9e3f152438e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"ffa3fd1e_394601a4","updated":"2023-05-05 14:56:58.000000000","message":"Added support for partially applied functions.\nDocumentation flows from generic to specific use-case. Where the more specific documentation will shadow the generic one.\n\nExample:\n\n```nix\n{\n  add \u003d \n    x: \n    /**Docstring 1*/\n    y: x+y;\n  \n  /**Docstring 2*/\n  addOne \u003d add 1;\n}\n```\nQuestion:\n\nWhere do we find the single correct documentation for addOne?\n\nAnswer:\n\nDocstring2 is the doc-comment written specifically for \"addOne\" \nis there is no doc-comment attached to \"add 1\" \n  then we just take the one from \"y: x+y\" \n  (which could be a more generic one)","commit_id":"9ab155625c0bf9d5f6bc6b323842f72fc542be35"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"868114d157c294e3a22b8789f1b28003bb682529","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"bc0a666f_4b1d3e51","updated":"2023-05-10 09:42:12.000000000","message":"Just pushed a new commit, including many small tests.","commit_id":"5fbfdd68d7829d848c7420561450c1fe0bdcbcb5"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"9361534ace25f61d2f9019487df0069d181a8d50","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"30b343f0_81b85110","updated":"2023-05-17 16:33:27.000000000","message":"@tazjin you mentioned that this feature could live behind a feature flag until it is stable.\nAlso there might be runtime penalties that need to be tested before adding this.","commit_id":"3314843293414de0436e597e9f6fd010e8829364"}],"tvix/eval/src/compiler/comment.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"6dfbab0ecc1c29cc8f776fa1aa0cd86565210cfc","unresolved":true,"context_lines":[{"line_number":16,"context_line":"        // /** but not with /**/ which is a regular comment"},{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"51e96287_267aa10f","line":19,"updated":"2023-04-28 11:54:49.000000000","message":"unwrap is a bit dirty. What about dropping the `is_doc()` function, and instead having `doc_text()` return a `Option\u003c\u0026str\u003e`?\n\nCallers who only want to conditionally do something with the doc text if there can use\n\n```\nif let Some(doc_text) \u003d ….doc_text() {\n …\n}\n```\n\nI guess most consumers actually want to do something with the doc text if it exists, or actually use an Option\u003c\u0026str\u003e on their side anyways - so having a separate `is_doc()` function to run first would actually be more work - and I guess if you want to match on the other side (`.is_none()`), rustc should optimize out most of the other code that deals with the value, because the caller doesn\u0027t care about it.","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"c6464aa9e245a9e62076ab76671cd3d4a4ae5433","unresolved":true,"context_lines":[{"line_number":16,"context_line":"        // /** but not with /**/ which is a regular comment"},{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"d5e14af3_954ea12e","line":19,"in_reply_to":"51e96287_267aa10f","updated":"2023-04-28 12:47:21.000000000","message":"Reworked that into a single function returning Option\u003c\u0026str\u003e","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"a5909e4b475f256f1fdbf9e156977a52f4a0968e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"        // /** but not with /**/ which is a regular comment"},{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"f80e4181_1a30f79e","line":19,"in_reply_to":"d5e14af3_954ea12e","updated":"2023-04-28 13:20:45.000000000","message":"Done","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"6dfbab0ecc1c29cc8f776fa1aa0cd86565210cfc","unresolved":true,"context_lines":[{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":23,"context_line":"        text.strip_prefix(r#\"/**\"#)"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"145b708a_4ef119de","line":20,"updated":"2023-04-28 11:54:49.000000000","message":"Can you a comment this is meant to complement the `text()` function defined in `rnix::Comment`.","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"c6464aa9e245a9e62076ab76671cd3d4a4ae5433","unresolved":false,"context_lines":[{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":23,"context_line":"        text.strip_prefix(r#\"/**\"#)"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"0874b9c0_22aa01b7","line":20,"in_reply_to":"020ad211_ce49308f","updated":"2023-04-28 12:47:21.000000000","message":"Done","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"e6052274c748773fde74a3fb0b7d92b9226e02c8","unresolved":true,"context_lines":[{"line_number":17,"context_line":"        text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\")"},{"line_number":18,"context_line":"    }"},{"line_number":19,"context_line":"    /// .is_doc() should be called before to check"},{"line_number":20,"context_line":"    /// whether this is a doc-comment; otherwise this just yields the raw-text"},{"line_number":21,"context_line":"    fn doc_text(\u0026self) -\u003e \u0026str {"},{"line_number":22,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":23,"context_line":"        text.strip_prefix(r#\"/**\"#)"}],"source_content_type":"text/x-rustsrc","patch_set":1,"id":"020ad211_ce49308f","line":20,"in_reply_to":"145b708a_4ef119de","updated":"2023-04-28 12:12:53.000000000","message":"Yes. Good hint. Otherwise might be confusing why this is called \"text\"","commit_id":"cd1731ad6cbdf336b32b5336871746e372b4bc51"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"5f6f9c395bca22e668b8363261c870ac437af786","unresolved":true,"context_lines":[{"line_number":20,"context_line":"    fn doc_text(\u0026self) -\u003e Option\u003c\u0026str\u003e {"},{"line_number":21,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":22,"context_line":"        // Check whether this is a doc-comment"},{"line_number":23,"context_line":"        if text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\") {"},{"line_number":24,"context_line":"            match text.strip_prefix(r#\"/**\"#) {"},{"line_number":25,"context_line":"                Some(t) \u003d\u003e t.strip_suffix(r#\"*/\"#),"},{"line_number":26,"context_line":"                _ \u003d\u003e None,"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"fdddfb39_c4b70ff4","line":23,"updated":"2023-05-08 08:07:55.000000000","message":"Why do we need to check for both of these here? Can\u0027t we just check if `self.text()` starts with a \"*\", and if so, return everything after that?\n\nOr is the problem that ast::Comment is used for both single-line and multi-line comments?","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"4e00236f4eeb0c43ef8670101186e7de2f447955","unresolved":true,"context_lines":[{"line_number":20,"context_line":"    fn doc_text(\u0026self) -\u003e Option\u003c\u0026str\u003e {"},{"line_number":21,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":22,"context_line":"        // Check whether this is a doc-comment"},{"line_number":23,"context_line":"        if text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\") {"},{"line_number":24,"context_line":"            match text.strip_prefix(r#\"/**\"#) {"},{"line_number":25,"context_line":"                Some(t) \u003d\u003e t.strip_suffix(r#\"*/\"#),"},{"line_number":26,"context_line":"                _ \u003d\u003e None,"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"c496a373_00869639","line":23,"in_reply_to":"8f066b85_6cad4d66","updated":"2023-05-08 10:51:36.000000000","message":"Can you add this in a small comment in L13?","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"be02e7dcc6bc4260139942952b4f0c4db00686eb","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    fn doc_text(\u0026self) -\u003e Option\u003c\u0026str\u003e {"},{"line_number":21,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":22,"context_line":"        // Check whether this is a doc-comment"},{"line_number":23,"context_line":"        if text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\") {"},{"line_number":24,"context_line":"            match text.strip_prefix(r#\"/**\"#) {"},{"line_number":25,"context_line":"                Some(t) \u003d\u003e t.strip_suffix(r#\"*/\"#),"},{"line_number":26,"context_line":"                _ \u003d\u003e None,"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"1867b034_965bb853","line":23,"in_reply_to":"c496a373_00869639","updated":"2023-05-10 10:31:50.000000000","message":"Done","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"e13e53d6081318eabb84bd38b0b9524d5c588707","unresolved":true,"context_lines":[{"line_number":20,"context_line":"    fn doc_text(\u0026self) -\u003e Option\u003c\u0026str\u003e {"},{"line_number":21,"context_line":"        let text \u003d self.syntax().text();"},{"line_number":22,"context_line":"        // Check whether this is a doc-comment"},{"line_number":23,"context_line":"        if text.starts_with(r#\"/**\"#) \u0026\u0026 self.text().starts_with(\"*\") {"},{"line_number":24,"context_line":"            match text.strip_prefix(r#\"/**\"#) {"},{"line_number":25,"context_line":"                Some(t) \u003d\u003e t.strip_suffix(r#\"*/\"#),"},{"line_number":26,"context_line":"                _ \u003d\u003e None,"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"8f066b85_6cad4d66","line":23,"in_reply_to":"fdddfb39_c4b70ff4","updated":"2023-05-08 08:50:10.000000000","message":"Yes. It is used for both single and multiline comments","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"}],"tvix/eval/src/compiler/mod.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"0c31d21f577dcd679648988ad0a2cfb518cb1a6e","unresolved":true,"context_lines":[{"line_number":1128,"context_line":"        if let Some(lambda) \u003d expr {"},{"line_number":1129,"context_line":"            match self.get_lambda_docs(lambda) {"},{"line_number":1130,"context_line":"                Some(d) \u003d\u003e {"},{"line_number":1131,"context_line":"                    self.context_mut().lambda.doc \u003d Some(SmolStr::from(d.doc_text()));"},{"line_number":1132,"context_line":"                }"},{"line_number":1133,"context_line":"                _ \u003d\u003e (),"},{"line_number":1134,"context_line":"            };"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"3592b443_5a098f43","line":1131,"updated":"2023-04-28 12:00:24.000000000","message":"With the comment above, you can just do `self.context_mut().lambda.doc \u003d d.doc_text().map(SmolStr::from)`","commit_id":"9f5e00aec4ccbbcb52862eeb105ce9a9611de372"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"c6464aa9e245a9e62076ab76671cd3d4a4ae5433","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"        if let Some(lambda) \u003d expr {"},{"line_number":1129,"context_line":"            match self.get_lambda_docs(lambda) {"},{"line_number":1130,"context_line":"                Some(d) \u003d\u003e {"},{"line_number":1131,"context_line":"                    self.context_mut().lambda.doc \u003d Some(SmolStr::from(d.doc_text()));"},{"line_number":1132,"context_line":"                }"},{"line_number":1133,"context_line":"                _ \u003d\u003e (),"},{"line_number":1134,"context_line":"            };"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"d5030445_66a64033","line":1131,"in_reply_to":"3592b443_5a098f43","updated":"2023-04-28 12:47:21.000000000","message":"Works. Nice","commit_id":"9f5e00aec4ccbbcb52862eeb105ce9a9611de372"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"389fb4421cf65bb2e94bcbad532d80e990efdf48","unresolved":true,"context_lines":[{"line_number":1029,"context_line":"        self.context_mut().lambda.formals \u003d formals;"},{"line_number":1030,"context_line":"    }"},{"line_number":1031,"context_line":""},{"line_number":1032,"context_line":"    fn thunk\u003cN, F\u003e(\u0026mut self, outer_slot: LocalIdx, node: \u0026N, content: F, expr: Option\u003c\u0026ast::Expr\u003e)"},{"line_number":1033,"context_line":"    where"},{"line_number":1034,"context_line":"        N: ToSpan,"},{"line_number":1035,"context_line":"        F: FnOnce(\u0026mut Compiler, LocalIdx),"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"f28add26_53c112d6","line":1032,"updated":"2023-04-28 12:58:59.000000000","message":"I added \"Option\u003c\u0026ast::Expr\u003e\" to fn thunk.\nBecause i wanted doc-comments to work for apply-nodes too.\n@tazjin Do you see any cleaner ways to get access to the ast in general ?","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"868114d157c294e3a22b8789f1b28003bb682529","unresolved":false,"context_lines":[{"line_number":1029,"context_line":"        self.context_mut().lambda.formals \u003d formals;"},{"line_number":1030,"context_line":"    }"},{"line_number":1031,"context_line":""},{"line_number":1032,"context_line":"    fn thunk\u003cN, F\u003e(\u0026mut self, outer_slot: LocalIdx, node: \u0026N, content: F, expr: Option\u003c\u0026ast::Expr\u003e)"},{"line_number":1033,"context_line":"    where"},{"line_number":1034,"context_line":"        N: ToSpan,"},{"line_number":1035,"context_line":"        F: FnOnce(\u0026mut Compiler, LocalIdx),"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"d54762fc_e0aea5c1","line":1032,"in_reply_to":"f28add26_53c112d6","updated":"2023-05-10 09:42:12.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"9fa4ca371d3217eeb0ad9c35f9488334a86dee39","unresolved":true,"context_lines":[{"line_number":1037,"context_line":"        self.compile_lambda_or_thunk(true, outer_slot, node, content, expr)"},{"line_number":1038,"context_line":"    }"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"    /// Doc-comments can appear in two places for functions"},{"line_number":1041,"context_line":"    ///"},{"line_number":1042,"context_line":"    /// ```nix"},{"line_number":1043,"context_line":"    /// # (1)"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"44c38f22_5cce0557","line":1040,"updated":"2023-04-28 14:15:42.000000000","message":"I wonder if these two functions can be moved into another file, and some unit tests be added, that provide an AST (or quickly parse some Nix), to assert the right docstring comes out for a given expr.","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"6332168f90066fd1e27392b3623a83d09917d622","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"        self.compile_lambda_or_thunk(true, outer_slot, node, content, expr)"},{"line_number":1038,"context_line":"    }"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"    /// Doc-comments can appear in two places for functions"},{"line_number":1041,"context_line":"    ///"},{"line_number":1042,"context_line":"    /// ```nix"},{"line_number":1043,"context_line":"    /// # (1)"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"ba66e4e5_e0bb586f","line":1040,"in_reply_to":"44c38f22_5cce0557","updated":"2023-05-10 10:32:14.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"9fa4ca371d3217eeb0ad9c35f9488334a86dee39","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"    /// More precisely before the NODE_ATTRPATH_VALUE"},{"line_number":1057,"context_line":"    ///"},{"line_number":1058,"context_line":"    fn get_lambda_docs(\u0026mut self, lambda: \u0026ast::Expr) -\u003e Option\u003cast::Comment\u003e {"},{"line_number":1059,"context_line":"        match self.get_doc_comment(lambda.syntax()) {"},{"line_number":1060,"context_line":"            // Found in place (2)"},{"line_number":1061,"context_line":"            Some(doc) \u003d\u003e Some(doc),"},{"line_number":1062,"context_line":"            // Look in place (1)"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"09f6607f_86104080","line":1059,"updated":"2023-04-28 14:15:42.000000000","message":"I\u0027d probably write this match a bit more linear, to make it more understandable there\u0027s \"three branches\" here:\n\n```\n// Found in place (2)\nif let Some(doc) \u003d self.get_doc_comment(lambda.syntax()) {\n  Some(doc)\n}\n// Look in place (1)\nelse if let Some(ref node) \u003d lambda.syntax().parent() {\n  match_ast! {\n    match node {\n        ast::AttrpathValue(_) \u003d\u003e self.get_doc_comment(\u0026node),\n        _ \u003d\u003e {\n            // Yet unhandled ast-nodes\n            None\n        }\n    }\n  }\n}\n// There is no parent; No further places where a doc-comment could be.\nelse {\n  None\n}\n```","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"5d6eeebb1b610079c0ff27100e096723e9a9e866","unresolved":false,"context_lines":[{"line_number":1056,"context_line":"    /// More precisely before the NODE_ATTRPATH_VALUE"},{"line_number":1057,"context_line":"    ///"},{"line_number":1058,"context_line":"    fn get_lambda_docs(\u0026mut self, lambda: \u0026ast::Expr) -\u003e Option\u003cast::Comment\u003e {"},{"line_number":1059,"context_line":"        match self.get_doc_comment(lambda.syntax()) {"},{"line_number":1060,"context_line":"            // Found in place (2)"},{"line_number":1061,"context_line":"            Some(doc) \u003d\u003e Some(doc),"},{"line_number":1062,"context_line":"            // Look in place (1)"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"5e1857cc_451c75fc","line":1059,"in_reply_to":"09f6607f_86104080","updated":"2023-05-05 14:47:31.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"9fa4ca371d3217eeb0ad9c35f9488334a86dee39","unresolved":true,"context_lines":[{"line_number":1093,"context_line":"                            prev \u003d token.prev_sibling_or_token();"},{"line_number":1094,"context_line":"                        },"},{"line_number":1095,"context_line":"                        ast::Comment(it) \u003d\u003e {"},{"line_number":1096,"context_line":"                            if let Some(_) \u003d it.doc_text() {"},{"line_number":1097,"context_line":"                                break Some(it);"},{"line_number":1098,"context_line":"                            }else{"},{"line_number":1099,"context_line":"                                break None;"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"63a15b5d_abe6032a","line":1096,"updated":"2023-04-28 14:15:42.000000000","message":"```\nif it.doc_text().is_some() {\n  break Some(it);\n} else {\n  break None\n}\n```\n\nWhy do we peek and then return an Option\u003cast::Comment\u003e here (and further up in `get_lambda_docs`), instead of an `Option\u003c\u0026str\u003e`? That\u0027d avoid having to extract it again in `compile_lambda_or_thunk`. It doesn\u0027t use any of the ast bits there anymore.","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"5d6eeebb1b610079c0ff27100e096723e9a9e866","unresolved":false,"context_lines":[{"line_number":1093,"context_line":"                            prev \u003d token.prev_sibling_or_token();"},{"line_number":1094,"context_line":"                        },"},{"line_number":1095,"context_line":"                        ast::Comment(it) \u003d\u003e {"},{"line_number":1096,"context_line":"                            if let Some(_) \u003d it.doc_text() {"},{"line_number":1097,"context_line":"                                break Some(it);"},{"line_number":1098,"context_line":"                            }else{"},{"line_number":1099,"context_line":"                                break None;"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"dbef42f7_7a998b75","line":1096,"in_reply_to":"63a15b5d_abe6032a","updated":"2023-05-05 14:47:31.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"9fa4ca371d3217eeb0ad9c35f9488334a86dee39","unresolved":true,"context_lines":[{"line_number":1115,"context_line":"        outer_slot: LocalIdx,"},{"line_number":1116,"context_line":"        node: \u0026N,"},{"line_number":1117,"context_line":"        content: F,"},{"line_number":1118,"context_line":"        expr: Option\u003c\u0026ast::Expr\u003e,"},{"line_number":1119,"context_line":"    ) where"},{"line_number":1120,"context_line":"        N: ToSpan,"},{"line_number":1121,"context_line":"        F: FnOnce(\u0026mut Compiler, LocalIdx),"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"ee153551_ed20ccca","line":1118,"updated":"2023-04-28 14:15:42.000000000","message":"Can you extend the docstring of this function, describing in which cases expr is Some(…), and where it\u0027s None? This is not entirely clear to me.","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"6332168f90066fd1e27392b3623a83d09917d622","unresolved":false,"context_lines":[{"line_number":1115,"context_line":"        outer_slot: LocalIdx,"},{"line_number":1116,"context_line":"        node: \u0026N,"},{"line_number":1117,"context_line":"        content: F,"},{"line_number":1118,"context_line":"        expr: Option\u003c\u0026ast::Expr\u003e,"},{"line_number":1119,"context_line":"    ) where"},{"line_number":1120,"context_line":"        N: ToSpan,"},{"line_number":1121,"context_line":"        F: FnOnce(\u0026mut Compiler, LocalIdx),"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"6c30596f_73385498","line":1118,"in_reply_to":"a483a242_cd129087","updated":"2023-05-10 10:32:14.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"6b624b16aad07b3065a67eb7741091da779b57ce","unresolved":true,"context_lines":[{"line_number":1115,"context_line":"        outer_slot: LocalIdx,"},{"line_number":1116,"context_line":"        node: \u0026N,"},{"line_number":1117,"context_line":"        content: F,"},{"line_number":1118,"context_line":"        expr: Option\u003c\u0026ast::Expr\u003e,"},{"line_number":1119,"context_line":"    ) where"},{"line_number":1120,"context_line":"        N: ToSpan,"},{"line_number":1121,"context_line":"        F: FnOnce(\u0026mut Compiler, LocalIdx),"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"a483a242_cd129087","line":1118,"in_reply_to":"ee153551_ed20ccca","updated":"2023-05-05 15:59:41.000000000","message":"It is \"some\" if it was called directly from\ncompile ast::Expr::Lambda\nor from fn thunk() \nwhich currently only works for ast::Expr::Apply (which I wanted to work)\n\nMaybe this can be extented in the future?","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"9fa4ca371d3217eeb0ad9c35f9488334a86dee39","unresolved":true,"context_lines":[{"line_number":1125,"context_line":""},{"line_number":1126,"context_line":"        // set the optional docs"},{"line_number":1127,"context_line":"        // if available in the correct AST-places"},{"line_number":1128,"context_line":"        if let Some(lambda) \u003d expr {"},{"line_number":1129,"context_line":"            match self.get_lambda_docs(lambda) {"},{"line_number":1130,"context_line":"                Some(d) \u003d\u003e {"},{"line_number":1131,"context_line":"                    self.context_mut().lambda.doc \u003d d.doc_text().map(SmolStr::from);"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"5a238626_116e8378","line":1128,"updated":"2023-04-28 14:15:42.000000000","message":"I\u0027d probably just shadow `expr` here, and use an `if let` for the assignment too:\n```\nif let Some(expr) \u003d expr {\n  if let Some(d) \u003d self.get_lambda_docs(expr) {\n    self.context_mut().lambda.doc \u003d d.doc_text().map(SmolStr::from);\n  }\n}\n```\n\nIs `get_lambda_docs` actually really limited to lambda? It seems this is any `ast::Expr` (we just right now decide to only pass one in in `compile_lambda_or_thunk`?)","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"5d6eeebb1b610079c0ff27100e096723e9a9e866","unresolved":false,"context_lines":[{"line_number":1125,"context_line":""},{"line_number":1126,"context_line":"        // set the optional docs"},{"line_number":1127,"context_line":"        // if available in the correct AST-places"},{"line_number":1128,"context_line":"        if let Some(lambda) \u003d expr {"},{"line_number":1129,"context_line":"            match self.get_lambda_docs(lambda) {"},{"line_number":1130,"context_line":"                Some(d) \u003d\u003e {"},{"line_number":1131,"context_line":"                    self.context_mut().lambda.doc \u003d d.doc_text().map(SmolStr::from);"}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"250524ed_4c1d1e0d","line":1128,"in_reply_to":"5a238626_116e8378","updated":"2023-05-05 14:47:31.000000000","message":"Done","commit_id":"5160978422eeb07f6d18271d4bfc53d697afdddc"}],"tvix/eval/src/tests/doc_comments/eval/apply_conflict.nix":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"8aa1b2d5df55c69bb1980d6549dc86e55a54cae6","unresolved":true,"context_lines":[{"line_number":2,"context_line":"  add \u003d "},{"line_number":3,"context_line":"    x:"},{"line_number":4,"context_line":"      /**should not see this*/ "},{"line_number":5,"context_line":"    y: "},{"line_number":6,"context_line":"      x+y;"},{"line_number":7,"context_line":"  /**Adds one*/"},{"line_number":8,"context_line":"  addOne \u003d add 1;"}],"source_content_type":"text/x-nix","patch_set":17,"id":"c36d41ed_1aad10d6","line":5,"updated":"2023-05-29 14:14:36.000000000","message":"stray whitespace (3 times in this file)","commit_id":"3314843293414de0436e597e9f6fd010e8829364"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"b7aeb96eac2c251e8cdad5ac9294ff79781438e2","unresolved":false,"context_lines":[{"line_number":2,"context_line":"  add \u003d "},{"line_number":3,"context_line":"    x:"},{"line_number":4,"context_line":"      /**should not see this*/ "},{"line_number":5,"context_line":"    y: "},{"line_number":6,"context_line":"      x+y;"},{"line_number":7,"context_line":"  /**Adds one*/"},{"line_number":8,"context_line":"  addOne \u003d add 1;"}],"source_content_type":"text/x-nix","patch_set":17,"id":"0da395f2_e662244c","line":5,"in_reply_to":"c36d41ed_1aad10d6","updated":"2023-07-05 09:31:45.000000000","message":"Ack","commit_id":"3314843293414de0436e597e9f6fd010e8829364"}],"tvix/eval/src/tests/doc_comments/eval/dynamic_name_static_get.nix":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"8aa1b2d5df55c69bb1980d6549dc86e55a54cae6","unresolved":true,"context_lines":[{"line_number":1,"context_line":"let "},{"line_number":2,"context_line":"  name \u003d builtins.typeOf [];"},{"line_number":3,"context_line":"  set \u003d {"},{"line_number":4,"context_line":"    /**A Function that returns the id*/"}],"source_content_type":"text/x-nix","patch_set":17,"id":"d13343f5_146f02e0","line":1,"updated":"2023-05-29 14:14:36.000000000","message":"stray whitespace","commit_id":"3314843293414de0436e597e9f6fd010e8829364"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"b7aeb96eac2c251e8cdad5ac9294ff79781438e2","unresolved":false,"context_lines":[{"line_number":1,"context_line":"let "},{"line_number":2,"context_line":"  name \u003d builtins.typeOf [];"},{"line_number":3,"context_line":"  set \u003d {"},{"line_number":4,"context_line":"    /**A Function that returns the id*/"}],"source_content_type":"text/x-nix","patch_set":17,"id":"13d89ad2_4a8a6416","line":1,"in_reply_to":"d13343f5_146f02e0","updated":"2023-07-05 09:31:45.000000000","message":"Ack","commit_id":"3314843293414de0436e597e9f6fd010e8829364"}],"tvix/eval/src/tests/doc_comments/none/interrupt.nix":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"60e59a8cd565ae87c32da0464190cba096f74b49","unresolved":true,"context_lines":[{"line_number":1,"context_line":"let "},{"line_number":2,"context_line":"  /**Doc*/"},{"line_number":3,"context_line":"  # comment"},{"line_number":4,"context_line":"  f \u003d x: x;"}],"source_content_type":"text/x-nix","patch_set":11,"id":"87df8fe9_441f34e0","line":1,"updated":"2023-05-10 10:22:02.000000000","message":"stray whitespace","commit_id":"d32f7160d4acee9f18f015b4428fb5a9698bd6f2"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"be02e7dcc6bc4260139942952b4f0c4db00686eb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"let "},{"line_number":2,"context_line":"  /**Doc*/"},{"line_number":3,"context_line":"  # comment"},{"line_number":4,"context_line":"  f \u003d x: x;"}],"source_content_type":"text/x-nix","patch_set":11,"id":"d6422e67_4824b093","line":1,"in_reply_to":"87df8fe9_441f34e0","updated":"2023-05-10 10:31:50.000000000","message":"Ack","commit_id":"d32f7160d4acee9f18f015b4428fb5a9698bd6f2"}],"tvix/eval/src/tests/test_comment_ast.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"45cc18c4ed8cc3bb123cf95acbd32f98d47ed28f","unresolved":true,"context_lines":[{"line_number":14,"context_line":"where"},{"line_number":15,"context_line":"    F: Fn(String) -\u003e String,"},{"line_number":16,"context_line":"{"},{"line_number":17,"context_line":"    let base_path: PathBuf \u003d [env!(\"CARGO_MANIFEST_DIR\"), \"src/tests/doc_comments\"]"},{"line_number":18,"context_line":"        .iter()"},{"line_number":19,"context_line":"        .collect();"},{"line_number":20,"context_line":"    let ok_path \u003d base_path.join(\"ok\");"}],"source_content_type":"text/x-rustsrc","patch_set":11,"id":"19d045df_8b2563b3","line":17,"updated":"2023-05-10 10:29:37.000000000","message":"Please refactor this to use the `test_resources` macro, and some globs similar to how it\u0027s done in `eval/src/tests/mod.rs` for consistency.","commit_id":"d32f7160d4acee9f18f015b4428fb5a9698bd6f2"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"be02e7dcc6bc4260139942952b4f0c4db00686eb","unresolved":false,"context_lines":[{"line_number":14,"context_line":"where"},{"line_number":15,"context_line":"    F: Fn(String) -\u003e String,"},{"line_number":16,"context_line":"{"},{"line_number":17,"context_line":"    let base_path: PathBuf \u003d [env!(\"CARGO_MANIFEST_DIR\"), \"src/tests/doc_comments\"]"},{"line_number":18,"context_line":"        .iter()"},{"line_number":19,"context_line":"        .collect();"},{"line_number":20,"context_line":"    let ok_path \u003d base_path.join(\"ok\");"}],"source_content_type":"text/x-rustsrc","patch_set":11,"id":"3139eb90_bd576a17","line":17,"in_reply_to":"19d045df_8b2563b3","updated":"2023-05-10 10:31:50.000000000","message":"Ack","commit_id":"d32f7160d4acee9f18f015b4428fb5a9698bd6f2"}],"tvix/eval/src/value/function.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"0c31d21f577dcd679648988ad0a2cfb518cb1a6e","unresolved":true,"context_lines":[{"line_number":55,"context_line":"    /// set entry) it is located in)."},{"line_number":56,"context_line":"    pub(crate) name: Option\u003cSmolStr\u003e,"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    pub(crate) doc: Option\u003cSmolStr\u003e,"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    /// Number of upvalues which the code in this Lambda closes"},{"line_number":61,"context_line":"    /// over, and which need to be initialised at"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"a915c616_30f51c60","line":58,"updated":"2023-04-28 12:00:24.000000000","message":"I\u0027m not sure SmolStr is the right choice - it\u0027s meant to store *tokens* in programming languages, not comments (which are probably longer) - so most of them will be heap-allocated anyways - but that\u0027s probably a question for @tazjin.","commit_id":"9f5e00aec4ccbbcb52862eeb105ce9a9611de372"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"5d6eeebb1b610079c0ff27100e096723e9a9e866","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    /// set entry) it is located in)."},{"line_number":56,"context_line":"    pub(crate) name: Option\u003cSmolStr\u003e,"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    pub(crate) doc: Option\u003cSmolStr\u003e,"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    /// Number of upvalues which the code in this Lambda closes"},{"line_number":61,"context_line":"    /// over, and which need to be initialised at"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"71221037_5cc9de4e","line":58,"in_reply_to":"a915c616_30f51c60","updated":"2023-05-05 14:47:31.000000000","message":"It\u0027s probably the wrong type. Changed it to just \"String\"","commit_id":"9f5e00aec4ccbbcb52862eeb105ce9a9611de372"}],"tvix/eval/src/vm/generators.rs":[{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"6e08d74e5895123d7b2e46bbcd51a62a69098bab","unresolved":true,"context_lines":[{"line_number":676,"context_line":"                        - Use Rc::get_mut_unchecked -\u003e Requires unsafe + nightly.#"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"                        This is ugly"},{"line_number":679,"context_line":"                        TODO: @hsjobeki, @tazjin: how can we fix this?"},{"line_number":680,"context_line":"                        */"},{"line_number":681,"context_line":"                        unsafe {"},{"line_number":682,"context_line":"                            let lambda \u003d Rc::as_ptr(\u0026v.lambda).cast_mut();"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"7c4218da_aeae531f","line":679,"range":{"start_line":679,"start_character":0,"end_line":679,"end_character":70},"updated":"2023-05-10 05:57:03.000000000","message":"Just make a new Lambda here instead of this and return that","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"},{"author":{"_account_id":1000074,"name":"Johannes Kirschbauer","email":"hsjobeki@gmail.com","username":"hsjobeki"},"change_message_id":"868114d157c294e3a22b8789f1b28003bb682529","unresolved":false,"context_lines":[{"line_number":676,"context_line":"                        - Use Rc::get_mut_unchecked -\u003e Requires unsafe + nightly.#"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"                        This is ugly"},{"line_number":679,"context_line":"                        TODO: @hsjobeki, @tazjin: how can we fix this?"},{"line_number":680,"context_line":"                        */"},{"line_number":681,"context_line":"                        unsafe {"},{"line_number":682,"context_line":"                            let lambda \u003d Rc::as_ptr(\u0026v.lambda).cast_mut();"}],"source_content_type":"text/x-rustsrc","patch_set":9,"id":"f9e230b8_75eea65d","line":679,"range":{"start_line":679,"start_character":0,"end_line":679,"end_character":70},"in_reply_to":"7c4218da_aeae531f","updated":"2023-05-10 09:42:12.000000000","message":"Done","commit_id":"d20fb92b78b859883eb90832e1395ab7f329a554"}]}
