| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Is grey currently only used for stack trace lines that point to node internals? If so, perhaps we should use a different color for cwd to avoid confusion? |
Sorry, something went wrong.
Yes, currently only node internal stack frames are grey. It was meant as "this is probably not important" (no matter what it represented), focus on the rest.
Do you have a concrete suggestion? I fear using colors would actually highlight the cwd instead of moving it to the background. |
Sorry, something went wrong.
There was a problem hiding this comment.
I am wondering if it would be better to use the directory containing the first package.json instead. The cwd is not necessarily where the code is (even though it probably is most of the time).
Sorry, something went wrong.
This would require util.inspect() to read files in directories sync and that is something I would rather not do. If code is run somewhere that has nothing to do with the cwd, the whole path is still visible. If it is the cwd, it's probably fine to just move it to the background as it's something "already known", no matter if the code is run there or not (some code has to be run there, otherwise it's not going to be marked grey). |
Sorry, something went wrong.
I totally get that, and I don't object to using the working directory. I just thought we are probably reading the package.json anyway at some point (e.g., to check if it's a "type": "module") so we might as well use that directory. |
Sorry, something went wrong.
|
@tniessen I just tried to figure out how to implement something like that and could not think of a good way to do so. We do not always have a package.json or have multiple ones in different sub directories, in what case I would only want to grey out the main part, not the sub directory for the executed code. Could you give me a hint how you would implement something like that and how it would behave for the mentioned situations? That would help :-) |
Sorry, something went wrong.
|
@BridgeAR That does make it difficult, you are right. I am not too worried about using cwd, we can probably change the exact conditions later without breaking anything (if we ever want to). We could, maybe, determine a prefix of all loaded JS modules, but that seems out of scope here, and I am not even sure if that would be reliable. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@tniessen I agree, we can definitely improve the implementation later. Are you fine with the change as is in general? |
Sorry, something went wrong.
Sorry, something went wrong.
It seems reasonable to me. The only super tiny nit I have is that, personally, I believe that the first / should be gray as well (e.g., highlight test.js instead of /test.js) because the highlighted part of the path should be relative to cwd, not an absolute path. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This changes the util.inspect() output for errors in case stack traces contain the current working directory in their trace. If that's the case, the cwd part is marked grey to focus on the rest of the path. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: nodejs/node#41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: nodejs/node#41082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
| Back | FazBrowse Home | New Git URL |
This changes the util.inspect() output for errors in case stack
traces contain the current working directory in their trace.
If that's the case, the cwd part is marked grey to focus on the
rest of the path.
Old:

New:

Signed-off-by: Ruben Bridgewater ruben@bridgewater.de