Skip to content

Commit

Permalink
fix: Update filter text for wiki cross-doc heading completion
Browse files Browse the repository at this point in the history
The filter text is used by the editor to do client-side filtering of completion results. This is annoying but unfortunately we it can't be disabled, so we need to provide a specially constructed filter text.

Reviewers: 

Pull Request: #360
  • Loading branch information
artempyanykh authored Nov 19, 2024
1 parent 6d244df commit c63798d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Marksman/Compl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ module Completions =

let filterText =
WikiLink.render
(targetLink |> WikiDest.encode |> Some)
(destPart.data |> Some)
(heading |> WikiEncoded.mkUnchecked |> Some)
(Completable.isPartial compl)

Expand Down
20 changes: 10 additions & 10 deletions Tests/_snapshots/Candidates.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"docAndHeadingFuzzy": {
"AutoGenerated": [
"(1,2)-(1,5): doc-2#H2.1 / doc-2#H2.1",
"(1,2)-(1,5): doc-2#H2.2 / doc-2#H2.2",
"(1,2)-(1,5): doc-3#H3 / doc-3#H3"
"(1,2)-(1,5): doc-2#H2.1 / do#H2.1",
"(1,2)-(1,5): doc-2#H2.2 / do#H2.2",
"(1,2)-(1,5): doc-3#H3 / do#H3"
]
},
"referenceEmptyBrackets": {
Expand Down Expand Up @@ -53,8 +53,8 @@
},
"partialWikiDocHeading": {
"AutoGenerated": [
"(1,0)-(2,0): [[doc-2#H2]] / [[doc-2#H2]]",
"(1,0)-(2,0): [[doc-3#H3]] / [[doc-3#H3]]"
"(1,0)-(2,0): [[doc-2#H2]] / [[d#H2]]",
"(1,0)-(2,0): [[doc-3#H3]] / [[d#H3]]"
]
},
"partialReferenceEmpty": {
Expand Down Expand Up @@ -83,14 +83,14 @@
},
"partialWikiDocHeading_FilePathStem": {
"AutoGenerated": [
"(1,0)-(2,0): [[sub2/doc2#H2]] / [[sub2/doc2#H2]]",
"(1,0)-(2,0): [[sub3/this is doc 3#H3]] / [[sub3/this is doc 3#H3]]"
"(1,0)-(2,0): [[sub2/doc2#H2]] / [[d#H2]]",
"(1,0)-(2,0): [[sub3/this is doc 3#H3]] / [[d#H3]]"
]
},
"partialWikiDocHeading_FileStem": {
"AutoGenerated": [
"(1,0)-(2,0): [[doc2#H2]] / [[doc2#H2]]",
"(1,0)-(2,0): [[this is doc 3#H3]] / [[this is doc 3#H3]]"
"(1,0)-(2,0): [[doc2#H2]] / [[d#H2]]",
"(1,0)-(2,0): [[this is doc 3#H3]] / [[d#H3]]"
]
},
"partialWikiDoc_FileStem_ArbitraryPath": {
Expand All @@ -116,7 +116,7 @@
},
"wiki_CrossHeading_TitleNameVsSlug": {
"AutoGenerated": [
"(0,2)-(0,12): doc-title#Subtitle / doc-title#Subtitle"
"(0,2)-(0,12): doc-title#Subtitle / Doc Title#Subtitle"
]
}
}

0 comments on commit c63798d

Please sign in to comment.