Skip to content

Commit

Permalink
Merge pull request #58 from mghdotdev/release/version-1-3-0
Browse files Browse the repository at this point in the history
Release/version 1 3 0
  • Loading branch information
mghdotdev authored Dec 13, 2023
2 parents f9e5019 + 7cfa0ad commit 53cedb0
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

# v1.3.0

* Fixed expression syntax highlighting in Miva Script as per [issue #47](https://github.com/mghdotdev/vscode-miva-ide/issues/47).
* Fixed MvDO VALUE attribute snippet. It should default to be an expression.
* Removed mvt:else tag from mvt:if snippet.
* Added workaround to trigger completion window on paste command.
* Dedent on completion of else/elseif tags for Miva Script and MVT.

# v1.2.0

* Applied fixes to Miva Script snippets based off developer feedback
Expand Down
10 changes: 9 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ This is the existing development flow. When new LSK or Empressa versions are rel

### v1.3.0

- [ ] Fix expression syntax highlighting as per [issue #47](https://github.com/mghdotdev/vscode-miva-ide/issues/47)
- [x] Fix expression syntax highlighting as per [issue #47](https://github.com/mghdotdev/vscode-miva-ide/issues/47)
- [x] Fix MvDO VALUE attribute snippet. It should default to be an expression.
- [x] Remove mvt:else tag from mvt:if snippet.
- [x] Research if completion window can be triggered automatically on paste.
- [x] Dedent on completion of else/elseif tags

### v1.4.0

TBD

### v2.0.0 (TBD)

Expand Down
11 changes: 10 additions & 1 deletion client/src/miva-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,21 @@ const calculatePosNumberCommand = commands.registerTextEditorCommand( 'mivaIde.M

});

const clipboardPasteCommand = commands.registerTextEditorCommand('mivaIde.clipboardPasteAction', () => {
// Execute original command
commands.executeCommand('editor.action.clipboardPasteAction').then(() => {
// Trigger suggestion popover
commands.executeCommand('editor.action.triggerSuggest');
});
});

export default [
chooseFileNameCommand,
insertFileNameCommand,
convertAndCopyCommand,
convertToEntityCommand,
convertToVariableCommand,
insertHtmlComment,
calculatePosNumberCommand
calculatePosNumberCommand,
clipboardPasteCommand
];
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-miva-ide",
"displayName": "Miva IDE",
"description": "Syntax highlighting, snippets and tools for building websites with Miva.",
"version": "1.2.0",
"version": "1.3.0",
"engines": {
"vscode": "^1.77.0"
},
Expand Down Expand Up @@ -172,6 +172,11 @@
"command": "mivaIde.toggleHtmlComment",
"key": "cmd+alt+/",
"when": "textInputFocus"
},
{
"command": "mivaIde.clipboardPasteAction",
"key": "cmd+v",
"when": "editorLangId == mv || editorLangId == mvt || editorLangId == mvtcss || editorLangId == mvtjs"
}
],
"languages": [
Expand Down
17 changes: 16 additions & 1 deletion server/src/mv/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Returns program flow to the top of the loop, performing the operations would normally occur at the bottom of the loop i.e. reading the next line.\n\nThis examples calls a URL stripping out any tags by using <MvCALLCONTINUE> to ignore tag objects.",
"engine": ">=5.10",
"insertText": "<MvCALLCONTINUE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -952,6 +953,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Returns program flow to the top of the loop, performing the operations would normally occur at the bottom of the loop i.e. reading the next line.\n\nThis example skips any un-important / unused responses from the commerce library using  <MvCOMMERCECONTINUE>.",
"engine": ">=5.10",
"insertText": "<MvCOMMERCECONTINUE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -1127,6 +1129,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Used to issue commands to a database that has already been opened or created via the MvOPEN or MvCREATE tags. All database interfaces take these commands.\n\nThe database must already be open or created via the <MvOPEN> or <MvCREATE> tags.",
"engine": ">=5.00",
"insertText": "<MvDBCOMMAND COMMAND = \"{ $1 }\">$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -1250,7 +1253,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Used to call an function declared with in an external file or call an external file directly executing the script starting at the beginning.\n\n<MvDO> works in two somewhat different ways, depending on whether NAME and VALUE are present. If they are specified, \nthe function is the only code in the external file that gets executed. ALL other Miva Script and HTML code is ignored. \nThis allows you to create librarys of functions stored in external compiled files.\n\nIf NAME and VALUE are omitted, everything in the external file is executed, however any script contained within \nMvFUNCTION blocks are ignored. Starting at the beginning of the file, the results of all <MvASSIGN> tags are available \nto the calling program. All system and global variables, and all open databases, are available to the code in the \nexternal file. For example a file could contain initialization script, setting global variables and opening databases.",
"insertText": "<MvDO FILE = \"{ }\" NAME = \"$2\" VALUE = \"$1\">$0",
"insertText": "<MvDO FILE = \"{ }\" NAME = \"$2\" VALUE = \"{ $1 }\">$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
"label": "MvDO",
Expand All @@ -1264,6 +1267,10 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Used in an statement to provide an alternate execution branch when the condition return false.\n\nIn this example the code executed branches based on the system clocks current hour of the day, where LT means Less\nThan. See Operators",
"command": {
"title": "Outdent tag on completion.",
"command": "outdent"
},
"insertText": "<MvELSE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -1292,6 +1299,10 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Used in an statement to provide an alternate execution branch when the initial condition return false. Used in place of nested tags.\n\nUsing <MvELSEIF>, multiple conditions can be used to determine which of several block s of code to execute.",
"command": {
"title": "Outdent tag on completion.",
"command": "outdent"
},
"insertText": "<MvELSEIF EXPR = \"{ $1 }\">$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -2175,6 +2186,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Returns program flow to the top of the loop, performing the operations would normally occur at the bottom of the loop i.e. reading the next record.\n\nThis examples imports movies from a text file and appends the data to an array. The <MvIMPORCONTINUE> tag is \nused to skip importing movies made before the year 2000.",
"engine": ">=5.10",
"insertText": "<MvIMPORTCONTINUE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -2876,6 +2888,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Returns program flow to the top of the loop, performing the operations would normally occur at the bottom of the loop i.e. reading the next email.\n\nThis examples loops through and displays email messages . The <MvPOPCONTINUE> tag is used to skip \ndisplaying messages if they return true from a user defined function called SpamFilter().",
"engine": ">=5.10",
"insertText": "<MvPOPCONTINUE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -3066,6 +3079,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Creates a reference from one variable to another, such that changes to one will appear to be made to the other. It can be also used to refer to a variable named created with an expression, like the miva_variable_value() function.\n\nNOTE: * INDEX and MEMBER refer to the variable in the NAME parameter, NOT the VARIABLE parameter.",
"engine": ">=5.00",
"insertText": "<MvREFERENCE NAME = \"{ $1 }\" VARIABLE = \"{ $2 }\">$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down Expand Up @@ -3556,6 +3570,7 @@ export const tags: Record<string, TagData> = {
"/"
],
"documentation": "Returns program flow to the top of the loop, performing the operations would normally occur at the bottom of the loop i.e. testing the expression.\n\nThis examples parses a comma separated list. The <MvWHILECONTINUE> tag is used to skip \nitems in the list that start with the letters N through Z",
"engine": ">=5.10",
"insertText": "<MvWHILECONTINUE>$0",
"insertTextFormat": "Snippet",
"kind": "TypeParameter",
Expand Down
12 changes: 10 additions & 2 deletions server/src/mvt/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,11 @@ These global variables reference a specific module file. The Limited Source Kit
label: 'mvt:else',
reference: 'https://docs.miva.com/template-language/if-else',
selfClosing: true,
void: true
void: true,
command: {
title: 'Outdent tag on completion.',
command: 'outdent'
}
},
elseif: {
...baseTag,
Expand All @@ -489,6 +493,10 @@ These global variables reference a specific module file. The Limited Source Kit
void: true,
attributes: {
expr
},
command: {
title: 'Outdent tag on completion.',
command: 'outdent'
}
},
eval: {
Expand Down Expand Up @@ -560,7 +568,7 @@ These global variables reference a specific module file. The Limited Source Kit
if: {
...baseTag,
documentation: ``,
insertText: "<mvt:if expr=\"${1}\">\n\t${2:$3\n<mvt:else>\n\t}${0}\n</mvt:if>",
insertText: "<mvt:if expr=\"$1\">\n\t$2\n</mvt:if>$0",
label: 'mvt:if',
reference: 'https://docs.miva.com/template-language/if-statement',
selfClosing: false,
Expand Down
2 changes: 2 additions & 0 deletions server/src/util/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import {
CodeAction,
CodeActionContext,
Command,
CompletionItemKind,
CompletionList,
Definition,
Expand Down Expand Up @@ -155,6 +156,7 @@ export interface TagData extends BaseTagData {
attributes?: Record<string, TagAttributeData>;
selfClosing: boolean;
void: boolean;
command?: Command
}

export interface TagSnippet extends BaseTagData {
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/MV/mv.injection.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Miva Script (Injection)",
"scopeName": "source.mv.injection",
"injectionSelector": "L:text.html.mv -comment.block.mv",
"injectionSelector": "L:text.html.mv -comment.block.mv -source.mv",
"patterns": [
{
"include": "#comments"
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/MV/mv.injection.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
name: Miva Script (Injection)
scopeName: source.mv.injection
injectionSelector: 'L:text.html.mv -comment.block.mv'
injectionSelector: 'L:text.html.mv -comment.block.mv -source.mv'

patterns:
- include: '#comments'
Expand Down

0 comments on commit 53cedb0

Please sign in to comment.