diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf3b3a..c01a1fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ROADMAP.md b/ROADMAP.md index 0385c30..9c717ae 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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) diff --git a/client/src/miva-commands.ts b/client/src/miva-commands.ts index 0124cab..79ca99b 100644 --- a/client/src/miva-commands.ts +++ b/client/src/miva-commands.ts @@ -323,6 +323,14 @@ 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, @@ -330,5 +338,6 @@ export default [ convertToEntityCommand, convertToVariableCommand, insertHtmlComment, - calculatePosNumberCommand + calculatePosNumberCommand, + clipboardPasteCommand ]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 01423e6..7ad4bb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-miva-ide", - "version": "1.2.0", + "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-miva-ide", - "version": "1.2.0", + "version": "1.3.0", "workspaces": [ "client", "server" diff --git a/package.json b/package.json index 9b70cdc..fda7046 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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": [ diff --git a/server/src/mv/tags.ts b/server/src/mv/tags.ts index 19dc4c4..48ac7c1 100644 --- a/server/src/mv/tags.ts +++ b/server/src/mv/tags.ts @@ -714,6 +714,7 @@ export const tags: Record = { "/" ], "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 to ignore tag objects.", + "engine": ">=5.10", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -952,6 +953,7 @@ export const tags: Record = { "/" ], "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Ā  .", + "engine": ">=5.10", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -1127,6 +1129,7 @@ export const tags: Record = { "/" ], "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 or tags.", + "engine": ">=5.00", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -1250,7 +1253,7 @@ export const tags: Record = { "/" ], "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 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 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": "$0", + "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", "label": "MvDO", @@ -1264,6 +1267,10 @@ export const tags: Record = { "/" ], "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": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -1292,6 +1299,10 @@ export const tags: Record = { "/" ], "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 , 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": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -2175,6 +2186,7 @@ export const tags: Record = { "/" ], "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 tag is \nused to skip importing movies made before the year 2000.", + "engine": ">=5.10", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -2876,6 +2888,7 @@ export const tags: Record = { "/" ], "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 tag is used to skip \ndisplaying messages if they return true from a user defined function called SpamFilter().", + "engine": ">=5.10", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -3066,6 +3079,7 @@ export const tags: Record = { "/" ], "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": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", @@ -3556,6 +3570,7 @@ export const tags: Record = { "/" ], "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 tag is used to skip \nitems in the list that start with the letters N through Z", + "engine": ">=5.10", "insertText": "$0", "insertTextFormat": "Snippet", "kind": "TypeParameter", diff --git a/server/src/mvt/tags.ts b/server/src/mvt/tags.ts index 681d184..b4ab89d 100644 --- a/server/src/mvt/tags.ts +++ b/server/src/mvt/tags.ts @@ -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, @@ -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: { @@ -560,7 +568,7 @@ These global variables reference a specific module file. The Limited Source Kit if: { ...baseTag, documentation: ``, - insertText: "\n\t${2:$3\n\n\t}${0}\n", + insertText: "\n\t$2\n$0", label: 'mvt:if', reference: 'https://docs.miva.com/template-language/if-statement', selfClosing: false, diff --git a/server/src/util/interfaces.ts b/server/src/util/interfaces.ts index 711300e..d2c06f6 100644 --- a/server/src/util/interfaces.ts +++ b/server/src/util/interfaces.ts @@ -5,6 +5,7 @@ import { import { CodeAction, CodeActionContext, + Command, CompletionItemKind, CompletionList, Definition, @@ -155,6 +156,7 @@ export interface TagData extends BaseTagData { attributes?: Record; selfClosing: boolean; void: boolean; + command?: Command } export interface TagSnippet extends BaseTagData { diff --git a/syntaxes/MV/mv.injection.tmLanguage.json b/syntaxes/MV/mv.injection.tmLanguage.json index 9911b49..fed064c 100644 --- a/syntaxes/MV/mv.injection.tmLanguage.json +++ b/syntaxes/MV/mv.injection.tmLanguage.json @@ -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" diff --git a/syntaxes/MV/mv.injection.tmLanguage.yaml b/syntaxes/MV/mv.injection.tmLanguage.yaml index 13fa3f3..1eae2fb 100644 --- a/syntaxes/MV/mv.injection.tmLanguage.yaml +++ b/syntaxes/MV/mv.injection.tmLanguage.yaml @@ -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'