norn-cli 1.3.15 → 1.3.16

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.16] - 2026-02-13
6
+
7
+ ### Fixed
8
+ - **IntelliSense**: Additional completion fixes and reliability improvements
9
+
5
10
  ## [1.3.15] - 2026-02-13
6
11
 
7
12
  ### Fixed
package/dist/cli.js CHANGED
@@ -20075,50 +20075,45 @@ function getNamedRequest(text, name) {
20075
20075
  (r) => r.name === name || r.name.toLowerCase() === name.toLowerCase()
20076
20076
  );
20077
20077
  }
20078
- function extractVariables(text) {
20079
- const variables = {};
20080
- const variableRegex = /^\s*var\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.+)$/gm;
20081
- const runtimePatterns = [
20082
- /^run\s+/i,
20083
- // var x = run ... (scripts/sequences)
20084
- /^\$\d+/,
20085
- // var x = $1... (response captures)
20086
- /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+/i
20087
- // var x = METHOD url (request captures)
20088
- ];
20089
- let match;
20090
- while ((match = variableRegex.exec(text)) !== null) {
20091
- let value = match[2].trim();
20092
- const isRuntimeValue = runtimePatterns.some((pattern) => pattern.test(value));
20093
- if (isRuntimeValue) {
20094
- continue;
20095
- }
20096
- if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
20097
- value = value.slice(1, -1);
20098
- }
20099
- variables[match[1]] = value;
20100
- }
20101
- return variables;
20078
+ var RUNTIME_VARIABLE_VALUE_PATTERNS = [
20079
+ /^run\s+/i,
20080
+ // var x = run ... (scripts/sequences)
20081
+ /^\$\d+/,
20082
+ // var x = $1... (response captures)
20083
+ /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+/i
20084
+ // var x = METHOD url (request captures)
20085
+ ];
20086
+ function isRuntimeComputedVariableValue(value) {
20087
+ return RUNTIME_VARIABLE_VALUE_PATTERNS.some((pattern) => pattern.test(value));
20088
+ }
20089
+ function isSequenceStartDeclaration(line2) {
20090
+ return /^(?:test\s+)?sequence\s+[a-zA-Z_][a-zA-Z0-9_-]*(?:\s*\([^)]*\))?\s*$/i.test(line2);
20091
+ }
20092
+ function isSequenceEndDeclaration(line2) {
20093
+ return /^end\s+sequence\s*$/i.test(line2);
20102
20094
  }
20103
20095
  function extractFileLevelVariables(text) {
20104
20096
  const variables = {};
20105
20097
  const lines = text.split("\n");
20106
20098
  const variableRegex = /^\s*var\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.+)$/;
20107
- let inSequence = false;
20099
+ let sequenceDepth = 0;
20108
20100
  for (const line2 of lines) {
20109
20101
  const trimmed = line2.trim();
20110
- if (/^sequence\s+[a-zA-Z_][a-zA-Z0-9_-]*$/.test(trimmed)) {
20111
- inSequence = true;
20102
+ if (isSequenceStartDeclaration(trimmed)) {
20103
+ sequenceDepth++;
20112
20104
  continue;
20113
20105
  }
20114
- if (trimmed === "end sequence") {
20115
- inSequence = false;
20106
+ if (isSequenceEndDeclaration(trimmed)) {
20107
+ sequenceDepth = Math.max(0, sequenceDepth - 1);
20116
20108
  continue;
20117
20109
  }
20118
- if (!inSequence) {
20110
+ if (sequenceDepth === 0) {
20119
20111
  const match = line2.match(variableRegex);
20120
20112
  if (match) {
20121
20113
  let value = match[2].trim();
20114
+ if (isRuntimeComputedVariableValue(value)) {
20115
+ continue;
20116
+ }
20122
20117
  if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
20123
20118
  value = value.slice(1, -1);
20124
20119
  }
@@ -20367,7 +20362,7 @@ async function resolveImports(text, baseDir, readFile2, alreadyImported = /* @__
20367
20362
  if (nestedResult.importedContent) {
20368
20363
  importedContents.push(nestedResult.importedContent);
20369
20364
  }
20370
- const importedVariables = extractVariables(content);
20365
+ const importedVariables = extractFileLevelVariables(content);
20371
20366
  const importedNamedRequests = extractNamedRequests(content);
20372
20367
  const importedSequences = extractSequencesFromText(content);
20373
20368
  for (const req of importedNamedRequests) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "norn-cli",
3
3
  "displayName": "Norn - REST Client",
4
4
  "description": "A powerful REST client for making HTTP requests with sequences, variables, scripts, and cookie support",
5
- "version": "1.3.15",
5
+ "version": "1.3.16",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"