Skip to content

Commit

Permalink
Load StyledStrings in REPL
Browse files Browse the repository at this point in the history
By loading the StyledStrings stdlib in REPL, we load the privateered
print/show methods for the Annotated{String,Char} types defined there.

This is nice to have, because it means that styled annotated strings can
be constructed in Base and elsewhere without loading the StyledStrings
stdlib, but they will be displayed as intended in the REPL.
  • Loading branch information
tecosaur committed Nov 1, 2023
1 parent 621e646 commit 887c3ee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
deps = ["InteractiveUtils", "Markdown", "Sockets", "StyledStrings", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.Random]]
Expand All @@ -111,6 +111,9 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[deps.Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[deps.StyledStrings]]
uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 1 addition & 1 deletion pkgimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $(eval $(call stdlib_builder,InteractiveUtils,Markdown))
# 3-depth packages
$(eval $(call stdlib_builder,LibGit2_jll,MbedTLS_jll LibSSH2_jll Artifacts Libdl))
$(eval $(call stdlib_builder,LibCURL_jll,LibSSH2_jll nghttp2_jll MbedTLS_jll Zlib_jll Artifacts Libdl))
$(eval $(call stdlib_builder,REPL,InteractiveUtils Markdown Sockets Unicode))
$(eval $(call stdlib_builder,REPL,InteractiveUtils Markdown Sockets StyledStrings Unicode))
$(eval $(call stdlib_builder,SharedArrays,Distributed Mmap Random Serialization))
$(eval $(call stdlib_builder,TOML,Dates))
$(eval $(call stdlib_builder,Test,Logging Random Serialization InteractiveUtils))
Expand Down
1 change: 1 addition & 0 deletions stdlib/REPL/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "1.11.0"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end
Base.Experimental.@optlevel 1
Base.Experimental.@max_methods 1

using Base.Meta, Sockets
using Base.Meta, Sockets, StyledStrings
import InteractiveUtils

export
Expand Down
1 change: 1 addition & 0 deletions stdlib/REPL/src/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ end
using Base.Meta

import Markdown
import StyledStrings

## Debugging options
# Disable parallel precompiles generation by setting `false`
Expand Down

0 comments on commit 887c3ee

Please sign in to comment.