continue icon indicating copy to clipboard operation
continue copied to clipboard

[error] Error: Parsing failed

Open jyomu opened this issue 1 year ago • 10 comments

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: v0.9.182 (pre-release)
- IDE: vscode 1.91.0
- Model:
- config.json:

Description

// at _Parser.parse (c:\Users\jyomu\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:89096:81)
              parse(e4, t4, r4) {
                if ("string" == typeof e4)
                  currentParseCallback = (t5, r5, _4) => e4.slice(t5, _4);
                else {
                  if ("function" != typeof e4)
                    throw new Error("Argument must be a string or a function");
                  currentParseCallback = e4;
                }
                this.logCallback ? (currentLogCallback = this.logCallback, C._ts_parser_enable_logger_wasm(this[0], 1)) : (currentLogCallback = null, C._ts_parser_enable_logger_wasm(this[0], 0));
                let _3 = 0, s4 = 0;
                if (r4 && r4.includedRanges) {
                  _3 = r4.includedRanges.length, s4 = C._calloc(_3, SIZE_OF_RANGE);
                  let e5 = s4;
                  for (let t5 = 0; t5 < _3; t5++)
                    marshalRange(e5, r4.includedRanges[t5]), e5 += SIZE_OF_RANGE;
                }
                const n2 = C._ts_parser_parse_wasm(this[0], this[1], t4 ? t4[0] : 0, s4, _3);
                if (!n2)
                  throw currentParseCallback = null, currentLogCallback = null, new Error("Parsing failed");//:89096
                const a2 = new Tree(INTERNAL, n2, this.language, currentParseCallback);
                return currentParseCallback = null, currentLogCallback = null, a2;
              }

// 	at _ImportDefinitionsService._getFileInfo (c:\Users\jyomu\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:90002:28)
      async _getFileInfo(filepath) {
        const parser = await getParserForFile(filepath);
        if (!parser) {
          return {
            imports: {}
          };
        }
        const ast = parser.parse(await this.ide.readFile(filepath), void 0, {//:90002
          includedRanges: [
            {
              startIndex: 0,
              endIndex: 1e4,
              startPosition: { row: 0, column: 0 },
              endPosition: { row: 100, column: 0 }
            }
          ]
        });

//	at async PrecalculatedLruCache.initKey (c:\Users\jyomu\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:87952:25)
      async initKey(key) {
        const index2 = this.items.findIndex((item) => item[0] === key);
        if (index2 < 0) {
          const value = await this.calculateValue(key);//:87952
          this.items.push([key, value]);
          if (this.items.length > this.N) {
            this.items.shift();
          }
        } else {
          const [item] = this.items.splice(index2, 1);
          this.items.push(item);
        }
      }

https://github.com/continuedev/continue/blob/ed37dcfb7ab98d7a70759991cbf4abe868beea89/core/util/LruCache.ts#L8-L25

To reproduce

No response

Log output

2024-07-14 11:21:07.632 [error] Error: Parsing failed
	at _Parser.parse (c:\Users\*\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:89096:81)
	at _ImportDefinitionsService._getFileInfo (c:\Users\*\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:90002:28)
	at async PrecalculatedLruCache.initKey (c:\Users\*\.vscode\extensions\continue.continue-0.9.182-win32-x64\out\extension.js:87952:25)

jyomu avatar Jul 14 '24 02:07 jyomu