vaderjs 1.2.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "A Reactive Framework for Building Content Rich Single-Page Applications (SPA)",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,17 +0,0 @@
1
- // A launch configuration that launches the extension inside a new window
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- {
6
- "version": "0.2.0",
7
- "configurations": [
8
- {
9
- "name": "Extension",
10
- "type": "extensionHost",
11
- "request": "launch",
12
- "args": [
13
- "--extensionDevelopmentPath=${workspaceFolder}"
14
- ]
15
- }
16
- ]
17
- }
@@ -1,4 +0,0 @@
1
- .vscode/**
2
- .vscode-test/**
3
- .gitignore
4
- vsc-extension-quickstart.md
@@ -1,9 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to the "vader" extension will be documented in this file.
4
-
5
- Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6
-
7
- ## [Unreleased]
8
-
9
- - Initial release
@@ -1,26 +0,0 @@
1
- # vader README
2
-
3
-
4
- ## Features
5
-
6
- HTML syntax highlighting for vader files & intellisense / autocomplete for html elements and vader.js methods
7
-
8
- Shows deprecated methods as deprecated in the intellisense - and shows suggestions for alternatives
9
-
10
- ## Requirements
11
-
12
- Common knowlege of HTML and vader.js!
13
-
14
-
15
- ## Known Issues
16
-
17
-
18
-
19
- ## Release Notes
20
-
21
- Users appreciate release notes as you update your extension.
22
-
23
- ### 1.0.0
24
-
25
- Initial release of vader
26
-
@@ -1,70 +0,0 @@
1
- const vscode = require('vscode');
2
- const html_completes = require('./html_completion/html_completion');
3
- function activate(context) {
4
-
5
- let completes = []
6
- const include = vscode.languages.registerCompletionItemProvider(
7
- 'vader',
8
- {
9
- provideCompletionItems(document, position) {
10
- const linePrefix = document.lineAt(position).text.trim();
11
- if(!linePrefix.startsWith('in')) {
12
- return undefined;
13
- }
14
- let complete = new vscode.CompletionItem('include()', vscode.CompletionItemKind.Function);
15
- complete.insertText = new vscode.SnippetString('include("${1:file}")');
16
-
17
- complete.tags = [vscode.CompletionItemTag.Deprecated]
18
-
19
- complete.documentation = new vscode.MarkdownString(`Include a view file into your template\n - @param \`\string\`\ file - The file to include\n- @returns {string} - the parsed html code to client`, true)
20
- return [complete]
21
- }
22
- },
23
- )
24
-
25
- const comment = vscode.languages.registerCompletionItemProvider('vader', {
26
- provideCompletionItems(document, position) {
27
- const linePrefix = document.lineAt(position).text.slice(0, position.character);
28
- if(!linePrefix.includes('-')) {
29
- return undefined;
30
- }
31
- let complete = new vscode.CompletionItem('-', vscode.CompletionItemKind.Property);
32
- complete.insertText = new vscode.SnippetString('-- \n ${1:comment} \n--');
33
- complete.documentation = new vscode.MarkdownString(`Create a multi line comment`, true)
34
- return [complete]
35
-
36
- },
37
- }, )
38
-
39
- const syntaxeror = vscode.languages.registerCompletionItemProvider('vader', {
40
- provideCompletionItems(document, position) {
41
- let firstline = document.lineAt(0).text.trim();
42
- let lastline = document.lineAt(document.lineCount - 1).text.trim();
43
- if(!firstline.includes('body') || !lastline.includes('body')) {
44
-
45
- vscode.window.showWarningMessage('Syntax error: missing <body> tag in template\n vader may cut off your code if not present')
46
-
47
- return undefined;
48
- }
49
- },
50
- })
51
-
52
-
53
-
54
-
55
- const includehover = vscode.languages.registerHoverProvider('vader', {
56
- provideHover(document, position) {
57
- const linePrefix = document.lineAt(position).text.slice(0, position.character);
58
- if (!linePrefix.startsWith('in')) {
59
- return undefined;
60
- }
61
- let complete = new vscode.Hover(new vscode.MarkdownString(`Include a view file into your template\n - @param {string} file - The file to include\n- @returns {string} - the parsed html code to client`, true))
62
- return complete
63
- }
64
- })
65
-
66
-
67
- context.subscriptions.push(include, html_completes, comment, includehover, syntaxeror,completes);
68
- }
69
-
70
- module.exports.activate = activate;
@@ -1,91 +0,0 @@
1
- const vscode = require('vscode');
2
- let completes = []
3
- const html_completes = vscode.languages.registerCompletionItemProvider('vader', {
4
- provideCompletionItems(document, position) {
5
- let line = document.lineAt(position).text.trim();
6
-
7
- let {tags, attributes} = JSON.parse(require('fs').readFileSync(require('path').join(__dirname, 'html_completion.json'), 'utf8'))
8
-
9
- let items = []
10
-
11
-
12
-
13
- for(tag in tags){
14
-
15
- if(!line.startsWith('<') && !line.endsWith('>')){
16
- continue
17
- }
18
- let complete = new vscode.CompletionItem(tag, tags[tag].type && tags[tag].type === "keyword" ? vscode.CompletionItemKind.Keyword : vscode.CompletionItemKind.Module);
19
- // make sure its not in range between a entering < and closing > with a space in between
20
- if(line.startsWith('<') && line.endsWith('>') && line.includes(' ')){
21
- // remove the tag from the completion
22
- let line = document.lineAt(position).text.trim();
23
- complete.range = new vscode.Range(new vscode.Position(position.line, line.indexOf('<')), new vscode.Position(position.line, line.indexOf('<') + tag.length))
24
- }
25
- complete.insertText = new vscode.SnippetString(tags[tag].body);
26
- if(tags[tag].deprecated){
27
- complete.tags = [vscode.CompletionItemTag.Deprecated]
28
- }
29
- complete.documentation = new vscode.MarkdownString(tags[tag].description, true)
30
- items.push(complete)
31
- }
32
- for(attribute in attributes){
33
- let line = document.lineAt(position).text.trim();
34
- if(line.includes('<') || line.includes('>') ){
35
- let tag = line.split('<')[1] ? line.split('<')[1].split('>')[0].split(' ')[0] : line.split('>')[0]
36
- let valid_in = attributes[attribute].valid_in
37
- if(valid_in.includes(tag) || valid_in.includes('*')){
38
- let complete = new vscode.CompletionItem(attribute, vscode.CompletionItemKind.Property);
39
- if(attributes[attribute].deprecated){
40
- complete.tags = [vscode.CompletionItemTag.Deprecated]
41
- }
42
- complete.insertText = new vscode.SnippetString(attributes[attribute].body);
43
- complete.documentation = new vscode.MarkdownString(attributes[attribute].description, true)
44
- items.push(complete)
45
- }
46
-
47
-
48
-
49
- }
50
- }
51
- return items
52
- },
53
- } , )
54
-
55
- const hovercompletes = vscode.languages.registerHoverProvider('vader', {
56
- provideHover(document, position) {
57
- let selection = document.getText(document.getWordRangeAtPosition(position));
58
-
59
-
60
- let {tags, attributes} = JSON.parse(require('fs').readFileSync(require('path').join(__dirname, 'html_completion.json'), 'utf8'))
61
- let line = document.lineAt(position.line).text.trim();
62
-
63
- // make sure no attributes are in the hover position
64
- if (selection === line.split('<')[1].split('>')[0].split(' ')[0]) {
65
- let tag = line.split('<')[1].split('>')[0].split(' ')[0]
66
- if (tags[tag]) {
67
- return new vscode.Hover(new vscode.MarkdownString(tags[tag].description, true))
68
- }
69
- }
70
- // get the parent tag
71
- let parent_tag = line.split('<')[1].split('>')[0].split(' ')[0]
72
- // get the attribute
73
- let tag_attributes = line.split('<')[1].split('>')[0].split(' ')
74
- for (let i = 0; i < tag_attributes.length; i++) {
75
- let attribute = tag_attributes[i]
76
- if (attribute.includes('=')) {
77
- attribute = attribute.split('=')[0]
78
- }
79
- if (attribute === selection) {
80
- if (attributes[attribute]) {
81
- return new vscode.Hover(new vscode.MarkdownString(attributes[attribute].description, true))
82
- }
83
- }
84
- }
85
-
86
- return null; // Return null if no matching tag or attribute is found.
87
- }
88
- });
89
- completes.push(html_completes, hovercompletes)
90
-
91
- module.exports = completes