Skip to content

Commit

Permalink
fix path to error file
Browse files Browse the repository at this point in the history
  • Loading branch information
pizza-777 committed Sep 12, 2023
1 parent b23dc85 commit 68cdaf8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "solidity-support",
"displayName": "Everscale Solidity Support",
"description": "Everscale Solidity Language for Visual Studio Code",
"version": "1.4.47",
"version": "1.4.48",
"keywords": [
"solidity",
"ton-solidity",
Expand Down
10 changes: 8 additions & 2 deletions src/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ function searchPath(absolutePath) {
return _path;
}
const basePath = vscode.workspace.workspaceFolders[0].uri.fsPath;
const fromRoot = path.resolve(basePath, absolutePath).toLowerCase()// useful for win
let fromRoot = path.resolve(basePath, absolutePath)// useful for win
if (fs.existsSync(fromRoot)) {
return fromRoot;
}
//with lower case
fromRoot = path.resolve(basePath, absolutePath).toLowerCase()// useful for win
if (fs.existsSync(fromRoot)) {
return fromRoot;
}
Expand All @@ -130,5 +135,6 @@ function searchPath(absolutePath) {

module.exports = {
astParser,
findHoverNode
findHoverNode,
searchPath
}
8 changes: 5 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { findHoverNode } = require("./ast");
const { astHoverMarkdown } = require("./ast/astHoverMarkdown")
const snippetsJsonHover = require("./snippets/hover.json");
const wordsSetHover = snippetsJsonHover['.source.ton-solidity'];
const { searchPath } = require('./ast.js');

const fs = require("fs");
const path = require('path');
Expand Down Expand Up @@ -84,8 +85,9 @@ function getErrorFilePath(string) {
const filePath = string.match(/--> (.+?\.t?sol)/);
if (filePath == null || !filePath[1]) return null;

if (fs.existsSync(filePath[1])) {
return path.resolve(filePath[1]);
const resolvedPath = searchPath(filePath[1])
if (resolvedPath) {
return resolvedPath;
}
return vscode.window.activeTextEditor.document.uri.fsPath;
}
Expand Down Expand Up @@ -118,7 +120,7 @@ function getErrors(string) {
}
const filePath = getErrorFilePath(value.join("\n"));
if (filePath == null) {
// throw "some technical errors, maybe compiller";
// throw "some technical errors, maybe compiller";
return;
}
let source = vscode.Uri.file(filePath);
Expand Down

0 comments on commit 68cdaf8

Please sign in to comment.