Skip to content

Commit

Permalink
use vyper cli to get search paths
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Aug 10, 2024
1 parent facadfe commit 100783f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vyper_lsp/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from vyper.compiler import CompilerData
from vyper.compiler.input_bundle import FilesystemInputBundle
from vyper.utils import VyperException
from vyper.cli.vyper_compile import get_search_paths
import warnings
import re

Expand Down Expand Up @@ -41,9 +42,9 @@ def build_ast(self, doc: Document) -> List[Diagnostic]:
src = doc.source
uri = doc.uri
processed_uri = uri.replace("file://", "")
uri_path = Path(processed_uri)
uri_parent_path = uri_path.parent
compiler_data = CompilerData(src, input_bundle=FilesystemInputBundle([uri_parent_path]))
uri_parent_path = Path(processed_uri).parent
search_paths = get_search_paths([str(uri_parent_path)])
compiler_data = CompilerData(src, input_bundle=FilesystemInputBundle(search_paths))
diagnostics = []
replacements = {}
warnings.simplefilter("always")
Expand Down

0 comments on commit 100783f

Please sign in to comment.