Skip to content

Commit

Permalink
Remove duplicated bigl and biggl and friends, simpler suggestion …
Browse files Browse the repository at this point in the history
…sorting
  • Loading branch information
James-Yu committed Sep 13, 2024
1 parent 2de71a4 commit 2fdbf5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 104 deletions.
96 changes: 0 additions & 96 deletions data/macros.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,102 +42,6 @@
},
"detail": "\\left\\{ ... \\right\\}, shortcut @{"
},
{
"name": "bigl",
"arg": {
"format": "(",
"snippet": "bigl(${1}\\bigr)"
},
"detail": "\\bigl( ... \\bigr)"
},
{
"name": "bigl",
"arg": {
"format": "[",
"snippet": "bigl[${1}\\bigr]"
},
"detail": "\\bigl[ ... \\bigr]"
},
{
"name": "bigl",
"arg": {
"format": "{",
"snippet": "bigl\\{${1}\\bigr\\\\}"
},
"detail": "\\bigl\\{ ... \\bigr\\}"
},
{
"name": "Bigl",
"arg": {
"format": "(",
"snippet": "Bigl(${1}\\Bigr)"
},
"detail": "\\Bigl( ... \\Bigr)"
},
{
"name": "Bigl",
"arg": {
"format": "[",
"snippet": "Bigl[${1}\\Bigr]"
},
"detail": "\\Bigl[ ... \\Bigr]"
},
{
"name": "Bigl",
"arg": {
"format": "{",
"snippet": "Bigl\\{${1}\\Bigr\\\\}"
},
"detail": "\\Bigl\\{ ... \\Bigr\\}"
},
{
"name": "biggl",
"arg": {
"format": "(",
"snippet": "biggl(${1}\\biggr)"
},
"detail": "\\biggl( ... \\biggr)"
},
{
"name": "biggl",
"arg": {
"format": "[",
"snippet": "biggl[${1}\\biggr]"
},
"detail": "\\biggl[ ... \\biggr]"
},
{
"name": "biggl",
"arg": {
"format": "{",
"snippet": "biggl\\{${1}\\biggr\\\\}"
},
"detail": "\\biggl\\{ ... \\biggr\\}"
},
{
"name": "Biggl",
"arg": {
"format": "(",
"snippet": "Biggl${1}\\Biggr)"
},
"detail": "\\Biggl( ... \\Biggr)"
},
{
"name": "Biggl",
"arg": {
"format": "[",
"snippet": "Biggl[${1}\\Biggr]"
},
"detail": "\\Biggl[ ... \\Biggr]"
},
{
"name": "Biggl",
"arg": {
"format": "{",
"snippet": "Biggl\\{${1}\\Biggr\\\\}"
},
"detail": "\\Biggl\\{ ... \\Biggr\\}"
},
{
"name": "frame",
"arg": {
Expand Down
5 changes: 1 addition & 4 deletions src/completion/completer/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,7 @@ function entryEnvToCompletion(item: EnvironmentInfo, type: EnvSnippetType): CmdE
if (item.package) {
suggestion.documentation += ` From package: ${item.package}.`
}
suggestion.sortText = label.replace(/^[a-zA-Z]/, c => {
const n = c.match(/[a-z]/) ? c.toUpperCase().charCodeAt(0): c.toLowerCase().charCodeAt(0)
return n !== undefined ? n.toString(16): c
})
suggestion.sortText = label.replace(/([A-Z])/g, '$10').toLowerCase()

if (type === EnvSnippetType.AsName) {
return suggestion
Expand Down
6 changes: 2 additions & 4 deletions src/completion/completer/macro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,8 @@ function entryCmdToCompletion(item: MacroRaw, packageName?: string, postAction?:
if (packageName) {
suggestion.documentation += ` From package: ${packageName}.`
}
suggestion.sortText = (item.name + (item.arg?.format ?? '')).replace(/^[a-zA-Z]/, c => {
const n = c.match(/[a-z]/) ? c.toUpperCase().charCodeAt(0): c.toLowerCase().charCodeAt(0)
return n !== undefined ? n.toString(16): c
})
suggestion.sortText = (item.name + (item.arg?.format ?? ''))
.replace(/([A-Z])/g, '$10').toLowerCase()
if (postAction) {
suggestion.command = { title: 'Post-Action', command: postAction }
} else if (isTriggerSuggestNeeded(item.name)) {
Expand Down

0 comments on commit 2fdbf5f

Please sign in to comment.