mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes to lsp.py with respect to Windows drive-letter paths in URI.
This commit is contained in:
parent
f308f1a1f8
commit
c2f245b40a
@ -12,6 +12,7 @@ import tty
|
||||
import functools
|
||||
from collections import namedtuple
|
||||
from copy import deepcopy
|
||||
from pathlib import PurePath
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
from itertools import islice
|
||||
|
||||
@ -694,7 +695,7 @@ class SolidityLSPTestSuite: # {{{
|
||||
args = create_cli_parser().parse_args()
|
||||
self.solc_path = args.solc_path
|
||||
self.project_root_dir = os.path.realpath(args.project_root_dir) + "/test/libsolidity/lsp"
|
||||
self.project_root_uri = "file://" + self.project_root_dir
|
||||
self.project_root_uri = PurePath(self.project_root_dir).as_uri()
|
||||
self.print_assertions = args.print_assertions
|
||||
self.trace_io = args.trace_io
|
||||
self.test_pattern = args.test_pattern
|
||||
@ -777,7 +778,7 @@ class SolidityLSPTestSuite: # {{{
|
||||
return f"{self.project_root_dir}/{test_case_name}.sol"
|
||||
|
||||
def get_test_file_uri(self, test_case_name):
|
||||
return "file://" + self.get_test_file_path(test_case_name)
|
||||
return PurePath(self.get_test_file_path(test_case_name)).as_uri()
|
||||
|
||||
def get_test_file_contents(self, test_case_name):
|
||||
"""
|
||||
@ -1438,7 +1439,7 @@ class SolidityLSPTestSuite: # {{{
|
||||
"""
|
||||
|
||||
self.setup_lsp(solc)
|
||||
FILE_A_URI = f'file://{self.project_root_dir}/a.sol'
|
||||
FILE_A_URI = f'{self.project_root_uri}/a.sol'
|
||||
solc.send_message('textDocument/didOpen', {
|
||||
'textDocument': {
|
||||
'uri': FILE_A_URI,
|
||||
@ -1466,7 +1467,7 @@ class SolidityLSPTestSuite: # {{{
|
||||
)
|
||||
reports = self.wait_for_diagnostics(solc)
|
||||
self.expect_equal(len(reports), 1, '')
|
||||
self.expect_equal(reports[0]['uri'], f'file://{self.project_root_dir}/lib.sol', "")
|
||||
self.expect_equal(reports[0]['uri'], f'{self.project_root_uri}/lib.sol', "")
|
||||
self.expect_equal(len(reports[0]['diagnostics']), 0, "should not contain diagnostics")
|
||||
|
||||
def test_textDocument_didChange_at_eol(self, solc: JsonRpcProcess) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user