Skip to content

Commit

Permalink
Add a multi line tag snippet.
Browse files Browse the repository at this point in the history
This takes priority over a single line tag.
  • Loading branch information
drgrice1 committed Nov 15, 2024
1 parent 1e3095a commit e02ae49
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/pgml-language-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,22 @@ const imageSnippet = snippetCompletion('[!${alt text}!]{${$source}}${}', {
boost: i--
});

const tagSnippet = snippetCompletion('[<${ }>]${}', {
label: '[< >]',
info: 'html tag',
type: 'type',
section: { name: 'substitution', rank: ++rank },
boost: i--
});
const tagSnippets = [
snippetCompletion('[<\n\t${ }\n>]${}', {
label: '[< >]',
info: 'html tag (multi line)',
type: 'type',
section: { name: 'substitution', rank: ++rank },
boost: i--
}),
snippetCompletion('[<${ }>]${}', {
label: '[< >]',
info: 'html tag (single line)',
type: 'type',
section: { name: 'substitution', rank },
boost: i--
})
];

const commentSnippet = snippetCompletion('[% ${ } %]${}', {
label: '[% %]',
Expand Down Expand Up @@ -324,7 +333,7 @@ export const pgmlLanguageData = {
...variableSnippets,
...perlCommandSnippets,
imageSnippet,
tagSnippet,
...tagSnippets,
commentSnippet,
...tableSnippets,
...verbatimSnippets
Expand All @@ -350,7 +359,7 @@ export const pgmlLanguageData = {
...variableSnippets,
...perlCommandSnippets,
imageSnippet,
tagSnippet,
...tagSnippets,
commentSnippet,
...tableSnippets,
...verbatimSnippets,
Expand Down

0 comments on commit e02ae49

Please sign in to comment.