-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch Outline not working with ts 5.5.3 #216
Comments
No, I just checked that it works with TS 5.5.4. Can you send a sample file where it doesn't work? |
Here's a short example file. It looks like this for all tsx files. The jsx elements are not shown but the properties of all their props show up. This is on ts 5.5.4. import { faChevronDown } from "@fortawesome/pro-regular-svg-icons/faChevronDown"
import { faChevronRight } from "@fortawesome/pro-regular-svg-icons/faChevronRight"
import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome"
import { format } from "date-fns"
import { observer } from "mobx-react"
import React, { useState } from "react"
import { Text, TouchableOpacity } from "react-native"
import type { LOG_LEVEL_TYPE, LocalLogEntryType } from "taskhero-shared/utils/logger"
import { LocalLogData } from "taskhero-shared/utils/logger"
import { Column, RowCentered } from "../components/primitives/LayoutPrimitives"
import { useTheme } from "../theme/theme"
const logTextStyle = { textAlignVertical: "center" } as const
const logMetaStyle = { fontSize: 10, color: "#666", marginRight: 6 }
const logBgColor = (l: LOG_LEVEL_TYPE) => (l === "warn" ? "#DFFF8D" : l === "error" ? "#FF739B" : "white")
const iconSlop = 30
function LogLineView({ item: logEntry }: { item: LocalLogEntryType }) {
const t = useTheme()
const [unfold, setUnfold] = useState(false)
return (
<Column
style={[
{
padding: 4,
flex: 1,
position: "relative",
borderTopColor: "#ccc",
borderTopWidth: 1,
backgroundColor: logBgColor(logEntry.metadata.level)
}
]}
>
<TouchableOpacity
style={{ display: "flex", flexDirection: "row", alignItems: "center" }}
onPress={() => setUnfold(!unfold)}
>
<FontAwesomeIcon
icon={unfold ? faChevronDown : faChevronRight}
style={{ color: "#666", width: 17, height: 30 }}
/>
<Column>
<RowCentered>
<Text selectable={true} style={[logMetaStyle, logTextStyle]}>
{format(logEntry.time, "HH:mm:ss.SSS")}
</Text>
<Text selectable={true} style={[logMetaStyle, logTextStyle]}>
{" "}
{logEntry.metadata.name}
</Text>
<Text selectable={true} style={[logMetaStyle, logTextStyle]}>
{" "}
{logEntry.metadata.level}
</Text>
</RowCentered>
<Text
textBreakStrategy={"highQuality"}
selectable={true}
style={[{ fontSize: 12, textAlignVertical: "top", flexWrap: "wrap" }, logTextStyle]}
>
{logEntry.message}
</Text>
</Column>
</TouchableOpacity>
{unfold ? (
<Text selectable={true} style={[{ alignSelf: "center" }, logMetaStyle, logTextStyle]}>
{JSON.stringify(logEntry, null, 2)}
</Text>
) : null}
</Column>
)
}
const LogsView = observer(function LogsView() {
// return <FlatList data={LocalLogData} renderItem={LogLineView} keyExtractor={(i) => `${i.time}`} />
return (
<>
{LocalLogData.map(l => (
<LogLineView key={l.id} item={l} />
))}
</>
)
})
export default LogsView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per the title, I just installed this plugin and enabled "patch outline" yet no jsx elements show up in the outline for my react native tsx files. On typescript 5.5.3. Could this be affected by
"jsx": "react-native",
in my tsconfig?The text was updated successfully, but these errors were encountered: