@sailshq/language-server 0.2.3 → 0.3.2

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/SailsParser.js CHANGED
@@ -66,6 +66,13 @@ class SailsParser {
66
66
  while ((match = regex.exec(content))) {
67
67
  const route = match[1]
68
68
  const actionName = match[2]
69
+
70
+ // Skip redirects and external URLs
71
+ // Routes that start with '/' or contain '://' are redirects, not actions
72
+ if (actionName.startsWith('/') || actionName.includes('://')) {
73
+ continue
74
+ }
75
+
69
76
  const filePath = path.join(actionsRoot, ...actionName.split('/')) + '.js'
70
77
 
71
78
  const actionInfo = await this.#parseAction(filePath)
@@ -3,7 +3,7 @@ const path = require('path')
3
3
 
4
4
  module.exports = async function goToAction(document, position, typeMap) {
5
5
  const fileName = path.basename(document.uri)
6
- if (fileName !== 'routes.js') return null
6
+ if (fileName !== 'routes.js') return []
7
7
 
8
8
  const text = document.getText()
9
9
  const offset = document.offsetAt(position)
@@ -39,5 +39,5 @@ module.exports = async function goToAction(document, position, typeMap) {
39
39
  }
40
40
  }
41
41
  }
42
- return null
42
+ return []
43
43
  }
package/index.js CHANGED
@@ -101,7 +101,7 @@ connection.onDefinition(async (params) => {
101
101
  helperDefinition,
102
102
  modelDefinition
103
103
  ].filter(Boolean)
104
- return definitions.length > 0 ? definitions : null
104
+ return definitions
105
105
  })
106
106
 
107
107
  connection.onCompletion(async (params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sailshq/language-server",
3
- "version": "0.2.3",
3
+ "version": "0.3.2",
4
4
  "description": "Language Server Protocol server for Sails Language Service",
5
5
  "homepage": "https://sailjs.com",
6
6
  "repository": {
@@ -282,7 +282,10 @@ module.exports = function validateModelAttributeExist(document, typeMap) {
282
282
  'min',
283
283
  'max',
284
284
  'distinct',
285
- 'meta'
285
+ 'meta',
286
+ 'or',
287
+ 'and',
288
+ 'not'
286
289
  ]
287
290
  // For non-create methods, validate all top-level keys except query option keys
288
291
  if (